标签:namespace inf str round map return include ffffff font
Marjar Cola
///@author Sycamore, ZJNU ///@date 4/9/2017 #include <iostream> #include <sstream> #include <iomanip> #include <cmath> #include <string> #include <algorithm> #include <numeric> #include <functional> #include <vector> #include <set> #include <list> #include <stack> #include <queue> #include <map> #include <algorithm> #include <cctype> #include<fstream> #include<cstdio> //#define cin fin //#define cout fout //ifstream fin("in.txt"); //ofstream fout("out.txt"); using namespace std; typedef vector<int> VI; typedef pair<int, int> PII; int main() { int T; cin >> T; while (T--) { int x, y, a, b; cin >> x >> y >> a >> b; int c = 0, d = 0; while (a >= x || b >= y) { if (a >= x) { a = a - x + 1; b++; c++; } if (b >= y) { b = b - y + 1; a++; c++; } d++; if (d == 100000) { break; } } if (d == 100000)cout << "INF" << endl; else cout << c << endl; } return 0; }
标签:namespace inf str round map return include ffffff font
原文地址:http://www.cnblogs.com/zjnu/p/7296382.html