Sherlock Being tired with the usual coding rounds started growing his interest towards reverse coding when he won the event in his college symposium. He wondered if his friend has the brain to quickly identify the pattern and verify if his inputs are correct or not. From the example portion given below, where you will be given a number(n) and its output, Using this find the pattern. Your task is that from the pattern you identified above, You have to tell if for the given n whether the given m is the correct answer or not...
The first line consists of T, the number of test cases. then T lines follow. Each line consists of n and m.
For each n and m output 1 if m is the corresponsing input for the value of n and 0 otherwise.
1 <= t <= 50
0 <= n <= 1000
0 <= m <= 106
Example to identify the pattern :
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.