fun23.ran - [2023 Fun]Yakumo Ran


Version: v2

Submit Problemset 2000ms / 262144 KB
Difficulty:1.0x

Statement

Ran

Ran is a Shikigami who can calculate anything in the universe. To do so, she has lots of built-in functions. Today, she decides to give you some example data and the function signature of some functions and leaves YOU to guess the meanings.

All the functions only contain integers as parameters and integer as return value.

Input

On the first line is an integer $case$, the test case number for this test.

On the second line is a single string without space $hint$. Your program should NOT process it as it is used for providing hints to participants and hiding the testcases.

On the third line is an integer $n$, the number of test cases in this test.

Then $n$ lines containing several integers, the parameters for each test case.

Output

Outpit $n$ integers regarding the returns.

Scoring

Each test case worths 10 points and scoring under each test case is equally divided.

For example, if in a test case, n=5, you get 3 test cases right your score will be 6 for this test case.

Testcases

Test1

Signature & Limits

int isOdd(int num)

Examples

Input

1
Hint
3
2
5
8

Output

0
1
0

Solution

Here is a possible solution:

#include <bits/stdc++.h>
using namespace std;
int main(){
    int tc;
    string ht;
    cin>>tc>>ht;
    if(tc==1){
        int n;
        cin>>n;
        while(n--){
            int x;
            cin>>x;
            cout<<x%2<<endl;
        }
    }
}

Test2

Signature & Limits

int fetch(int index, int a0, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9)

Examples

Input

2
Hint
3
5 1 9 2 6 0 8 1 7 1 1
0 1 1 4 5 1 4 1 9 1 9
9 123 456 789 987 654 321 0 159 357 24680

Output

8
1
24680

Test3

Signature & Limits

int operationSequence(int base, int andMe, int orMe, int flipIf, int flipIf2, int unsetIf, int setIf)

Examples

Input

3
Hint
6
1 0 1 1 0 0 0
1 0 1 1 0 1 1
1 0 1 1 0 1 0
1 0 1 1 0 0 1
0 1 0 0 0 0 0
0 1 1 1 1 0 0

Output

0
1
0
1
0
1

Test4

Signature & Limits

int getSequence(int add1, int add2)

Examples

Input

4
Hint
10
1 0
1 1
1 2
0 4
2 2
3 2
1 4
1 5
3 4
10 10

Output

1
1
1
1
1
2
2
3
6
317955

More Testcases Coming Soon...


Submit