Reputation: 33
find out the number of distinct ways such that
(i + 2*j+k ) % (x + y + 2*z) = 0
where 1 <= i, j, k, x, y, z <= N.
N <=1000
Edit : In case of N=1, the only possible way is i = j = k = x = y = z =1.
Upvotes: 1
Views: 64
Reputation: 1
As, maximum possible value of N is 1000 and for remainder to be 0 numerator must be multiple of denominator. assume numerator as A and denominator as D. then, A=kD where k is an integer. for finding k we need to find summation of 1000 + [1000/2] + [1000/3] +......+ [1000/999] + [1000/1000] where [.] is gif. solve this and that will be the answer.
Upvotes: 0