Source Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
void MOUST(){
    ios_base::sync_with_stdio(0);
           cin.tie(0);
}
int main(){
    MOUST();

    int q;cin>>q;
    while(q--){
        ll n,k;cin>>n>>k;
        if(n+1==k)
            cout<<n/2<<"\n";
        else
            cout<<"0\n";
    }    
}
Copy
Ramadan Candies call911kid
GNU G++17
3 ms
376 KB
Wrong Answer