hiho week 77 register

Ended

Participants:382

Verdict:Accepted
Score:100 / 100
Submitted:2015-12-20 15:07:34

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
using namespace std;
int calc(int k, int n)
{
    if(n==0) return 0;
    if (k%4 == 2 || k%4 == 3) return n;
    return calc((k+3)/4, n - 1);
}
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int k,n;
        cin>>k>>n;
        cout<<calc(k,n)<<endl;
    }
    
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX