#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
#define mset(x) memset(x, 0, sizeof(x))
#define rep(i,x,y) for(int i=x; i<=y; i++)
typedef long long ll;
int a, b, c, t;
int main(){
// freopen("a.txt", "r", stdin);
cin>>t;
while(cin>>a>>b>>c){
int x=1, ans=0;
while(a*x+b<=c){
if( (c-a*x)%b==0 )
ans++;
x++;
}
cout<<ans<<endl;
}
return 0;
}
/*DESCRIPTION:
*/
hdu4993 ax+by=c的解数,暴力水
最新推荐文章于 2018-03-29 20:11:36 发布