Find k-th character in string
Submissions: 10168   Accuracy:

34.01%

  Difficulty: Basic   Marks: 1

Given a decimal number m. Convert it in binary string and apply n iterations, in each iteration 0 becomes 01 and 1 becomes 10. Find kth character in the string after nth iteration.

Input:
The first line consists of an integer T i.e number of test cases. The first and only line of each test case consists of three integers m,k,n

Output:
Print the required output.

Constraints: 
1 <= T <= 100
1 <= m <= 50
1 <= n <= 10
0 <= k <|Length of final string|

Example:
Input:

2
5 5 3
11 6 4

Output:
1
1

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Ashtputre
Author: saksham0751


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.