OJ-Problems-Source/HDOJ/4993_autoAC.cpp
2016-09-10 11:34:41 +08:00

20 lines
345 B
C++

#include<stdio.h>
int main ()
{
int t ,a ,b ,c ,Ans ,x ,y;
scanf("%d" ,&t);
while(t--)
{
scanf("%d %d %d" ,&a ,&b ,&c);
x = 1 ,Ans = 0;
while(1)
{
if(x * a >= c) break;
if((c - x * a) % b == 0) Ans ++;
x ++;
}
printf("%d\n" ,Ans);
}
return 0;
}