Codeforces Round 946 (Div. 3)
A.Phone Desktop
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e6+10; int x,y; int ans; int room; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--) { cin >> x >> y; ans = (y+1)/2; if(y%2==0) { room=7*ans; } else { room=7*ans+4; } while(room<x) { room+=15; ans++; } cout << ans << "\n"; } return 0; }
|