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

using namespace std;
#define IOS ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
#define ll long long


int main() {

    IOS

    int t;cin>>t;
    while(t--){
        int n,k;cin>>n>>k;
        cout<<(int)ceil(--k/2.0)<<"\n";

    }



}
Copy
Ramadan Candies HusseinSaad
GNU G++17
6 ms
376 KB
Accepted