/******************************************************************** * @file Main_practise.cpp * @date 2014-9-12 * @author Tiger * @brief Revenge of ex-Euclid ********************************************************************/ #include <cstdio> int main(int argc, const char* argv[]) { int nTestCases = 0; scanf("%d", &nTestCases); while (nTestCases--) { int nA = 0, nB = 0, nC = 0; scanf("%d%d%d", &nA, &nB, &nC); int nMin = 1, nMax = nC/nA, nCnt = 0; for (int nX=nMin; nX<= nMax; ++nX) { if ((nC - nA*nX > 0) && ((nC - nA*nX)%nB == 0)) { ++nCnt; } } printf("%d\n", nCnt); } return 0; }
时间: 2025-01-02 13:59:28