include<stdio.h>int main() { int N,A,B,K; int tc,i,j=1,count=0; scanf("%d",&tc); for(i=1;i<=tc;i++) {
return 0; } asked 21 Feb, 20:39

You are getting Wrong answer in subtask 1 and Time limit exceeded in subtask 2. Let's take a look at each of these cases individually :) Subtask 1: (WA)I have modified your code so that it passes subtask 1  code. Subtask 2: (TLE)Notice that for this subtask, K and N can be as high as $10^{18}$. In your code, j loop runs from 1 to N, and thus  from 1 to $10^{18}$, which is the reason for the TLE. Instead, you need to find a way such that it counts, without any loops, all numbers from 1 to N, 1) Which are divisible by A (x) Then the count will be x+y2z;
Here is my AC code for this problem. Feel free to ask if you have any more doubts. Hope this helped :) answered 22 Feb, 22:23

pls check the output form of the question again. you should not print "count" and after this you will get TLA vedict, you need to change your approach for to get AC. answered 21 Feb, 21:39
