Archer2.0
Collection
5 items
β’
Updated
β’
1
prompt
string | ground_truth
string | ability
string |
---|---|---|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: A triangle is called an equable triangle if its area equals its perimeter. Return `true`, if it is an equable triangle, else return `false`. You will be provided with the length of sides of the triangle. Happy Coding!
You will use the following starter code to write the solution to the problem and enclose your code within delimiters.
```python
def equable_triangle(a,b,c):
```
|
{"functional": "\ndef check(candidate):\n assert candidate(5, 12, 13) == True\n assert candidate(2, 3, 4) == False\n assert candidate(6, 8, 10) == True\n assert candidate(7, 15, 20) == True\n assert candidate(17, 17, 30) == False\n assert candidate(7, 10, 12) == False\n assert candidate(6, 11, 12) == False\n assert candidate(25, 25, 45) == False\n assert candidate(13, 37, 30) == False\n assert candidate(6, 25, 29) == True\n assert candidate(10, 11, 18) == False\n assert candidate(73, 9, 80) == False\n assert candidate(12, 35, 37) == False\n assert candidate(120, 109, 13) == False\n assert candidate(9, 10, 17) == True\n\ncheck(equable_triangle)\n "}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: As you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known as Rage of Empires.
In the game Vova can hire n different warriors; ith warrior has the type ai. Vova wants to create a balanced army hiring some subset of warriors. An army is called balanced if for each type of warrior present in the game there are not more than k warriors of this type in the army. Of course, Vova wants his army to be as large as possible.
To make things more complicated, Vova has to consider q different plans of creating his army. ith plan allows him to hire only warriors whose numbers are not less than li and not greater than ri.
Help Vova to determine the largest size of a balanced army for each plan.
Be aware that the plans are given in a modified way. See input section for details.
Input
The first line contains two integers n and k (1 β€ n, k β€ 100000).
The second line contains n integers a1, a2, ... an (1 β€ ai β€ 100000).
The third line contains one integer q (1 β€ q β€ 100000).
Then q lines follow. ith line contains two numbers xi and yi which represent ith plan (1 β€ xi, yi β€ n).
You have to keep track of the answer to the last plan (let's call it last). In the beginning last = 0. Then to restore values of li and ri for the ith plan, you have to do the following:
1. li = ((xi + last) mod n) + 1;
2. ri = ((yi + last) mod n) + 1;
3. If li > ri, swap li and ri.
Output
Print q numbers. ith number must be equal to the maximum size of a balanced army when considering ith plan.
Example
Input
6 2
1 1 1 2 2 2
5
1 6
4 3
1 1
2 6
2 6
Output
2
4
1
3
2
Note
In the first example the real plans are:
1. 1 2
2. 1 6
3. 6 6
4. 2 4
5. 4 6
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["5 1\n10 7 6 6 6\n8\n5 2\n4 5\n2 1\n5 2\n3 1\n3 1\n4 1\n5 2\n", "1 1\n1\n1\n1 1\n", "5 5\n2 1 2 4 1\n5\n5 3\n1 1\n5 1\n2 1\n2 3\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 68 35 50 58 77 87 100 57 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 82 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 49\n86 62\n91 77\n84 50\n33 66\n", "20 5\n9 5 4 10 2 1 8 9 7 4 1 5 4 9 8 10 5 8 4 10\n5\n9 13\n17 13\n6 12\n13 11\n8 8\n", "1 5\n8\n9\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n", "5 5\n3 4 4 2 1\n5\n5 5\n5 4\n5 4\n3 4\n5 5\n", "10 5\n4 5 7 3 5 6 6 8 10 9\n5\n10 8\n9 8\n7 5\n8 10\n5 8\n", "5 1\n10 7 6 6 6\n8\n5 2\n4 5\n2 1\n5 4\n3 1\n3 1\n4 1\n5 2\n", "1 1\n1\n1\n0 1\n", "5 5\n2 1 3 4 1\n5\n5 3\n1 1\n5 1\n2 1\n2 3\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 68 35 50 58 77 87 100 57 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 49\n86 62\n91 77\n84 50\n33 66\n", "20 5\n9 5 4 10 2 1 8 9 7 4 1 5 4 9 8 10 5 8 4 10\n5\n9 13\n17 13\n6 12\n13 19\n8 8\n", "1 5\n8\n9\n1 1\n1 1\n1 1\n0 1\n1 1\n1 1\n1 1\n1 1\n1 1\n", "5 5\n3 4 4 2 1\n5\n5 5\n5 4\n10 4\n3 4\n5 5\n", "10 5\n4 5 7 3 5 6 6 8 10 2\n5\n10 8\n9 8\n7 5\n8 10\n5 8\n", "6 2\n1 1 1 2 2 2\n5\n1 6\n4 3\n1 1\n2 6\n0 6\n", "20 5\n9 5 4 10 2 1 8 9 7 4 1 5 4 9 8 10 5 8 4 10\n5\n9 13\n17 13\n12 12\n13 19\n8 8\n", "5 5\n3 4 4 2 1\n5\n5 5\n5 4\n10 4\n3 4\n1 5\n", "6 2\n1 1 1 2 2 2\n5\n1 6\n4 3\n1 1\n2 6\n1 6\n", "5 1\n10 7 3 6 6\n8\n5 2\n4 5\n2 1\n5 1\n3 1\n3 1\n4 1\n5 2\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 92 65 50 58 77 87 100 57 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "10 11\n4 5 7 3 5 6 6 8 2 2\n5\n10 8\n9 8\n8 5\n8 10\n5 8\n", "10 11\n4 5 7 3 5 6 6 8 2 2\n5\n10 8\n9 8\n8 5\n8 10\n5 16\n", "10 11\n4 5 7 3 5 6 6 8 2 2\n5\n10 8\n9 8\n8 5\n8 10\n6 16\n", "10 11\n4 5 7 2 7 6 6 8 2 2\n5\n10 8\n9 8\n8 5\n8 10\n12 16\n", "10 11\n4 5 7 2 7 6 6 8 2 2\n5\n10 8\n9 8\n8 7\n8 10\n12 16\n", "10 11\n4 5 7 2 7 6 6 8 2 2\n5\n10 4\n9 8\n8 7\n8 10\n12 16\n", "5 1\n10 7 6 6 6\n8\n5 2\n4 5\n2 1\n5 1\n3 1\n3 1\n4 1\n5 2\n", "1 1\n1\n1\n-1 1\n", "5 5\n2 1 3 6 1\n5\n5 3\n1 1\n5 1\n2 1\n2 3\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 68 65 50 58 77 87 100 57 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 49\n86 62\n91 77\n84 50\n33 66\n", "1 5\n8\n9\n1 1\n1 1\n1 1\n0 1\n1 1\n1 1\n1 0\n1 1\n1 1\n", "10 9\n4 5 7 3 5 6 6 8 10 2\n5\n10 8\n9 8\n7 5\n8 10\n5 8\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 92 65 50 58 77 87 100 57 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 49\n86 62\n91 77\n84 50\n33 66\n", "1 5\n8\n9\n1 1\n1 1\n1 1\n-1 1\n1 1\n1 1\n1 0\n1 1\n1 1\n", "10 9\n4 5 7 3 5 6 6 8 2 2\n5\n10 8\n9 8\n7 5\n8 10\n5 8\n", "1 5\n16\n9\n1 1\n1 1\n1 1\n-1 1\n1 1\n1 1\n1 0\n1 1\n1 1\n", "10 11\n4 5 7 3 5 6 6 8 2 2\n5\n10 8\n9 8\n7 5\n8 10\n5 8\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 92 65 50 58 77 87 100 32 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "1 5\n16\n9\n1 1\n1 1\n1 1\n-1 1\n1 1\n1 2\n1 0\n1 1\n1 1\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 92 65 50 58 77 87 100 32 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 76 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 18 66 78 92 66 42 25 96 92 65 50 58 77 87 100 32 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 76 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 18 66 78 92 66 42 25 96 92 65 50 58 77 87 100 32 42 43 76 24 70 26 98 33 11 41 9 17 65 53 31 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 76 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "10 11\n4 5 7 3 7 6 6 8 2 2\n5\n10 8\n9 8\n8 5\n8 10\n6 16\n", "100 5\n45 51 23 10 62 69 36 47 47 59 58 14 54 18 66 78 92 66 42 25 96 92 65 50 58 77 87 100 32 42 43 76 24 70 26 98 33 11 41 9 17 65 53 31 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 76 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "10 11\n4 5 7 2 7 6 6 8 2 2\n5\n10 8\n9 8\n8 5\n8 10\n6 16\n", "100 5\n45 51 23 10 62 69 36 47 47 59 58 14 54 18 66 78 92 66 42 25 96 92 65 50 58 77 87 100 32 42 43 76 24 70 26 98 33 11 41 9 17 65 53 31 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 17 86 72 26 65 11 13 55 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 76 58 25 23 3 69 16\n5\n13 76\n86 62\n91 77\n84 50\n33 66\n", "10 11\n4 5 7 2 7 7 6 8 2 2\n5\n10 4\n9 8\n8 7\n8 10\n12 16\n", "5 1\n10 7 6 6 6\n8\n5 3\n4 5\n2 1\n5 2\n3 1\n3 1\n4 1\n5 2\n", "1 1\n2\n1\n1 1\n", "100 5\n45 51 23 10 62 69 48 47 47 59 58 14 54 34 66 78 92 66 42 25 96 68 35 50 58 77 87 100 57 42 43 76 24 70 26 98 33 11 41 9 17 65 53 23 45 5 24 98 73 91 92 73 51 68 82 95 24 61 88 3 64 74 28 7 77 49 55 62 64 4 51 86 72 26 65 82 13 13 31 44 10 59 83 16 27 67 2 36 52 12 3 26 36 38 58 25 23 3 69 16\n5\n13 49\n86 62\n91 77\n84 50\n33 66\n", "20 5\n9 5 4 10 2 1 8 9 7 4 1 5 4 9 8 10 3 8 4 10\n5\n9 13\n17 13\n6 12\n13 19\n8 8\n", "1 5\n8\n9\n1 1\n1 1\n1 1\n1 0\n1 1\n1 1\n1 1\n1 1\n1 1\n"], "outputs": ["3\n1\n1\n2\n3\n2\n2\n1\n", "1\n", "4\n1\n2\n2\n5\n", "37\n77\n15\n35\n68\n", "5\n17\n7\n19\n1\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n", "1\n2\n2\n2\n1\n", "9\n2\n3\n3\n8\n", "3\n1\n1\n2\n3\n2\n2\n1\n", "1\n", "4\n1\n2\n2\n5\n", "37\n77\n15\n35\n68\n", "5\n17\n7\n7\n1\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n", "1\n2\n2\n2\n1\n", "9\n2\n3\n3\n8\n", "2\n4\n1\n3\n1\n", "5\n17\n1\n15\n1\n", "1\n2\n2\n2\n2\n", "2\n4\n1\n3\n2\n", "3\n2\n1\n2\n4\n3\n2\n2\n", "64\n25\n15\n35\n68\n", "9\n2\n8\n3\n8\n", "9\n2\n8\n3\n2\n", "9\n2\n8\n3\n1\n", "9\n2\n8\n3\n5\n", "9\n2\n10\n9\n5\n", "5\n2\n10\n9\n5\n", "3\n1\n1\n2\n3\n2\n2\n1\n", "1\n", "4\n1\n2\n2\n5\n", "37\n77\n15\n35\n68\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n", "9\n2\n3\n3\n8\n", "37\n77\n15\n35\n68\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n", "9\n2\n3\n3\n8\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n", "9\n2\n3\n3\n8\n", "64\n25\n15\n35\n68\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n", "64\n25\n15\n35\n68\n", "64\n25\n15\n35\n68\n", "64\n25\n15\n35\n68\n", "9\n2\n8\n3\n1\n", "64\n25\n15\n35\n68\n", "9\n2\n8\n3\n1\n", "64\n25\n15\n35\n68\n", "5\n2\n10\n9\n5\n", "3\n1\n1\n2\n3\n2\n2\n1\n", "1\n", "37\n77\n15\n35\n68\n", "5\n17\n7\n7\n1\n", "1\n1\n1\n1\n1\n1\n1\n1\n1\n"]}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: A parking lot in the City consists of n parking spaces, standing in a line. The parking spaces are numbered from 1 to n from left to right.
When a car arrives at the lot, the operator determines an empty parking space for it. For the safety's sake the chosen place should be located as far from the already occupied places as possible. That is, the closest occupied parking space must be as far away as possible. If there are several such places, then the operator chooses the place with the minimum index from them. If all parking lot places are empty, then the car gets place number 1.
We consider the distance between the i-th and the j-th parking spaces equal to 4Β·|i - j| meters.
You are given the parking lot records of arriving and departing cars in the chronological order. For each record of an arriving car print the number of the parking lot that was given to this car.
Input
The first line contains two space-separated integers n and m (1 β€ n, m β€ 2Β·105) β the number of parking places and the number of records correspondingly.
Next m lines contain the descriptions of the records, one per line. The i-th line contains numbers ti, idi (1 β€ ti β€ 2; 1 β€ idi β€ 106). If ti equals 1, then the corresponding record says that the car number idi arrived at the parking lot. If ti equals 2, then the corresponding record says that the car number idi departed from the parking lot.
Records about arriving to the parking lot and departing from the parking lot are given chronologically. All events occurred consecutively, no two events occurred simultaneously.
It is guaranteed that all entries are correct:
* each car arrived at the parking lot at most once and departed from the parking lot at most once,
* there is no record of a departing car if it didn't arrive at the parking lot earlier,
* there are no more than n cars on the parking lot at any moment.
You can consider the cars arbitrarily numbered from 1 to 106, all numbers are distinct. Initially all places in the parking lot are empty.
Output
For each entry of an arriving car print the number of its parking space. Print the numbers of the spaces in the order, in which the cars arrive to the parking lot.
Examples
Input
7 11
1 15
1 123123
1 3
1 5
2 123123
2 15
1 21
2 3
1 6
1 7
1 8
Output
1
7
4
2
7
4
1
3
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["1 10\n1 362993\n2 362993\n1 220493\n2 220493\n1 46839\n2 46839\n1 962005\n2 962005\n1 706377\n2 706377\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "3001 1\n1 158259\n", "2 10\n1 406640\n1 310769\n2 406640\n1 344311\n2 310769\n1 521831\n2 521831\n1 240385\n2 240385\n1 961215\n", "20 10\n1 820521\n2 820521\n1 824151\n1 976674\n1 315036\n2 976674\n2 315036\n1 104563\n1 248192\n2 824151\n", "3 10\n1 482990\n1 825307\n2 825307\n1 503980\n2 482990\n1 574529\n1 76498\n2 503980\n2 574529\n1 53179\n", "4 10\n1 526637\n1 825641\n1 786965\n2 825641\n1 898203\n1 699161\n2 526637\n1 730268\n2 730268\n2 699161\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 575947\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "2 10\n1 406640\n1 310769\n2 406640\n1 344311\n2 310769\n1 521831\n2 521831\n1 240385\n2 240385\n1 814857\n", "7 11\n1 15\n1 123123\n1 3\n1 5\n2 123123\n2 15\n1 21\n2 3\n1 11\n1 7\n1 8\n", "3 10\n1 482990\n1 825307\n2 825307\n1 503980\n2 482990\n1 574529\n1 76498\n2 503980\n2 574529\n1 59042\n", "3905 1\n1 158259\n", "1678 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 99332\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "7653 20\n1 247648\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 657168\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 5351\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 99332\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 201312\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 201312\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 21111\n", "4001 20\n1 219922\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 624772\n1 332910\n1 921117\n1 653570\n", "7 11\n1 15\n1 123123\n1 3\n1 5\n2 123123\n2 15\n1 17\n2 3\n1 11\n1 7\n1 8\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 67852\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 84918\n1 285112\n1 788602\n1 615361\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 201312\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 860850\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 329562\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 21111\n", "4001 20\n1 219922\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 11798\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 67852\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 64043\n", "4001 20\n1 219922\n1 784162\n1 201312\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 860850\n1 44917\n1 82745\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 657168\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 11798\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 67852\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 466782\n1 332910\n1 921117\n1 64043\n", "4001 20\n1 247648\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 657168\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 11798\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 247648\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 78738\n1 275888\n1 657168\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 5351\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 666066\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "2 10\n1 406640\n1 310769\n2 406640\n1 480\n2 310769\n1 521831\n2 521831\n1 240385\n2 240385\n1 814857\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 144529\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 201312\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 956727\n1 21111\n", "4001 20\n1 219922\n1 569584\n1 150653\n1 49911\n1 722121\n1 808982\n1 96047\n1 78738\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 624772\n1 332910\n1 921117\n1 653570\n", "7 11\n1 15\n1 123123\n1 3\n1 5\n2 123123\n2 15\n1 17\n2 3\n1 11\n1 7\n1 14\n", "1678 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 99332\n1 789813\n1 877804\n1 50458\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 201312\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 860850\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 624772\n1 117312\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 329562\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 877804\n1 44917\n1 209422\n1 285112\n1 788602\n1 627009\n1 983182\n1 332910\n1 921117\n1 21111\n", "4001 20\n1 219922\n1 569584\n1 150653\n1 49911\n1 600728\n1 808982\n1 96047\n1 73554\n1 275888\n1 789813\n1 877804\n1 293963\n1 209422\n1 285112\n1 788602\n1 615361\n1 11798\n1 332910\n1 921117\n1 653570\n", "4001 20\n1 219922\n1 784162\n1 150653\n1 49911\n1 600728\n1 808982\n1 71325\n1 78738\n1 275888\n1 789813\n1 67852\n1 44917\n1 266195\n1 285112\n1 788602\n1 627009\n1 466782\n1 332910\n1 921117\n1 64043\n"], "outputs": ["1\n1\n1\n1\n1\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n", "1\n2\n1\n2\n2\n2\n", "1\n1\n20\n10\n20\n10\n", "1\n3\n3\n1\n2\n1\n", "1\n4\n2\n4\n3\n1\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n2\n1\n2\n2\n2\n", "1\n7\n4\n2\n7\n4\n1\n3\n", "1\n3\n3\n1\n2\n1\n", "1\n", "1\n1678\n839\n420\n1258\n1468\n210\n629\n1048\n315\n734\n1153\n1363\n1573\n105\n524\n943\n53\n157\n262\n", "1\n7653\n3827\n1914\n5740\n957\n2870\n4783\n6696\n479\n1435\n2392\n3348\n4305\n5261\n6218\n7174\n240\n718\n1196\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n7\n4\n2\n7\n4\n1\n3\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n2\n1\n2\n2\n2\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n7\n4\n2\n7\n4\n1\n3\n", "1\n1678\n839\n420\n1258\n1468\n210\n629\n1048\n315\n734\n1153\n1363\n1573\n105\n524\n943\n53\n157\n262\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n", "1\n4001\n2001\n1001\n3001\n501\n1501\n2501\n3501\n251\n751\n1251\n1751\n2251\n2751\n3251\n3751\n126\n376\n626\n"]}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: Xenny had N boxes with an integer printed on each of the boxes.
He wanted to find out how many distinct pairs of boxes that were at distance k from each other, had an absolute value of difference or sum that was a multiple of k.
Help him in this task.
(Note: Consider two indices i1 and i2. Pairs (i1, i2) and (i2, i1) are not considered to be distinct)
Input Format:
First line contains 2 space-separated integers - N and k.
Second line contains N space-separated integers.
Output Format:
Output a single line, denoting the number of required pairs.
Constraints:
2 β€ N β€ 10^6
1 β€ k β€ 1000
-1000000 β€ Integer on box β€ 1000000
SAMPLE INPUT
10 1
1 2 3 4 5 6 7 8 9 10
SAMPLE OUTPUT
9
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["10 1\n1 0 3 4 5 6 7 8 9 10\n\nSAMPLE", "2 1\n1 0 3 4 5 6 13 8 6 10\n\nSAMPLE", "10 2\n1 0 3 4 5 6 4 8 9 10\n\nTAMPLE", "2 2\n1 0 3 4 4 11 13 1 6 10\n\nSAMPLE", "10 2\n1 0 3 5 5 6 4 8 9 10\n\nTAMPLE", "3 1\n-1 1 3 5 4 11 24 9 6 10\n\nSAMPLE", "6 1\n0 1 3 1 3 6 8 5 5 10\n\nSAMPLE", "4 1\n1 2 1 4 5 6 13 8 6 7\n\nSAMPLF", "10 1\n1 0 3 4 5 6 13 8 9 10\n\nSAMPLE", "10 1\n1 0 3 4 5 6 13 8 3 10\n\nSAMPLE", "10 1\n1 0 3 4 5 6 13 8 6 10\n\nSAMPLE", "2 1\n1 0 3 4 5 11 13 8 6 10\n\nSAMPLE", "2 1\n1 0 3 4 5 11 13 9 6 10\n\nSAMPLE", "10 1\n0 2 3 4 5 6 7 8 9 10\n\nSAMPLE", "10 1\n1 0 3 4 7 6 7 8 9 10\n\nSAMPLE", "10 1\n1 0 3 4 5 6 23 8 9 10\n\nSAMPLE", "10 1\n1 0 3 4 3 6 13 8 3 10\n\nSAMPLE", "2 1\n1 0 3 4 8 6 13 8 6 10\n\nSAMPLE", "2 1\n1 0 3 4 6 11 13 8 6 10\n\nSAMPLE", "2 1\n1 0 3 4 4 11 13 9 6 10\n\nSAMPLE", "10 1\n1 0 3 4 7 6 7 8 10 10\n\nSAMPLE", "10 1\n1 0 3 4 5 6 4 8 9 10\n\nSAMPLE", "10 1\n1 0 3 4 3 6 8 8 3 10\n\nSAMPLE", "2 1\n1 0 3 4 8 6 13 8 6 8\n\nSAMPLE", "2 1\n1 0 3 4 6 11 13 1 6 10\n\nSAMPLE", "2 1\n1 1 3 4 4 11 13 9 6 10\n\nSAMPLE", "10 1\n1 0 3 5 7 6 7 8 10 10\n\nSAMPLE", "10 1\n1 0 3 4 5 6 4 8 9 10\n\nTAMPLE", "10 1\n1 -1 3 4 3 6 8 8 3 10\n\nSAMPLE", "2 1\n1 0 3 4 9 6 13 8 6 8\n\nSAMPLE", "2 1\n1 0 3 4 4 11 13 1 6 10\n\nSAMPLE", "2 1\n1 1 3 4 4 11 24 9 6 10\n\nSAMPLE", "10 1\n1 -1 3 4 3 6 8 8 5 10\n\nSAMPLE", "2 1\n1 0 3 4 9 6 13 8 6 4\n\nSAMPLE", "2 1\n0 1 3 4 4 11 24 9 6 10\n\nSAMPLE", "10 1\n1 0 3 4 3 6 8 8 5 10\n\nSAMPLE", "2 1\n1 0 3 4 9 6 13 8 6 4\n\nSAMPLF", "2 2\n0 0 3 4 4 11 13 1 6 10\n\nSAMPLE", "2 1\n0 1 3 5 4 11 24 9 6 10\n\nSAMPLE", "10 2\n1 0 3 5 5 6 4 4 9 10\n\nTAMPLE", "10 1\n1 1 3 4 3 6 8 8 5 10\n\nSAMPLE", "2 1\n1 0 3 4 5 6 13 8 6 4\n\nSAMPLF", "2 3\n0 0 3 4 4 11 13 1 6 10\n\nSAMPLE", "2 1\n-1 1 3 5 4 11 24 9 6 10\n\nSAMPLE", "10 1\n0 1 3 4 3 6 8 8 5 10\n\nSAMPLE", "2 1\n1 1 3 4 5 6 13 8 6 4\n\nSAMPLF", "2 3\n0 0 3 4 4 11 13 1 6 10\n\nSEMPLA", "10 1\n0 1 3 4 3 6 8 12 5 10\n\nSAMPLE", "2 1\n1 1 5 4 5 6 13 8 6 4\n\nSAMPLF", "2 3\n0 0 3 4 0 11 13 1 6 10\n\nSEMPLA", "3 1\n-1 1 3 5 4 11 24 10 6 10\n\nSAMPLE", "10 1\n0 1 3 4 3 6 8 5 5 10\n\nSAMPLE", "2 1\n1 2 5 4 5 6 13 8 6 4\n\nSAMPLF", "2 2\n0 0 3 4 0 11 13 1 6 10\n\nSEMPLA", "3 1\n-1 1 3 5 0 11 24 10 6 10\n\nSAMPLE", "10 1\n0 1 3 1 3 6 8 5 5 10\n\nSAMPLE", "2 1\n1 2 5 4 5 6 13 8 6 7\n\nSAMPLF", "3 2\n0 0 3 4 0 11 13 1 6 10\n\nSEMPLA", "3 1\n-1 1 3 10 0 11 24 10 6 10\n\nSAMPLE", "2 1\n1 2 1 4 5 6 13 8 6 7\n\nSAMPLF", "3 2\n0 0 3 1 0 11 13 1 6 10\n\nSEMPLA", "3 1\n-1 1 3 10 1 11 24 10 6 10\n\nSAMPLE", "6 1\n0 1 3 1 3 6 8 5 5 16\n\nSAMPLE", "3 2\n0 0 3 1 0 11 13 1 0 10\n\nSEMPLA", "3 1\n-1 1 3 10 1 11 24 10 1 10\n\nSAMPLE", "4 1\n1 2 0 4 5 6 13 8 6 7\n\nSAMPLF", "3 2\n0 0 3 1 0 11 13 2 0 10\n\nSEMPLA", "3 1\n-1 1 3 10 1 11 24 10 1 1\n\nSAMPLE", "4 1\n1 2 0 4 5 6 13 8 5 7\n\nSAMPLF", "3 2\n0 0 3 1 0 11 23 2 0 10\n\nSEMPLA", "3 1\n-1 1 3 10 1 0 24 10 1 1\n\nSAMPLE", "4 1\n1 2 0 4 3 6 13 8 5 7\n\nSAMPLF", "3 2\n0 0 3 0 0 11 23 2 0 10\n\nSEMPLA", "3 1\n-2 1 3 10 1 0 24 10 1 1\n\nSAMPLE", "4 1\n1 2 0 4 3 6 13 3 5 7\n\nSAMPLF", "0 2\n0 0 3 0 0 11 23 2 0 10\n\nSEMPLA", "1 1\n-2 1 3 10 1 0 24 10 1 1\n\nSAMPLE", "4 1\n1 2 0 4 3 1 13 3 5 7\n\nSAMPLF", "0 2\n0 0 0 0 0 11 23 2 0 10\n\nSEMPLA", "1 1\n-2 1 3 10 1 -1 24 10 1 1\n\nSAMPLE", "4 1\n1 2 0 4 0 1 13 3 5 7\n\nSAMPLF", "0 2\n0 0 0 1 0 11 23 2 0 10\n\nSEMPLA", "1 2\n-2 1 3 10 1 -1 24 10 1 1\n\nSAMPLE", "0 1\n1 2 0 4 0 1 13 3 5 7\n\nSAMPLF", "0 2\n0 1 0 1 0 11 23 2 0 10\n\nSEMPLA", "1 2\n-2 1 3 10 1 -1 24 10 1 1\n\nS@MPLE", "0 0\n1 2 0 4 0 1 13 3 5 7\n\nSAMPLF", "1 2\n0 1 0 1 0 11 23 2 0 10\n\nSEMPLA", "1 2\n-2 1 3 10 1 -1 24 10 1 1\n\nS@PMLE", "0 0\n1 2 0 4 0 2 13 3 5 7\n\nSAMPLF", "1 2\n0 1 0 1 0 11 23 2 0 10\n\nSEMPMA", "1 2\n-2 1 3 10 1 -1 24 20 1 1\n\nS@PMLE", "0 0\n1 2 0 2 0 2 13 3 5 7\n\nSAMPLF", "1 2\n0 1 0 1 0 11 23 4 0 10\n\nSEMPMA", "1 2\n-2 1 3 10 1 -1 24 20 1 1\n\nS@PNLE", "0 0\n1 2 0 2 0 3 13 3 5 7\n\nSAMPLF", "1 2\n-1 1 0 1 0 11 23 4 0 10\n\nSEMPMA", "1 2\n-2 1 5 10 1 -1 24 20 1 1\n\nS@PNLE", "0 0\n1 2 -1 2 0 3 13 3 5 7\n\nSAMPLF", "1 2\n-1 1 0 1 0 11 23 4 0 10\n\nSENPMA"], "outputs": ["9\n", "1\n", "6\n", "0\n", "4\n", "2\n", "5\n", "3\n", "9\n", "9\n", "9\n", "1\n", "1\n", "9\n", "9\n", "9\n", "9\n", "1\n", "1\n", "1\n", "9\n", "9\n", "9\n", "1\n", "1\n", "1\n", "9\n", "9\n", "9\n", "1\n", "1\n", "1\n", "9\n", "1\n", "1\n", "9\n", "1\n", "0\n", "1\n", "4\n", "9\n", "1\n", "0\n", "1\n", "9\n", "1\n", "0\n", "9\n", "1\n", "0\n", "2\n", "9\n", "1\n", "0\n", "2\n", "9\n", "1\n", "0\n", "2\n", "1\n", "0\n", "2\n", "5\n", "0\n", "2\n", "3\n", "0\n", "2\n", "3\n", "0\n", "2\n", "3\n", "0\n", "2\n", "3\n", "0\n", "0\n", "3\n", "0\n", "0\n", "3\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n", "0\n"]}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: A string is beautiful if:
It consists of the first k letters of the English lowercase alphabet.
It does not contain any substring of length 2 or more which is a palindrome.
You are given a beautiful string s of length n and a positive integer k.
Return the lexicographically smallest string of length n, which is larger than s and is beautiful. If there is no such string, return an empty string.
A string a is lexicographically larger than a string b (of the same length) if in the first position where a and b differ, a has a character strictly larger than the corresponding character in b.
For example, "abcd" is lexicographically larger than "abcc" because the first position they differ is at the fourth character, and d is greater than c.
You will use the following starter code to write the solution to the problem and enclose your code within delimiters.
```python
class Solution:
def smallestBeautifulString(self, s: str, k: int) -> str:
```
|
{"functional": "def check(candidate):\n assert candidate(s = \"abcz\", k = 26) == \"abda\"\n assert candidate(s = \"dc\", k = 4) == \"\"\n\n\ncheck(Solution().smallestBeautifulString)"}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: There are N persons called Person 1 through Person N.
You are given M facts that "Person A_i and Person B_i are friends." The same fact may be given multiple times.
If X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.
Takahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.
At least how many groups does he need to make?
-----Constraints-----
- 2 \leq N \leq 2\times 10^5
- 0 \leq M \leq 2\times 10^5
- 1\leq A_i,B_i\leq N
- A_i \neq B_i
-----Input-----
Input is given from Standard Input in the following format:
N M
A_1 B_1
\vdots
A_M B_M
-----Output-----
Print the answer.
-----Sample Input-----
5 3
1 2
3 4
5 1
-----Sample Output-----
3
Dividing them into three groups such as \{1,3\}, \{2,4\}, and \{5\} achieves the goal.
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["5 3\n1 2\n3 4\n5 1\n", "4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n", "10 4\n3 1\n4 1\n5 9\n2 6\n", "10 4\n3 1\n3 1\n5 9\n2 6", "4 10\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4", "2 0\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "10 4\n6 1\n3 1\n5 6\n2 6", "5 2\n1 4\n3 4\n3 1", "10 4\n6 1\n3 1\n5 9\n2 6", "4 10\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n1 3\n2 4\n3 4", "4 10\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n1 4\n2 4\n3 4", "5 3\n1 2\n3 4\n3 1", "10 4\n1 1\n4 1\n5 9\n2 6", "4 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4", "4 10\n1 1\n1 1\n1 2\n2 1\n1 2\n1 3\n1 4\n1 3\n2 4\n3 4", "4 10\n2 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n1 4\n2 4\n3 4", "5 3\n1 2\n3 5\n3 1", "10 4\n1 1\n4 1\n10 9\n2 6", "4 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n4 4", "5 2\n1 2\n3 4\n3 1", "2 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n4 4", "2 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "2 2\n1 1\n2 1\n1 4\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "2 2\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n1 4\n4 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n1 0\n4 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n1 0\n4 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 4", "2 0\n1 1\n1 1\n1 6\n2 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 4", "2 0\n1 1\n1 1\n1 6\n2 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 1\n1 6\n0 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 1\n1 6\n-1 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n1 6\n-1 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 3\n2 1\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 6\n2 1\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n1 6\n2 1\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 6\n2 1\n4 3\n2 4\n4 0", "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 6\n2 1\n4 3\n2 4\n4 0", "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 3\n2 4\n4 0", "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 3\n2 4\n7 0", "5 3\n2 2\n3 4\n5 1", "4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n2 4", "10 4\n3 2\n3 1\n5 9\n2 6", "4 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 1\n3 4", "4 10\n2 1\n2 1\n1 2\n2 1\n1 2\n2 3\n1 4\n1 4\n2 4\n3 4", "10 4\n1 1\n8 1\n10 9\n2 6", "4 2\n1 1\n2 1\n1 3\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n4 4", "2 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n0 3\n2 4\n4 4", "4 2\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "2 2\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n2 4", "2 0\n1 1\n2 1\n1 6\n2 1\n1 2\n0 3\n1 4\n3 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 0\n1 0\n1 3\n1 4\n3 3\n2 4\n4 4", "2 0\n1 1\n3 1\n1 6\n2 0\n1 2\n1 3\n1 4\n4 3\n2 4\n4 4", "2 1\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n1 0\n4 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n1 0\n4 4\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n2 0\n4 3\n2 4\n4 4", "2 0\n1 1\n1 1\n1 6\n2 1\n1 2\n1 3\n1 0\n4 3\n2 4\n4 4", "2 0\n1 0\n1 1\n1 6\n2 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 1\n1 6\n0 1\n1 2\n1 3\n2 1\n4 3\n2 4\n4 0", "4 0\n1 1\n1 1\n1 6\n-1 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n1 6\n-2 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 3\n2 0\n4 6\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n2 3\n2 1\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 6\n2 1\n4 3\n2 4\n7 0", "2 0\n1 2\n1 2\n0 6\n-1 1\n1 4\n0 6\n2 1\n4 3\n2 4\n4 0", "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 6\n2 1\n4 3\n0 4\n4 0", "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 5\n2 4\n4 0", "1 0\n1 1\n1 1\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 3\n2 4\n7 0", "4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 1\n2 3\n2 4\n2 4", "10 0\n3 2\n3 1\n5 9\n2 6", "10 4\n6 1\n3 1\n8 6\n2 6", "4 10\n2 1\n2 1\n1 2\n3 1\n1 2\n2 3\n1 4\n1 4\n2 4\n3 4", "2 2\n1 1\n2 1\n1 3\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n4 4", "5 2\n1 4\n3 4\n5 1", "2 2\n1 1\n2 1\n1 0\n2 1\n1 2\n1 3\n1 4\n0 3\n2 4\n4 4", "4 3\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n4 4", "2 2\n1 1\n2 1\n1 6\n2 1\n1 2\n1 3\n1 4\n3 3\n2 4\n3 4", "2 0\n1 1\n2 1\n1 6\n2 1\n1 2\n0 3\n1 4\n3 1\n2 4\n4 4", "2 0\n1 1\n1 1\n1 6\n2 0\n1 0\n1 3\n1 4\n3 3\n2 4\n4 4", "2 0\n1 1\n3 1\n1 6\n2 0\n1 2\n1 3\n0 4\n4 3\n2 4\n4 4", "2 1\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n1 -1\n4 3\n2 4\n4 4", "2 0\n1 1\n2 1\n1 2\n2 1\n1 2\n1 3\n1 0\n4 4\n2 4\n4 4", "2 0\n1 1\n2 1\n1 6\n2 0\n1 2\n1 3\n2 1\n4 3\n2 4\n4 4", "2 0\n1 1\n1 1\n1 6\n2 1\n1 2\n1 3\n1 0\n4 5\n2 4\n4 4", "2 0\n1 0\n1 1\n1 6\n2 1\n1 2\n1 3\n2 0\n1 3\n2 4\n4 0", "2 0\n1 1\n1 1\n1 6\n0 1\n1 2\n1 3\n2 1\n4 3\n2 4\n3 0", "4 0\n1 1\n1 1\n1 6\n-1 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 -1", "2 0\n1 1\n1 2\n0 6\n-2 1\n1 2\n1 3\n2 0\n4 3\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 3\n2 0\n4 5\n2 4\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n2 3\n2 1\n4 3\n2 8\n4 0", "2 0\n1 1\n1 2\n0 6\n-1 1\n1 2\n1 1\n2 1\n4 3\n2 4\n7 0", "2 0\n0 2\n1 2\n0 6\n-1 1\n1 4\n0 6\n2 1\n4 3\n2 4\n4 0", "1 0\n1 1\n1 2\n0 6\n-1 1\n1 4\n0 6\n2 1\n4 3\n0 4\n3 0", "1 0\n1 1\n2 2\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 5\n2 4\n4 0", "1 0\n1 0\n1 1\n0 6\n-1 1\n1 4\n0 12\n2 1\n4 3\n2 4\n7 0", "10 0\n3 2\n3 0\n5 9\n2 6", "10 4\n6 1\n3 1\n8 1\n2 6", "4 10\n2 1\n2 1\n1 2\n3 1\n1 2\n2 3\n1 2\n1 4\n2 4\n3 4", "2 2\n1 1\n2 1\n1 3\n2 1\n1 2\n1 3\n1 6\n2 3\n2 4\n4 4", "5 2\n1 4\n3 4\n4 1", "2 2\n1 1\n2 1\n1 0\n2 0\n1 2\n1 3\n1 4\n0 3\n2 4\n4 4", "10 4\n3 1\n4 1\n5 9\n2 6", "5 3\n1 2\n3 4\n5 1", "4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4"], "outputs": ["3\n", "4\n", "3\n", "2\n", "4\n", "1\n", "5\n", "3\n", "4\n", "4\n", "4\n", "4\n", "2\n", "2\n", "4\n", "4\n", "4\n", "2\n", "2\n", "2\n", "2\n", "2\n", "2\n", "2\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "2\n", "4\n", "4\n", "2\n", "4\n", "2\n", "2\n", "2\n", "2\n", "2\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "4\n", "1\n", "5\n", "4\n", "2\n", "3\n", "2\n", "2\n", "2\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "1\n", "5\n", "4\n", "2\n", "3\n", "2\n", "3", "3", "4"]}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: You are given a board of size n Γ n, where n is odd (not divisible by 2). Initially, each cell of the board contains one figure.
In one move, you can select exactly one figure presented in some cell and move it to one of the cells sharing a side or a corner with the current cell, i.e. from the cell (i, j) you can move the figure to cells:
* (i - 1, j - 1);
* (i - 1, j);
* (i - 1, j + 1);
* (i, j - 1);
* (i, j + 1);
* (i + 1, j - 1);
* (i + 1, j);
* (i + 1, j + 1);
Of course, you can not move figures to cells out of the board. It is allowed that after a move there will be several figures in one cell.
Your task is to find the minimum number of moves needed to get all the figures into one cell (i.e. n^2-1 cells should contain 0 figures and one cell should contain n^2 figures).
You have to answer t independent test cases.
Input
The first line of the input contains one integer t (1 β€ t β€ 200) β the number of test cases. Then t test cases follow.
The only line of the test case contains one integer n (1 β€ n < 5 β
10^5) β the size of the board. It is guaranteed that n is odd (not divisible by 2).
It is guaranteed that the sum of n over all test cases does not exceed 5 β
10^5 (β n β€ 5 β
10^5).
Output
For each test case print the answer β the minimum number of moves needed to get all the figures into one cell.
Example
Input
3
1
5
499993
Output
0
40
41664916690999888
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["3\n5\n3005\n3005\n", "1\n69791\n", "1\n214541\n", "1\n499999\n", "1\n214145\n", "3\n5\n3005\n1983\n", "1\n203317\n", "3\n7\n3005\n3005\n", "1\n288977\n", "1\n254785\n", "1\n54111\n", "3\n7\n3005\n5103\n", "1\n151107\n", "1\n188269\n", "1\n39575\n", "3\n11\n3005\n5103\n", "1\n345015\n", "3\n11\n3005\n5405\n", "3\n11\n4513\n5405\n", "3\n11\n4513\n9273\n", "3\n5\n3005\n1477\n", "1\n133983\n", "3\n1\n5\n132645\n", "1\n104401\n", "3\n7\n5907\n3005\n", "1\n47045\n", "3\n7\n4885\n5103\n", "1\n301085\n", "3\n3\n3005\n5103\n", "1\n453513\n", "3\n11\n2869\n5405\n", "3\n11\n7987\n5405\n", "1\n74757\n", "1\n181283\n", "3\n7\n5907\n5455\n", "3\n7\n4885\n2887\n", "1\n69087\n", "3\n3\n2587\n5103\n", "3\n11\n11375\n5405\n", "1\n124495\n", "3\n13\n5907\n5455\n", "3\n7\n4885\n3217\n", "3\n5\n2587\n5103\n", "3\n11\n3229\n5405\n", "1\n145901\n", "3\n13\n2937\n5455\n", "3\n7\n4885\n3403\n", "3\n5\n1563\n5103\n", "3\n15\n3229\n5405\n", "1\n284573\n", "3\n9\n3005\n1983\n", "1\n390373\n", "3\n7\n4509\n5103\n", "1\n2119\n", "3\n5\n3005\n41\n", "1\n9693\n", "3\n3\n5907\n3005\n", "3\n7\n4885\n9509\n", "1\n128337\n", "3\n3\n5397\n5103\n", "1\n151665\n", "3\n15\n2869\n5405\n", "3\n11\n5907\n5455\n", "3\n7\n6841\n2887\n", "1\n2569\n", "3\n3\n2587\n9783\n", "3\n11\n11375\n2775\n", "3\n7\n541\n3217\n", "3\n5\n3005\n5103\n", "1\n114241\n", "3\n13\n2937\n3901\n", "3\n7\n4637\n3403\n", "1\n349387\n", "3\n13\n4509\n5103\n", "3\n7\n4885\n4737\n", "1\n141647\n", "3\n5\n5397\n5103\n", "3\n11\n6841\n2887\n", "3\n3\n131\n9783\n", "3\n11\n22093\n2775\n", "3\n7\n283\n3217\n", "1\n22411\n", "1\n475303\n", "3\n5\n5397\n8921\n", "3\n5\n6841\n2887\n", "3\n11\n7511\n2775\n", "3\n5\n1081\n2887\n", "3\n21\n7511\n2775\n", "3\n21\n7511\n4623\n", "3\n3\n3005\n3005\n", "1\n111801\n", "1\n386043\n", "1\n293603\n", "3\n1\n5\n291161\n", "1\n75245\n", "3\n11\n3005\n10113\n", "3\n11\n7017\n9273\n", "3\n1\n3\n132645\n", "1\n90683\n", "3\n7\n5907\n4089\n", "1\n41529\n", "3\n5\n4885\n5103\n"], "outputs": ["40\n9045074040\n9045074040\n", "113312287936960\n", "3291619655775960\n", "41666416667000000\n", "3273426253628160\n", "40\n9045074040\n2599242368\n", "2801559329484232\n", "112\n9045074040\n9045074040\n", "8043935503113952\n", "5513156408977280\n", "52812341771840\n", "112\n9045074040\n44295074208\n", "1150091769490312\n", "2224411812960280\n", "20660532731600\n", "440\n9045074040\n44295074208\n", "13689660452511120\n", "440\n9045074040\n52633933240\n", "440\n30639009728\n52633933240\n", "440\n30639009728\n265790540048\n", "40\n9045074040\n1074038952\n", "801729453346368\n", "0\n40\n777949484701160\n", "379308627429600\n", "112\n68703623912\n9045074040\n", "34707166856360\n", "112\n38857283080\n44295074208\n", "9098003593162680\n", "8\n9045074040\n44295074208\n", "31091950477407728\n", "440\n7871732680\n52633933240\n", "440\n169836015272\n52633933240\n", "139262548867112\n", "1985866199936968\n", "112\n68703623912\n54108188640\n", "112\n38857283080\n8020825072\n", "109917729457472\n", "8\n5771224472\n44295074208\n", "440\n490606116000\n52633933240\n", "643182876820960\n", "728\n68703623912\n54108188640\n", "112\n38857283080\n11097672032\n", "40\n5771224472\n44295074208\n", "440\n11222324920\n52633933240\n", "1035269813240600\n", "728\n8444822672\n54108188640\n", "112\n38857283080\n13136042808\n", "40\n1272786328\n44295074208\n", "1120\n11222324920\n52633933240\n", "7681743862718648\n", "240\n9045074040\n2599242368\n", "19829787577478248\n", "112\n30557613240\n44295074208\n", "3171549680\n", "40\n9045074040\n22960\n", "303566175288\n", "8\n68703623912\n9045074040\n", "112\n38857283080\n286604683240\n", "704586624213472\n", "8\n52400566792\n44295074208\n", "1162879872284320\n", "1120\n7871732680\n52633933240\n", "440\n68703623912\n54108188640\n", "112\n106717958160\n8020825072\n", "5651594480\n", "8\n5771224472\n312100813968\n", "440\n490606116000\n7123077200\n", "112\n52779960\n11097672032\n", "40\n9045074040\n44295074208\n", "496986661861760\n", "728\n8444822672\n19788212600\n", "112\n33234566072\n13136042808\n", "14216705608918072\n", "728\n30557613240\n44295074208\n", "112\n38857283080\n35431446272\n", "947329121101792\n", "40\n52400566792\n44295074208\n", "440\n106717958160\n8020825072\n", "8\n749320\n312100813968\n", "440\n3594535872088\n7123077200\n", "112\n7554968\n11097672032\n", "3751996730040\n", "35792366326722608\n", "40\n52400566792\n236657001680\n", "40\n106717958160\n8020825072\n", "440\n141244655440\n7123077200\n", "40\n421071120\n8020825072\n", "3080\n141244655440\n7123077200\n", "3080\n141244655440\n32934449248\n", "8\n9045074040\n9045074040\n", "465817509981200\n", "19177226208278488\n", "8436459224091208\n", "0\n40\n8227698185305040\n", "142007631751960\n", "440\n9045074040\n344761500928\n", "440\n115168355632\n265790540048\n", "0\n8\n777949484701160\n", "248574390183768\n", "112\n68703623912\n22789250960\n", "23874438479120\n", "40\n38857283080\n44295074208\n"]}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: John is developing a system to report fuel usage but needs help with the coding.
First, he needs you to write a function that, given the actual consumption (in l/100 km) and remaining amount of petrol (in l), will give you how many kilometers you'll be able to drive.
Second, he needs you to write a function that, given a distance (in km), a consumption (in l/100 km), and an amount of petrol (in l), will return one of the following: If you can't make the distance without refueling, it should return the message "You will need to refuel". If you can make the distance, the function will check every 100 km and produce an array with [1:kilometers already driven. 2: kilometers till end. 3: remaining amount of petrol] and return all the arrays inside another array ([[after 100km], [after 200km], [after 300km]...])
PLEASE NOTE: any of the values with decimals that you return should be rounded to 2 decimals.
You will use the following starter code to write the solution to the problem and enclose your code within delimiters.
```python
def total_kilometers(cons, petrol):
```
|
{"functional": "\ndef check(candidate):\n assert candidate(10, 60) == 600\n assert candidate(8, 0) == 0\n assert candidate(6.4, 54) == 843.75\n assert candidate(9.3, 87.3) == 938.71\n assert candidate(11.7, 63.4) == 541.88\n\ncheck(total_kilometers)\n "}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: The palindrome is a string that can be read the same way from left to right and from right to left. For example, strings "aaaaa", "1221", "bbaabb" are palindromes, however the string "chef" is not a palindrome because if we read it from right to left, we will obtain "fehc" that is not the same as "chef".
We call a string a "double string" if it has an even length and the first half of this string is equal to the second half of this string, for example "abab" is a double string because the first half "ab" is equal to the second half "ab", however the string "abba" is not a double string because the first half "ab" is not equal to the second half "ba". The empty string "" is a double string, and its length is 0.
Chef doesn't like palindromes, however he likes "double strings". He often likes to change the order of letters in some palindrome and sometimes to remove some symbols from it. Now he wonders: if a palindrome of length N is given, what is the maximal possible number of characters in a "double string"
that can be obtained by removing and changing the order of symbols in it?
Input
Several test cases are given.
The first line of the sample input contains an integer T - the number of test cases.
Then, T lines follow.
Each line consists of a single integer N - the length of a palindrome.
Output
For each test case output a single integer - answer to the problem.
Constraints
1<=T<=10000
1<=N<=1000000000
Example
Input:
2
2
4
Output:
2
4
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["2\n2\n0", "2\n4\n0", "2\n8\n0", "2\n10\n0", "2\n15\n0", "2\n0\n0", "2\n24\n0", "2\n6\n1", "2\n0\n2", "2\n10\n2", "2\n6\n2", "2\n2\n2", "2\n9\n2", "2\n6\n4", "2\n1\n4", "2\n6\n7", "2\n12\n1", "2\n12\n2", "2\n6\n10", "2\n12\n4", "2\n4\n3", "2\n19\n0", "2\n3\n4", "2\n23\n0", "2\n17\n2", "2\n35\n0", "2\n1\n6", "2\n11\n4", "2\n15\n2", "2\n8\n10", "2\n18\n2", "2\n17\n0", "2\n1\n8", "2\n14\n4", "2\n12\n6", "2\n12\n12", "2\n8\n4", "2\n8\n9", "2\n27\n0", "2\n2\n6", "2\n43\n1", "2\n16\n5", "2\n14\n6", "2\n4\n12", "2\n1\n11", "2\n4\n6", "2\n37\n1", "2\n16\n6", "2\n14\n11", "2\n7\n12", "2\n22\n4", "2\n1\n13", "2\n54\n1", "2\n14\n22", "2\n1\n17", "2\n21\n0", "2\n74\n1", "2\n3\n14", "2\n28\n0", "2\n14\n9", "2\n6\n17", "2\n88\n1", "2\n3\n20", "2\n26\n9", "2\n22\n2", "2\n1\n14", "2\n21\n2", "2\n119\n1", "2\n2\n9", "2\n3\n35", "2\n6\n9", "2\n3\n17", "2\n44\n2", "2\n5\n35", "2\n4\n4", "2\n44\n4", "2\n3\n10", "2\n2\n32", "2\n1\n35", "2\n11\n6", "2\n44\n1", "2\n47\n2", "2\n4\n32", "2\n47\n4", "2\n8\n7", "2\n65\n4", "2\n6\n32", "2\n8\n13", "2\n65\n7", "2\n3\n47", "2\n65\n12", "2\n14\n13", "2\n65\n11", "2\n65\n21", "2\n46\n21", "2\n28\n10", "2\n46\n13", "2\n28\n2", "2\n46\n26", "2\n46\n52"], "outputs": ["2\n0\n", "4\n0\n", "8\n0\n", "10\n0\n", "14\n0\n", "0\n0\n", "24\n0\n", "6\n0\n", "0\n2\n", "10\n2\n", "6\n2\n", "2\n2\n", "8\n2\n", "6\n4\n", "0\n4\n", "6\n6\n", "12\n0\n", "12\n2\n", "6\n10\n", "12\n4\n", "4\n2\n", "18\n0\n", "2\n4\n", "22\n0\n", "16\n2\n", "34\n0\n", "0\n6\n", "10\n4\n", "14\n2\n", "8\n10\n", "18\n2\n", "16\n0\n", "0\n8\n", "14\n4\n", "12\n6\n", "12\n12\n", "8\n4\n", "8\n8\n", "26\n0\n", "2\n6\n", "42\n0\n", "16\n4\n", "14\n6\n", "4\n12\n", "0\n10\n", "4\n6\n", "36\n0\n", "16\n6\n", "14\n10\n", "6\n12\n", "22\n4\n", "0\n12\n", "54\n0\n", "14\n22\n", "0\n16\n", "20\n0\n", "74\n0\n", "2\n14\n", "28\n0\n", "14\n8\n", "6\n16\n", "88\n0\n", "2\n20\n", "26\n8\n", "22\n2\n", "0\n14\n", "20\n2\n", "118\n0\n", "2\n8\n", "2\n34\n", "6\n8\n", "2\n16\n", "44\n2\n", "4\n34\n", "4\n4\n", "44\n4\n", "2\n10\n", "2\n32\n", "0\n34\n", "10\n6\n", "44\n0\n", "46\n2\n", "4\n32\n", "46\n4\n", "8\n6\n", "64\n4\n", "6\n32\n", "8\n12\n", "64\n6\n", "2\n46\n", "64\n12\n", "14\n12\n", "64\n10\n", "64\n20\n", "46\n20\n", "28\n10\n", "46\n12\n", "28\n2\n", "46\n26\n", "46\n52\n"]}
|
code
|
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests. You will NOT return anything except for the program.
Question: Our Friend Monk has finally found the Temple of Programming secrets. However, the door of the temple is firmly locked. Now, as per the rules of the temple, Monk needs to enter a Secret Password in a special language to unlock the door. This language, unlike English consists of K alphabets. The properties of this secret password are:
It has a length of N characters.
It is composed only of the K characters belonging to the Special language.
Each character belonging to the special language has been used at max once in the secret code.
Now, Monk has no idea about what the ideal password may be and needs you help. You need to help Monk find the total number of distinct candidate Strings for it Modulo 10^9+7.
Input Format:
The first line contains a single integer T denoting the number of test cases. Each of the next T lines contain two integers N and K denoting the length of the Secret Password and the number of characters of the Special language to be used respectively.
Output Format:
For each test case, output the number of possible distinct secret passwords Modulo 10^9+7.
Constraints:
1 β€ T β€ 10
1 β€ N β€ K β€ 10^5
Note:
You need to print the value of each element and not their weight.
SAMPLE INPUT
1
3 3
SAMPLE OUTPUT
6
Explanation
Let's number the characters of the special language to be 1 , 2 and 3 respectively. So, all possible candidate Strings are:
123
132
213
231
312
321
So, here we have 6 possible passwords. So, the answer = 6 \% (10^9+7) =6
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
|
{"inputs": ["10\n97654 99999\n97655 99998\n97656 99997\n97657 99996\n97658 99995\n97659 99994\n97660 99993\n97661 99992\n97662 99991\n97663 99990", "10\n23 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n30 99993\n31 99992\n32 99991", "10\n23 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 99992\n32 99991", "10\n23 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 114698\n32 99991", "10\n23 100000\n24 99999\n25 81271\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 114698\n32 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 114698\n32 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 99993\n31 114698\n32 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 99993\n31 114698\n41 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 196529\n31 114698\n41 99991", "10\n16 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 196529\n31 114698\n41 99991", "10\n16 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n16 100000\n24 99999\n25 81271\n10 10221\n27 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n12 100000\n24 99999\n25 81271\n10 10221\n27 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n12 100000\n24 99999\n25 81271\n10 10221\n36 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n10 10221\n36 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n10 10221\n36 175149\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n10 10221\n36 175149\n28 99995\n29 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n10 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 127272\n25 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 127272\n50 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 81271\n14 864\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 81271\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 46482\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 46482\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 864\n36 175149\n55 99995\n19 14854\n92 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 864\n36 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n111 114408\n14 864\n36 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n111 114408\n14 864\n20 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n35 100000\n24 46482\n111 114408\n14 864\n20 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n35 100000\n24 46482\n111 135348\n14 864\n20 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n35 100000\n32 46482\n111 135348\n14 864\n20 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n97654 99999\n81840 99998\n97656 99997\n97657 99996\n97658 99995\n97659 99994\n97660 99993\n97661 99992\n97662 99991\n97663 99990", "10\n23 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n30 99993\n31 99992\n10 99991", "1\n3 3\n\nSAMPLF", "10\n9 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 99992\n32 99991", "10\n36 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 114698\n32 99991", "10\n23 100000\n24 99999\n25 81271\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 114698\n32 7763", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 31400\n32 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 99993\n31 114698\n19 99991", "10\n23 100000\n24 99999\n25 9083\n10 99997\n27 99996\n28 99995\n29 13560\n59 99993\n31 114698\n41 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 10919\n31 114698\n41 99991", "10\n16 100000\n24 99999\n29 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 196529\n31 114698\n41 99991", "10\n16 100010\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n16 100000\n24 99999\n25 81271\n10 14738\n27 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n12 100000\n24 99999\n25 81271\n10 7539\n27 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n12 100000\n24 99999\n25 81271\n10 10221\n36 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 147661", "10\n19 100000\n24 99999\n25 81271\n10 10221\n36 99996\n39 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n1 100000\n24 99999\n25 81271\n10 10221\n36 175149\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 150137\n25 81271\n10 10221\n36 175149\n28 99995\n29 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n10 11688\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n11 114698\n41 99991", "10\n19 100000\n24 127272\n25 81271\n14 10221\n36 175149\n28 99995\n19 16219\n59 196529\n21 114698\n41 99991", "10\n19 110000\n24 127272\n50 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 24418\n50 81271\n14 10221\n36 175149\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 81271\n14 864\n36 175149\n28 99995\n19 14854\n59 196529\n21 48010\n41 99991", "10\n19 100000\n24 29296\n50 81271\n14 864\n36 175149\n55 99995\n19 14854\n59 87794\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n41 13382", "10\n19 100000\n24 46482\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n8 99991", "10\n19 100000\n24 46482\n76 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 1143\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 864\n36 175149\n73 99995\n19 14854\n59 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n49 114408\n14 864\n36 175149\n55 99995\n19 14854\n92 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n5 864\n36 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n19 100000\n24 3032\n111 114408\n14 864\n36 175149\n55 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n111 114408\n14 864\n20 175149\n55 16259\n19 16485\n92 39787\n21 114698\n2 99991", "10\n35 100000\n24 46482\n111 114408\n14 864\n20 175149\n55 16259\n19 14854\n148 39787\n21 114698\n2 99991", "10\n35 100000\n24 46482\n111 135348\n14 864\n20 175149\n21 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n35 100000\n32 46482\n111 135348\n14 864\n20 175149\n65 16259\n19 14854\n92 39787\n21 114698\n2 99991", "10\n23 100000\n24 99999\n14 99998\n26 99997\n27 99996\n28 99995\n29 99994\n30 99993\n31 99992\n10 99991", "10\n9 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n23 99992\n32 99991", "10\n36 100000\n24 99999\n25 99998\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 114698\n9 99991", "10\n23 100000\n24 99999\n25 81271\n26 99997\n27 99996\n28 99995\n29 99994\n59 99993\n51 114698\n32 7763", "10\n23 100000\n24 99999\n31 81271\n10 99997\n27 99996\n28 99995\n29 99994\n59 99993\n31 31400\n32 99991", "10\n23 100000\n24 99999\n25 81271\n10 99997\n27 99996\n28 182806\n29 13560\n59 99993\n31 114698\n19 99991", "10\n23 100000\n24 99999\n25 9083\n10 99997\n27 99996\n28 99995\n29 13560\n59 99993\n31 114698\n23 99991", "10\n23 100000\n24 99999\n25 81271\n17 99997\n27 99996\n28 99995\n29 13560\n59 10919\n31 114698\n41 99991", "10\n16 100000\n1 99999\n29 81271\n10 99997\n27 99996\n28 99995\n29 13560\n59 196529\n31 114698\n41 99991", "10\n16 100010\n24 99999\n25 81271\n10 99997\n27 99996\n28 99995\n29 13560\n107 196529\n21 114698\n41 99991", "10\n16 100000\n24 99999\n25 81271\n10 14738\n27 99996\n28 99995\n29 22121\n59 196529\n21 114698\n41 99991", "10\n12 100000\n24 99999\n25 81271\n10 7539\n27 194052\n28 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n12 100001\n24 99999\n25 81271\n10 10221\n36 99996\n28 99995\n29 13560\n59 196529\n21 114698\n41 147661", "10\n19 100000\n48 99999\n25 81271\n10 10221\n36 99996\n39 99995\n29 13560\n59 196529\n21 114698\n41 99991", "10\n1 100000\n24 99999\n25 81271\n10 10221\n36 175149\n28 99995\n29 13560\n59 72528\n21 114698\n41 99991", "10\n19 100000\n24 150137\n25 81271\n10 10221\n36 175149\n28 99995\n29 14854\n72 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n10 11688\n36 175149\n28 99995\n24 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 99999\n25 81271\n14 10221\n36 175149\n35 99995\n19 14854\n59 196529\n11 114698\n41 99991", "10\n19 100000\n24 127272\n25 81271\n14 2068\n36 175149\n28 99995\n19 16219\n59 196529\n21 114698\n41 99991", "10\n19 110000\n24 127272\n50 81271\n14 10221\n36 224681\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 24418\n50 81271\n14 10221\n36 182662\n28 99995\n19 14854\n59 196529\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 81271\n14 864\n36 189203\n28 99995\n19 14854\n59 196529\n21 48010\n41 99991", "10\n19 100000\n24 1112\n50 81271\n14 864\n36 175149\n55 99995\n19 14854\n59 87794\n21 114698\n41 99991", "10\n19 100000\n24 29296\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n41 24943", "10\n29 100000\n24 46482\n50 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n8 99991", "10\n19 100000\n9 46482\n76 114408\n14 864\n36 175149\n55 99995\n19 14854\n59 196529\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 114408\n14 1143\n36 175149\n55 68609\n19 14854\n59 196529\n21 114698\n2 99991", "10\n19 100000\n24 46482\n67 11655\n14 864\n36 175149\n73 99995\n19 14854\n59 39787\n21 114698\n2 99991", "10\n19 100000\n24 46482\n49 114408\n14 864\n36 298252\n55 99995\n19 14854\n92 39787\n21 114698\n2 99991"], "outputs": ["991879483\n601526804\n436424908\n382445914\n829121437\n542869638\n229051652\n421432812\n703201416\n235932927\n", "813663176\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n158487841\n781054085\n287928459\n", "813663176\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n750605912\n781054085\n287928459\n", "813663176\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n750605912\n625473937\n287928459\n", "813663176\n831992858\n250242083\n308395250\n306816746\n762324486\n627450826\n750605912\n625473937\n287928459\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n627450826\n750605912\n625473937\n287928459\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n750605912\n625473937\n287928459\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n750605912\n625473937\n449945554\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n177132007\n625473937\n449945554\n", "957765120\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n177132007\n625473937\n449945554\n", "957765120\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n177132007\n781226525\n449945554\n", "957765120\n831992858\n250242083\n406350719\n306816746\n762324486\n248496097\n177132007\n781226525\n449945554\n", "734275823\n831992858\n250242083\n406350719\n306816746\n762324486\n248496097\n177132007\n781226525\n449945554\n", "734275823\n831992858\n250242083\n406350719\n193713672\n762324486\n248496097\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n406350719\n193713672\n762324486\n248496097\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n406350719\n287423269\n762324486\n248496097\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n406350719\n287423269\n762324486\n453890912\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n406350719\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n715807755\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n685398573\n250242083\n715807755\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n685398573\n890619901\n715807755\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n923373374\n890619901\n715807755\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n923373374\n890619901\n989973817\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n923373374\n890619901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n449945554\n", "21793049\n923373374\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n449945554\n", "21793049\n218082519\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n449945554\n", "21793049\n218082519\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n998100027\n", "21793049\n218082519\n541091229\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n998100027\n", "21793049\n218082519\n541091229\n989973817\n287423269\n287933742\n144169489\n578850063\n781226525\n998100027\n", "21793049\n218082519\n541091229\n989973817\n287423269\n287933742\n144169489\n436822706\n781226525\n998100027\n", "21793049\n218082519\n541091229\n989973817\n287423269\n48195483\n144169489\n436822706\n781226525\n998100027\n", "21793049\n218082519\n108171788\n989973817\n287423269\n48195483\n144169489\n436822706\n781226525\n998100027\n", "21793049\n218082519\n108171788\n989973817\n497917156\n48195483\n144169489\n436822706\n781226525\n998100027\n", "484035074\n218082519\n108171788\n989973817\n497917156\n48195483\n144169489\n436822706\n781226525\n998100027\n", "484035074\n218082519\n529628327\n989973817\n497917156\n48195483\n144169489\n436822706\n781226525\n998100027\n", "484035074\n940846617\n529628327\n989973817\n497917156\n48195483\n144169489\n436822706\n781226525\n998100027\n", "991879483\n792858873\n436424908\n382445914\n829121437\n542869638\n229051652\n421432812\n703201416\n235932927\n", "813663176\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n158487841\n781054085\n13609499\n", "6\n", "743510330\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n750605912\n781054085\n287928459\n", "565833708\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n750605912\n625473937\n287928459\n", "813663176\n831992858\n250242083\n308395250\n306816746\n762324486\n627450826\n750605912\n625473937\n419907908\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n627450826\n750605912\n3603610\n287928459\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n750605912\n625473937\n886567671\n", "813663176\n831992858\n242904177\n182391403\n306816746\n762324486\n248496097\n750605912\n625473937\n449945554\n", "813663176\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n359117451\n625473937\n449945554\n", "957765120\n831992858\n267604944\n182391403\n306816746\n762324486\n248496097\n177132007\n625473937\n449945554\n", "286056228\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n177132007\n781226525\n449945554\n", "957765120\n831992858\n250242083\n288139493\n306816746\n762324486\n248496097\n177132007\n781226525\n449945554\n", "734275823\n831992858\n250242083\n807516848\n306816746\n762324486\n248496097\n177132007\n781226525\n449945554\n", "734275823\n831992858\n250242083\n406350719\n193713672\n762324486\n248496097\n177132007\n781226525\n522442741\n", "21793049\n831992858\n250242083\n406350719\n193713672\n731752356\n248496097\n177132007\n781226525\n449945554\n", "100000\n831992858\n250242083\n406350719\n287423269\n762324486\n248496097\n177132007\n781226525\n449945554\n", "21793049\n55532596\n250242083\n406350719\n287423269\n762324486\n453890912\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n505735753\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n715807755\n287423269\n762324486\n144169489\n177132007\n938376785\n449945554\n", "21793049\n685398573\n250242083\n715807755\n287423269\n762324486\n688366939\n177132007\n781226525\n449945554\n", "838688401\n685398573\n890619901\n715807755\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n48183371\n890619901\n715807755\n287423269\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n923373374\n890619901\n989973817\n287423269\n762324486\n144169489\n177132007\n148608976\n449945554\n", "21793049\n923373374\n890619901\n989973817\n287423269\n287933742\n144169489\n166014432\n781226525\n449945554\n", "21793049\n923373374\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n155554271\n", "21793049\n218082519\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n496192600\n", "21793049\n218082519\n437843524\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n998100027\n", "21793049\n218082519\n541091229\n569411597\n287423269\n287933742\n144169489\n177132007\n781226525\n998100027\n", "21793049\n218082519\n541091229\n989973817\n287423269\n766474353\n144169489\n578850063\n781226525\n998100027\n", "21793049\n218082519\n52433047\n989973817\n287423269\n287933742\n144169489\n436822706\n781226525\n998100027\n", "21793049\n218082519\n541091229\n394829207\n287423269\n48195483\n144169489\n436822706\n781226525\n998100027\n", "21793049\n132631432\n108171788\n989973817\n287423269\n48195483\n144169489\n436822706\n781226525\n998100027\n", "21793049\n218082519\n108171788\n989973817\n497917156\n48195483\n117529624\n436822706\n781226525\n998100027\n", "484035074\n218082519\n108171788\n989973817\n497917156\n48195483\n144169489\n934488207\n781226525\n998100027\n", "484035074\n218082519\n529628327\n989973817\n497917156\n864467496\n144169489\n436822706\n781226525\n998100027\n", "484035074\n940846617\n529628327\n989973817\n497917156\n404321882\n144169489\n436822706\n781226525\n998100027\n", "813663176\n831992858\n148786273\n308395250\n306816746\n762324486\n627450826\n158487841\n781054085\n13609499\n", "743510330\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n750605912\n417252835\n287928459\n", "565833708\n831992858\n962669731\n308395250\n306816746\n762324486\n627450826\n750605912\n625473937\n824378530\n", "813663176\n831992858\n250242083\n308395250\n306816746\n762324486\n627450826\n750605912\n815289969\n419907908\n", "813663176\n831992858\n699967988\n182391403\n306816746\n762324486\n627450826\n750605912\n3603610\n287928459\n", "813663176\n831992858\n250242083\n182391403\n306816746\n252173652\n248496097\n750605912\n625473937\n886567671\n", "813663176\n831992858\n242904177\n182391403\n306816746\n762324486\n248496097\n750605912\n625473937\n643284951\n", "813663176\n831992858\n250242083\n822044232\n306816746\n762324486\n248496097\n359117451\n625473937\n449945554\n", "957765120\n99999\n267604944\n182391403\n306816746\n762324486\n248496097\n177132007\n625473937\n449945554\n", "286056228\n831992858\n250242083\n182391403\n306816746\n762324486\n248496097\n389654388\n781226525\n449945554\n", "957765120\n831992858\n250242083\n288139493\n306816746\n762324486\n893054051\n177132007\n781226525\n449945554\n", "734275823\n831992858\n250242083\n807516848\n261732766\n762324486\n248496097\n177132007\n781226525\n449945554\n", "771418022\n831992858\n250242083\n406350719\n193713672\n762324486\n248496097\n177132007\n781226525\n522442741\n", "21793049\n285678575\n250242083\n406350719\n193713672\n731752356\n248496097\n177132007\n781226525\n449945554\n", "100000\n831992858\n250242083\n406350719\n287423269\n762324486\n248496097\n731124773\n781226525\n449945554\n", "21793049\n55532596\n250242083\n406350719\n287423269\n762324486\n453890912\n457201690\n781226525\n449945554\n", "21793049\n831992858\n250242083\n505735753\n287423269\n762324486\n320503495\n177132007\n781226525\n449945554\n", "21793049\n831992858\n250242083\n715807755\n287423269\n579745131\n144169489\n177132007\n938376785\n449945554\n", "21793049\n685398573\n250242083\n893150592\n287423269\n762324486\n688366939\n177132007\n781226525\n449945554\n", "838688401\n685398573\n890619901\n715807755\n159902848\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n48183371\n890619901\n715807755\n616221654\n762324486\n144169489\n177132007\n781226525\n449945554\n", "21793049\n923373374\n890619901\n989973817\n146600552\n762324486\n144169489\n177132007\n148608976\n449945554\n", "21793049\n694134173\n890619901\n989973817\n287423269\n287933742\n144169489\n166014432\n781226525\n449945554\n", "21793049\n923373374\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n924064943\n", "77681661\n218082519\n190779901\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n496192600\n", "21793049\n41408195\n437843524\n989973817\n287423269\n287933742\n144169489\n177132007\n781226525\n998100027\n", "21793049\n218082519\n541091229\n569411597\n287423269\n325252630\n144169489\n177132007\n781226525\n998100027\n", "21793049\n218082519\n63819366\n989973817\n287423269\n766474353\n144169489\n578850063\n781226525\n998100027\n", "21793049\n218082519\n52433047\n989973817\n683789423\n287933742\n144169489\n436822706\n781226525\n998100027\n"]}
|
code
|