DontCallMeNuttoPleas

8Fortress

May 20th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. using lli=long long;
  4. int main(){
  5.     int t=20;
  6.     while(t--){
  7.         lli n,m;
  8.         scanf("%lld%lld",&n,&m);
  9.         if(n<m*2 || n>m*4){
  10.             printf("0\n");
  11.             continue;
  12.         }
  13.         lli B=(n/2)-m-1;
  14.         printf("%lld\n",m-B);
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment