mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
20 lines
345 B
C++
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;
|
||
|
}
|