Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<bits/stdc++.h>
- #include<utility>
- #include <queue>
- #define ll long long
- #define ull unsigned long long
- #define pi 3.14159
- #define OO 2000000000
- //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
- using namespace std;
- void yasmeen_fakhri(){
- ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- int main() {
- yasmeen_fakhri();
- int t; cin>>t;
- while(t--){
- ll k ,d; cin>>k>>d;
- if(k <= d) cout<<0<<'\n';
- else{
- ll a = k -(d*7);
- if (a <= 8 ) cout<<1<<'\n';
- else{
- ll b= a-8;
- cout<<b+1<<'\n';
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement