Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- using lli=long long;
- int main(){
- int t=20;
- while(t--){
- lli n,m;
- scanf("%lld%lld",&n,&m);
- if(n<m*2 || n>m*4){
- printf("0\n");
- continue;
- }
- lli B=(n/2)-m-1;
- printf("%lld\n",m-B);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment