Source Code
#include <bits/stdc++.h>

using namespace std;
#define pb push_back
typedef long long ll;



int main(){

	int T,n,k, t,a,b;
       cin>>T;
    while(T--){
        cin>>n>>k;

         cout<<ceil((k-1)/2)<<"\n";

    }

}
Copy
Ramadan Candies mohammed_mraish
GNU G++17
44 ms
240 KB
Wrong Answer