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.0)<<"\n";

    }

}
Copy
Ramadan Candies mohammed_mraish
GNU G++17
45 ms
372 KB
Wrong Answer