Relative Content

Tag Archive for mathc++17

Command exited with non-zero status 124

#include <iostream> int main() { int t; std::cin>>t; while(t–){ int n,x,k; long long ctr=0; std::cin>>n>>x; for(int i=1;i<x-1;i++){ for(int j=x-2;j>0;j–){ k=1; while(k<=x-i-j){ if(k<=((n-i*j)/(i+j))) ctr++; k++;} } } std::cout<<ctr<<‘n’; } } Given two integers n and x, find the number of triplets (a,b,c) of positive integers such that ab+ac+bc≤n and a+b+c≤x. a,b,c are greater than 1.(c is […]