#include using namespace std; using ll = long long; using P = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; ++i) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> s >> t; auto f = [](string s) -> pair { pair res = {0,10000}; bool f = false; for(char c:s){ if(c=='-'){ f = true; continue; } if(c=='.') continue; res.first = res.first * 10 + c-'0'; } ll g = __gcd(res.first, res.second); res.first /= g, res.second /= g; if(f) res.first *= -1; return res; }; auto g = [](ll x, ll y) -> bool { if(x==1 || y==1) return true; ll ok = 1, ng = x+1; while(ok+1