description
stringlengths 116
4.23k
| code
stringlengths 9
53.6k
| sample_inputs
stringlengths 0
914
| sample_outputs
stringlengths 0
1.33k
| normalized_code
stringlengths 25
86.1k
|
---|---|---|---|---|
Your friend Jeff Zebos has been trying to run his new online company, but it's not going very well. He's not getting a lot of sales on his website which he decided to call Azamon. His big problem, you think, is that he's not ranking high enough on the search engines. If only he could rename his products to have better names than his competitors, then he'll be at the top of the search results and will be a millionaire.
After doing some research, you find out that search engines only sort their results lexicographically. If your friend could rename his products to lexicographically smaller strings than his competitor's, then he'll be at the top of the rankings!
To make your strategy less obvious to his competitors, you decide to swap no more than two letters of the product names.
Please help Jeff to find improved names for his products that are lexicographically smaller than his competitor's!
Given the string s representing Jeff's product name and the string c representing his competitor's product name, find a way to swap at most one pair of characters in s (that is, find two distinct indices i and j and swap s_i and s_j) such that the resulting new name becomes strictly lexicographically smaller than c, or determine that it is impossible.
Note: String a is strictly lexicographically smaller than string b if and only if one of the following holds:
* a is a proper prefix of b, that is, a is a prefix of b such that a β b;
* There exists an integer 1 β€ i β€ min{(|a|, |b|)} such that a_i < b_i and a_j = b_j for 1 β€ j < i.
Input
The first line of input contains a single integer t (1 β€ t β€ 1500) denoting the number of test cases. The next lines contain descriptions of the test cases.
Each test case consists of a single line containing two space-separated strings s and c (2 β€ |s| β€ 5000, 1 β€ |c| β€ 5000). The strings s and c consists of uppercase English letters.
It is guaranteed that the sum of |s| in the input is at most 5000 and the sum of the |c| in the input is at most 5000.
Output
For each test case, output a single line containing a single string, which is either
* the new name which is obtained after swapping no more than one pair of characters that is strictly lexicographically smaller than c. In case there are many possible such strings, you can output any of them;
* three dashes (the string "---" without quotes) if it is impossible.
Example
Input
3
AZAMON APPLE
AZAMON AAAAAAAAAAALIBABA
APPLE BANANA
Output
AMAZON
---
APPLE
Note
In the first test case, it is possible to swap the second and the fourth letters of the string and the resulting string "AMAZON" is lexicographically smaller than "APPLE".
It is impossible to improve the product's name in the second test case and satisfy all conditions.
In the third test case, it is possible not to swap a pair of characters. The name "APPLE" is lexicographically smaller than "BANANA". Note that there are other valid answers, e.g., "APPEL".
|
exec(int(input())*"s,c=input().split();t=sorted(s);i=0;l=len(s)\nwhile i<l and s[i]==t[i]:i+=1\nif i<l:j=s.rfind(t[i]);s=s[:i]+s[j]+s[i+1:j]+s[i]+s[j+1:]\nprint(('---',s)[s<c]);")
|
3
AZAMON APPLE
AZAMON AAAAAAAAAAALIBABA
APPLE BANANA
|
AAZMON
---
AEPLP
|
EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING
|
Ehab has an array a of length n. He has just enough free time to make a new array consisting of n copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence?
A sequence a is a subsequence of an array b if a can be obtained from b by deletion of several (possibly, zero or all) elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing order.
Input
The first line contains an integer t β the number of test cases you need to solve. The description of the test cases follows.
The first line of each test case contains an integer n (1 β€ n β€ 10^5) β the number of elements in the array a.
The second line contains n space-separated integers a_1, a_2, β¦, a_{n} (1 β€ a_i β€ 10^9) β the elements of the array a.
The sum of n across the test cases doesn't exceed 10^5.
Output
For each testcase, output the length of the longest increasing subsequence of a if you concatenate it to itself n times.
Example
Input
2
3
3 2 1
6
3 1 4 1 5 9
Output
3
5
Note
In the first sample, the new array is [3,2,1,3,2,1,3,2,1]. The longest increasing subsequence is marked in bold.
In the second sample, the longest increasing subsequence will be [1,3,4,5,9].
|
for _ in range(int(input())): print(len([set(map(int, input().split())) for i in "aa"][1]))
|
2
3
3 2 1
6
3 1 4 1 5 9
|
3
5
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR STRING NUMBER
|
Ehab has an array a of length n. He has just enough free time to make a new array consisting of n copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence?
A sequence a is a subsequence of an array b if a can be obtained from b by deletion of several (possibly, zero or all) elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing order.
Input
The first line contains an integer t β the number of test cases you need to solve. The description of the test cases follows.
The first line of each test case contains an integer n (1 β€ n β€ 10^5) β the number of elements in the array a.
The second line contains n space-separated integers a_1, a_2, β¦, a_{n} (1 β€ a_i β€ 10^9) β the elements of the array a.
The sum of n across the test cases doesn't exceed 10^5.
Output
For each testcase, output the length of the longest increasing subsequence of a if you concatenate it to itself n times.
Example
Input
2
3
3 2 1
6
3 1 4 1 5 9
Output
3
5
Note
In the first sample, the new array is [3,2,1,3,2,1,3,2,1]. The longest increasing subsequence is marked in bold.
In the second sample, the longest increasing subsequence will be [1,3,4,5,9].
|
for i in range(int(input())): input();print(len(set(map(int,input().split()))))
|
2
3
3 2 1
6
3 1 4 1 5 9
|
3
5
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR
|
Ehab has an array a of length n. He has just enough free time to make a new array consisting of n copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence?
A sequence a is a subsequence of an array b if a can be obtained from b by deletion of several (possibly, zero or all) elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing order.
Input
The first line contains an integer t β the number of test cases you need to solve. The description of the test cases follows.
The first line of each test case contains an integer n (1 β€ n β€ 10^5) β the number of elements in the array a.
The second line contains n space-separated integers a_1, a_2, β¦, a_{n} (1 β€ a_i β€ 10^9) β the elements of the array a.
The sum of n across the test cases doesn't exceed 10^5.
Output
For each testcase, output the length of the longest increasing subsequence of a if you concatenate it to itself n times.
Example
Input
2
3
3 2 1
6
3 1 4 1 5 9
Output
3
5
Note
In the first sample, the new array is [3,2,1,3,2,1,3,2,1]. The longest increasing subsequence is marked in bold.
In the second sample, the longest increasing subsequence will be [1,3,4,5,9].
|
for x in range(int(input())): input();print(len(set(input().split())))
|
2
3
3 2 1
6
3 1 4 1 5 9
|
3
5
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR
|
Ehab has an array a of length n. He has just enough free time to make a new array consisting of n copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence?
A sequence a is a subsequence of an array b if a can be obtained from b by deletion of several (possibly, zero or all) elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing order.
Input
The first line contains an integer t β the number of test cases you need to solve. The description of the test cases follows.
The first line of each test case contains an integer n (1 β€ n β€ 10^5) β the number of elements in the array a.
The second line contains n space-separated integers a_1, a_2, β¦, a_{n} (1 β€ a_i β€ 10^9) β the elements of the array a.
The sum of n across the test cases doesn't exceed 10^5.
Output
For each testcase, output the length of the longest increasing subsequence of a if you concatenate it to itself n times.
Example
Input
2
3
3 2 1
6
3 1 4 1 5 9
Output
3
5
Note
In the first sample, the new array is [3,2,1,3,2,1,3,2,1]. The longest increasing subsequence is marked in bold.
In the second sample, the longest increasing subsequence will be [1,3,4,5,9].
|
for i in[*open(0)][2::2]:print(len(set([*map(int,i.split())])))
|
2
3
3 2 1
6
3 1 4 1 5 9
|
3
5
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR LIST FUNC_CALL VAR VAR FUNC_CALL VAR
|
Hilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer, including zero and negative integers. Even stranger, the hotel is currently at full capacity, meaning there is exactly one guest in every room. The hotel's manager, David Hilbert himself, decides he wants to shuffle the guests around because he thinks this will create a vacancy (a room without a guest).
For any integer k and positive integer n, let kmod n denote the remainder when k is divided by n. More formally, r=kmod n is the smallest non-negative integer such that k-r is divisible by n. It always holds that 0β€ kmod nβ€ n-1. For example, 100mod 12=4 and (-1337)mod 3=1.
Then the shuffling works as follows. There is an array of n integers a_0,a_1,β¦,a_{n-1}. Then for each integer k, the guest in room k is moved to room number k+a_{kmod n}.
After this shuffling process, determine if there is still exactly one guest assigned to each room. That is, there are no vacancies or rooms with multiple guests.
Input
Each test consists of multiple test cases. The first line contains a single integer t (1β€ tβ€ 10^4) β the number of test cases. Next 2t lines contain descriptions of test cases.
The first line of each test case contains a single integer n (1β€ nβ€ 2β
10^5) β the length of the array.
The second line of each test case contains n integers a_0,a_1,β¦,a_{n-1} (-10^9β€ a_iβ€ 10^9).
It is guaranteed that the sum of n over all test cases does not exceed 2β
10^5.
Output
For each test case, output a single line containing "YES" if there is exactly one guest assigned to each room after the shuffling process, or "NO" otherwise. You can print each letter in any case (upper or lower).
Example
Input
6
1
14
2
1 -1
4
5 5 5 1
3
3 2 1
2
0 1
5
-239 -2 -100 -3 -11
Output
YES
YES
YES
NO
NO
YES
Note
In the first test case, every guest is shifted by 14 rooms, so the assignment is still unique.
In the second test case, even guests move to the right by 1 room, and odd guests move to the left by 1 room. We can show that the assignment is still unique.
In the third test case, every fourth guest moves to the right by 1 room, and the other guests move to the right by 5 rooms. We can show that the assignment is still unique.
In the fourth test case, guests 0 and 1 are both assigned to room 3.
In the fifth test case, guests 1 and 2 are both assigned to room 2.
|
for s in[*open(0)][2::2]:a=s.split();n=len(a);s={*range(n)};print('YNEOS'[s>{(k+int(a[k]))%n for k in s}::2])
|
6
1
14
2
1 -1
4
5 5 5 1
3
3 2 1
2
0 1
5
-239 -2 -100 -3 -11
|
YES
YES
YES
NO
NO
YES
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER
|
Hilbert's Hotel is a very unusual hotel since the number of rooms is infinite! In fact, there is exactly one room for every integer, including zero and negative integers. Even stranger, the hotel is currently at full capacity, meaning there is exactly one guest in every room. The hotel's manager, David Hilbert himself, decides he wants to shuffle the guests around because he thinks this will create a vacancy (a room without a guest).
For any integer k and positive integer n, let kmod n denote the remainder when k is divided by n. More formally, r=kmod n is the smallest non-negative integer such that k-r is divisible by n. It always holds that 0β€ kmod nβ€ n-1. For example, 100mod 12=4 and (-1337)mod 3=1.
Then the shuffling works as follows. There is an array of n integers a_0,a_1,β¦,a_{n-1}. Then for each integer k, the guest in room k is moved to room number k+a_{kmod n}.
After this shuffling process, determine if there is still exactly one guest assigned to each room. That is, there are no vacancies or rooms with multiple guests.
Input
Each test consists of multiple test cases. The first line contains a single integer t (1β€ tβ€ 10^4) β the number of test cases. Next 2t lines contain descriptions of test cases.
The first line of each test case contains a single integer n (1β€ nβ€ 2β
10^5) β the length of the array.
The second line of each test case contains n integers a_0,a_1,β¦,a_{n-1} (-10^9β€ a_iβ€ 10^9).
It is guaranteed that the sum of n over all test cases does not exceed 2β
10^5.
Output
For each test case, output a single line containing "YES" if there is exactly one guest assigned to each room after the shuffling process, or "NO" otherwise. You can print each letter in any case (upper or lower).
Example
Input
6
1
14
2
1 -1
4
5 5 5 1
3
3 2 1
2
0 1
5
-239 -2 -100 -3 -11
Output
YES
YES
YES
NO
NO
YES
Note
In the first test case, every guest is shifted by 14 rooms, so the assignment is still unique.
In the second test case, even guests move to the right by 1 room, and odd guests move to the left by 1 room. We can show that the assignment is still unique.
In the third test case, every fourth guest moves to the right by 1 room, and the other guests move to the right by 5 rooms. We can show that the assignment is still unique.
In the fourth test case, guests 0 and 1 are both assigned to room 3.
In the fifth test case, guests 1 and 2 are both assigned to room 2.
|
for s in[*open(0)][2::2]:a=s.split();n=len(a);print('YNEOS'[len({(k+int(a[k]))%n for k in range(n)})<n::2])
|
6
1
14
2
1 -1
4
5 5 5 1
3
3 2 1
2
0 1
5
-239 -2 -100 -3 -11
|
YES
YES
YES
NO
NO
YES
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING FUNC_CALL VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR VAR VAR VAR FUNC_CALL VAR VAR VAR NUMBER
|
Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types β shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, Polycarp spends two diamonds and one stick.
Each tool can be sold for exactly one emerald. How many emeralds can Polycarp earn, if he has a sticks and b diamonds?
Input
The first line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
The only line of each test case contains two integers a and b (0 β€ a, b β€ 10^9) β the number of sticks and the number of diamonds, respectively.
Output
For each test case print one integer β the maximum number of emeralds Polycarp can earn.
Example
Input
4
4 4
1000000000 0
7 15
8 7
Output
2
0
7
5
Note
In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel.
In the second test case Polycarp does not have any diamonds, so he cannot craft anything.
|
for s in[*open(0)][1:]:a=*map(int,s.split()),;print(min(*a,sum(a)//3))
|
4
4 4
1000000000 0
7 15
8 7
|
2
0
7
5
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER
|
Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types β shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, Polycarp spends two diamonds and one stick.
Each tool can be sold for exactly one emerald. How many emeralds can Polycarp earn, if he has a sticks and b diamonds?
Input
The first line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
The only line of each test case contains two integers a and b (0 β€ a, b β€ 10^9) β the number of sticks and the number of diamonds, respectively.
Output
For each test case print one integer β the maximum number of emeralds Polycarp can earn.
Example
Input
4
4 4
1000000000 0
7 15
8 7
Output
2
0
7
5
Note
In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel.
In the second test case Polycarp does not have any diamonds, so he cannot craft anything.
|
for s in[*open(0)][1:]:a,b=sorted(map(int,s.split()));r=min(a,b-a);x=max(0,2*a-b);print(r+x//3*2+(x%3>1))
|
4
4 4
1000000000 0
7 15
8 7
|
2
0
7
5
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP NUMBER VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP BIN_OP VAR NUMBER NUMBER BIN_OP VAR NUMBER NUMBER
|
Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types β shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, Polycarp spends two diamonds and one stick.
Each tool can be sold for exactly one emerald. How many emeralds can Polycarp earn, if he has a sticks and b diamonds?
Input
The first line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
The only line of each test case contains two integers a and b (0 β€ a, b β€ 10^9) β the number of sticks and the number of diamonds, respectively.
Output
For each test case print one integer β the maximum number of emeralds Polycarp can earn.
Example
Input
4
4 4
1000000000 0
7 15
8 7
Output
2
0
7
5
Note
In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel.
In the second test case Polycarp does not have any diamonds, so he cannot craft anything.
|
for _ in range(int(input())):a,b = map(int,input().split());c = min(a,b);print(c) if max(a,b) >= 2*c else print((a+b)//3)
|
4
4 4
1000000000 0
7 15
8 7
|
2
0
7
5
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR BIN_OP NUMBER VAR FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR NUMBER
|
Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types β shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, Polycarp spends two diamonds and one stick.
Each tool can be sold for exactly one emerald. How many emeralds can Polycarp earn, if he has a sticks and b diamonds?
Input
The first line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
The only line of each test case contains two integers a and b (0 β€ a, b β€ 10^9) β the number of sticks and the number of diamonds, respectively.
Output
For each test case print one integer β the maximum number of emeralds Polycarp can earn.
Example
Input
4
4 4
1000000000 0
7 15
8 7
Output
2
0
7
5
Note
In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel.
In the second test case Polycarp does not have any diamonds, so he cannot craft anything.
|
exec(int(input())*"a=list(map(int,input().split()))\nprint(min(sum(a)//3,min(a)))\n")
|
4
4 4
1000000000 0
7 15
8 7
|
2
0
7
5
|
EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING
|
Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types β shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, Polycarp spends two diamonds and one stick.
Each tool can be sold for exactly one emerald. How many emeralds can Polycarp earn, if he has a sticks and b diamonds?
Input
The first line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
The only line of each test case contains two integers a and b (0 β€ a, b β€ 10^9) β the number of sticks and the number of diamonds, respectively.
Output
For each test case print one integer β the maximum number of emeralds Polycarp can earn.
Example
Input
4
4 4
1000000000 0
7 15
8 7
Output
2
0
7
5
Note
In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel.
In the second test case Polycarp does not have any diamonds, so he cannot craft anything.
|
i=input;exec(int(i())*'a,b=map(int,i().split());print(min((a+b)//3,a,b));')
|
4
4 4
1000000000 0
7 15
8 7
|
2
0
7
5
|
ASSIGN VAR VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING
|
Polycarp plays a well-known computer game (we won't mention its name). In this game, he can craft tools of two types β shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, Polycarp spends two diamonds and one stick.
Each tool can be sold for exactly one emerald. How many emeralds can Polycarp earn, if he has a sticks and b diamonds?
Input
The first line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
The only line of each test case contains two integers a and b (0 β€ a, b β€ 10^9) β the number of sticks and the number of diamonds, respectively.
Output
For each test case print one integer β the maximum number of emeralds Polycarp can earn.
Example
Input
4
4 4
1000000000 0
7 15
8 7
Output
2
0
7
5
Note
In the first test case Polycarp can earn two emeralds as follows: craft one sword and one shovel.
In the second test case Polycarp does not have any diamonds, so he cannot craft anything.
|
for t in[*open(0)][1:]:a=*map(int,t.split()),;print(min(*a,sum(a)//3))
|
4
4 4
1000000000 0
7 15
8 7
|
2
0
7
5
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER
|
You are given three sequences: a_1, a_2, β¦, a_n; b_1, b_2, β¦, b_n; c_1, c_2, β¦, c_n.
For each i, a_i β b_i, a_i β c_i, b_i β c_i.
Find a sequence p_1, p_2, β¦, p_n, that satisfy the following conditions:
* p_i β \\{a_i, b_i, c_i\}
* p_i β p_{(i mod n) + 1}.
In other words, for each element, you need to choose one of the three possible values, such that no two adjacent elements (where we consider elements i,i+1 adjacent for i<n and also elements 1 and n) will have equal value.
It can be proved that in the given constraints solution always exists. You don't need to minimize/maximize anything, you need to find any proper sequence.
Input
The first line of input contains one integer t (1 β€ t β€ 100): the number of test cases.
The first line of each test case contains one integer n (3 β€ n β€ 100): the number of elements in the given sequences.
The second line contains n integers a_1, a_2, β¦, a_n (1 β€ a_i β€ 100).
The third line contains n integers b_1, b_2, β¦, b_n (1 β€ b_i β€ 100).
The fourth line contains n integers c_1, c_2, β¦, c_n (1 β€ c_i β€ 100).
It is guaranteed that a_i β b_i, a_i β c_i, b_i β c_i for all i.
Output
For each test case, print n integers: p_1, p_2, β¦, p_n (p_i β \\{a_i, b_i, c_i\}, p_i β p_{i mod n + 1}).
If there are several solutions, you can print any.
Example
Input
5
3
1 1 1
2 2 2
3 3 3
4
1 2 1 2
2 1 2 1
3 4 3 4
7
1 3 3 1 1 1 1
2 4 4 3 2 2 4
4 2 2 2 4 4 2
3
1 2 1
2 3 3
3 1 2
10
1 1 1 2 2 2 3 3 3 1
2 2 2 3 3 3 1 1 1 2
3 3 3 1 1 1 2 2 2 3
Output
1 2 3
1 2 1 2
1 3 4 3 2 4 2
1 3 2
1 2 3 1 2 3 1 2 3 2
Note
In the first test case p = [1, 2, 3].
It is a correct answer, because:
* p_1 = 1 = a_1, p_2 = 2 = b_2, p_3 = 3 = c_3
* p_1 β p_2 , p_2 β p_3 , p_3 β p_1
All possible correct answers to this test case are: [1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1].
In the second test case p = [1, 2, 1, 2].
In this sequence p_1 = a_1, p_2 = a_2, p_3 = a_3, p_4 = a_4. Also we can see, that no two adjacent elements of the sequence are equal.
In the third test case p = [1, 3, 4, 3, 2, 4, 2].
In this sequence p_1 = a_1, p_2 = a_2, p_3 = b_3, p_4 = b_4, p_5 = b_5, p_6 = c_6, p_7 = c_7. Also we can see, that no two adjacent elements of the sequence are equal.
|
[(lambda N,a,b,c,p:[[p.append(i if p[-1]!=i else j)for i,j in zip(a,b)],p.__setitem__(N,a[N-1]if a[N-1]!=p[N-1]and a[N-1]!=p[1]else(b[N-1]if b[N-1]!=p[N-1]and b[N-1]!=p[1]else c[N-1])),print(*p[1:])])(int(input()),*[list(map(int,input().split()))for i in'000'],[0])for t in range(int(input()))]
|
5
3
1 1 1
2 2 2
3 3 3
4
1 2 1 2
2 1 2 1
3 4 3 4
7
1 3 3 1 1 1 1
2 4 4 3 2 2 4
4 2 2 2 4 4 2
3
1 2 1
2 3 3
3 1 2
10
1 1 1 2 2 2 3 3 3 1
2 2 2 3 3 3 1 1 1 2
3 3 3 1 1 1 2 2 2 3
|
1 2 3
1 2 1 2
1 3 4 1 2 1 4
1 2 3
1 2 1 2 3 2 3 1 3 2
|
EXPR FUNC_CALL LIST FUNC_CALL VAR VAR NUMBER VAR VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR STRING LIST NUMBER VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR
|
Utkarsh is forced to play yet another one of Ashish's games. The game progresses turn by turn and as usual, Ashish moves first.
Consider the 2D plane. There is a token which is initially at (0,0). In one move a player must increase either the x coordinate or the y coordinate of the token by exactly k. In doing so, the player must ensure that the token stays within a (Euclidean) distance d from (0,0).
In other words, if after a move the coordinates of the token are (p,q), then p^2 + q^2 β€ d^2 must hold.
The game ends when a player is unable to make a move. It can be shown that the game will end in a finite number of moves. If both players play optimally, determine who will win.
Input
The first line contains a single integer t (1 β€ t β€ 100) β the number of test cases.
The only line of each test case contains two space separated integers d (1 β€ d β€ 10^5) and k (1 β€ k β€ d).
Output
For each test case, if Ashish wins the game, print "Ashish", otherwise print "Utkarsh" (without the quotes).
Example
Input
5
2 1
5 2
10 3
25 4
15441 33
Output
Utkarsh
Ashish
Utkarsh
Utkarsh
Ashish
Note
In the first test case, one possible sequence of moves can be
(0, 0) \xrightarrow{Ashish } (0, 1) \xrightarrow{Utkarsh } (0, 2).
Ashish has no moves left, so Utkarsh wins.
<image>
|
for _ in range(int(input())):d, k = map(int, input().split());r2 = 2**(1/2);diag = int(d/(k*r2))*k;maxi = ((diag+k)**2) + (diag**2);print(('Utkarsh', 'Ashish')[maxi <= d**2])
|
5
2 1
5 2
10 3
25 4
15441 33
|
Utkarsh
Ashish
Utkarsh
Utkarsh
Ashish
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR NUMBER EXPR FUNC_CALL VAR STRING STRING VAR BIN_OP VAR NUMBER
|
Amr loves Geometry. One day he came up with a very interesting problem.
Amr has a circle of radius r and center in point (x, y). He wants the circle center to be in new position (x', y').
In one step Amr can put a pin to the border of the circle in a certain point, then rotate the circle around that pin by any angle and finally remove the pin.
Help Amr to achieve his goal in minimum number of steps.
Input
Input consists of 5 space-separated integers r, x, y, x' y' (1 β€ r β€ 105, - 105 β€ x, y, x', y' β€ 105), circle radius, coordinates of original center of the circle and coordinates of destination center of the circle respectively.
Output
Output a single integer β minimum number of steps required to move the center of the circle to the destination point.
Examples
Input
2 0 0 0 4
Output
1
Input
1 1 1 4 4
Output
3
Input
4 5 6 5 6
Output
0
Note
In the first sample test the optimal way is to put a pin at point (0, 2) and rotate the circle by 180 degrees counter-clockwise (or clockwise, no matter).
<image>
|
from math import *;r,x,y,x1,y1=map(int,input().split());print(ceil((pow(x-x1,2)+pow(y-y1,2))**(0.5)/(2*r)))
|
1 1 1 4 4
2 0 0 0 4
4 5 6 5 6
|
3
1
0
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP FUNC_CALL VAR BIN_OP VAR VAR NUMBER FUNC_CALL VAR BIN_OP VAR VAR NUMBER NUMBER BIN_OP NUMBER VAR
|
Amr loves Geometry. One day he came up with a very interesting problem.
Amr has a circle of radius r and center in point (x, y). He wants the circle center to be in new position (x', y').
In one step Amr can put a pin to the border of the circle in a certain point, then rotate the circle around that pin by any angle and finally remove the pin.
Help Amr to achieve his goal in minimum number of steps.
Input
Input consists of 5 space-separated integers r, x, y, x' y' (1 β€ r β€ 105, - 105 β€ x, y, x', y' β€ 105), circle radius, coordinates of original center of the circle and coordinates of destination center of the circle respectively.
Output
Output a single integer β minimum number of steps required to move the center of the circle to the destination point.
Examples
Input
2 0 0 0 4
Output
1
Input
1 1 1 4 4
Output
3
Input
4 5 6 5 6
Output
0
Note
In the first sample test the optimal way is to put a pin at point (0, 2) and rotate the circle by 180 degrees counter-clockwise (or clockwise, no matter).
<image>
|
from math import ceil;r,x,y,x1,y1=map(int,input().split());print(ceil(((x-x1)**2+(y-y1)**2)**0.5/(2*r)))
|
1 1 1 4 4
2 0 0 0 4
4 5 6 5 6
|
3
1
0
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP BIN_OP VAR VAR NUMBER NUMBER BIN_OP NUMBER VAR
|
Kevin Sun has just finished competing in Codeforces Round #334! The round was 120 minutes long and featured five problems with maximum point values of 500, 1000, 1500, 2000, and 2500, respectively. Despite the challenging tasks, Kevin was uncowed and bulldozed through all of them, distinguishing himself from the herd as the best cowmputer scientist in all of Bovinia. Kevin knows his submission time for each problem, the number of wrong submissions that he made on each problem, and his total numbers of successful and unsuccessful hacks. Because Codeforces scoring is complicated, Kevin wants you to write a program to compute his final score.
Codeforces scores are computed as follows: If the maximum point value of a problem is x, and Kevin submitted correctly at minute m but made w wrong submissions, then his score on that problem is <image>. His total score is equal to the sum of his scores for each problem. In addition, Kevin's total score gets increased by 100 points for each successful hack, but gets decreased by 50 points for each unsuccessful hack.
All arithmetic operations are performed with absolute precision and no rounding. It is guaranteed that Kevin's final score is an integer.
Input
The first line of the input contains five space-separated integers m1, m2, m3, m4, m5, where mi (0 β€ mi β€ 119) is the time of Kevin's last submission for problem i. His last submission is always correct and gets accepted.
The second line contains five space-separated integers w1, w2, w3, w4, w5, where wi (0 β€ wi β€ 10) is Kevin's number of wrong submissions on problem i.
The last line contains two space-separated integers hs and hu (0 β€ hs, hu β€ 20), denoting the Kevin's numbers of successful and unsuccessful hacks, respectively.
Output
Print a single integer, the value of Kevin's final score.
Examples
Input
20 40 60 80 100
0 1 2 3 4
1 0
Output
4900
Input
119 119 119 119 119
0 0 0 0 0
10 0
Output
4930
Note
In the second sample, Kevin takes 119 minutes on all of the problems. Therefore, he gets <image> of the points on each problem. So his score from solving problems is <image>. Adding in 10Β·100 = 1000 points from hacks, his total score becomes 3930 + 1000 = 4930.
|
print(sum([sum(x) for x in [[sum(x) for x in [[int(ans + c[0] * 100 - c[1] * 50) for c in [[int(x) for x in input().split()]]]]] for ans in [sum([sum(x) for x in [[max(0.3 * (500 * (i + 1)), (1 - a[i] / 250) * (500 * (i + 1)) - 50 * b[i]) for i in range(5)] for a, b in zip([[int(x) for x in input().split()]], [[int(x) for x in input().split()]])]])]]]))
|
20 40 60 80 100
0 1 2 3 4
1 0
119 119 119 119 119
0 0 0 0 0
10 0
|
4900
4930
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR LIST FUNC_CALL VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER BIN_OP VAR NUMBER NUMBER VAR LIST FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR VAR LIST FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR BIN_OP NUMBER BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP BIN_OP BIN_OP NUMBER BIN_OP VAR VAR NUMBER BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP NUMBER VAR VAR VAR FUNC_CALL VAR NUMBER VAR VAR FUNC_CALL VAR LIST FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR LIST FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR
|
Anastasia loves going for a walk in Central Uzhlyandian Park. But she became uninterested in simple walking, so she began to collect Uzhlyandian pebbles. At first, she decided to collect all the pebbles she could find in the park.
She has only two pockets. She can put at most k pebbles in each pocket at the same time. There are n different pebble types in the park, and there are wi pebbles of the i-th type. Anastasia is very responsible, so she never mixes pebbles of different types in same pocket. However, she can put different kinds of pebbles in different pockets at the same time. Unfortunately, she can't spend all her time collecting pebbles, so she can collect pebbles from the park only once a day.
Help her to find the minimum number of days needed to collect all the pebbles of Uzhlyandian Central Park, taking into consideration that Anastasia can't place pebbles of different types in same pocket.
Input
The first line contains two integers n and k (1 β€ n β€ 105, 1 β€ k β€ 109) β the number of different pebble types and number of pebbles Anastasia can place in one pocket.
The second line contains n integers w1, w2, ..., wn (1 β€ wi β€ 104) β number of pebbles of each type.
Output
The only line of output contains one integer β the minimum number of days Anastasia needs to collect all the pebbles.
Examples
Input
3 2
2 3 4
Output
3
Input
5 4
3 1 8 9 7
Output
5
Note
In the first sample case, Anastasia can collect all pebbles of the first type on the first day, of second type β on the second day, and of third type β on the third day.
Optimal sequence of actions in the second sample case:
* In the first day Anastasia collects 8 pebbles of the third type.
* In the second day she collects 8 pebbles of the fourth type.
* In the third day she collects 3 pebbles of the first type and 1 pebble of the fourth type.
* In the fourth day she collects 7 pebbles of the fifth type.
* In the fifth day she collects 1 pebble of the second type.
|
n,k=input().split();w=[((int(i)-1)//(int(k))+1) for i in (input().split())];s=sum(w);m=max(w);print(((s if(s>m) else m)+1)//2)
|
5 4
3 1 8 9 7
3 2
2 3 4
|
5
3
|
ASSIGN VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR VAR NUMBER NUMBER
|
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The second participant types one character in v2 milliseconds and has ping t2 milliseconds.
If connection ping (delay) is t milliseconds, the competition passes for a participant as follows:
1. Exactly after t milliseconds after the start of the competition the participant receives the text to be entered.
2. Right after that he starts to type it.
3. Exactly t milliseconds after he ends typing all the text, the site receives information about it.
The winner is the participant whose information on the success comes earlier. If the information comes from both participants at the same time, it is considered that there is a draw.
Given the length of the text and the information about participants, determine the result of the game.
Input
The first line contains five integers s, v1, v2, t1, t2 (1 β€ s, v1, v2, t1, t2 β€ 1000) β the number of characters in the text, the time of typing one character for the first participant, the time of typing one character for the the second participant, the ping of the first participant and the ping of the second participant.
Output
If the first participant wins, print "First". If the second participant wins, print "Second". In case of a draw print "Friendship".
Examples
Input
5 1 2 1 2
Output
First
Input
3 3 1 1 1
Output
Second
Input
4 5 3 1 5
Output
Friendship
Note
In the first example, information on the success of the first participant comes in 7 milliseconds, of the second participant β in 14 milliseconds. So, the first wins.
In the second example, information on the success of the first participant comes in 11 milliseconds, of the second participant β in 5 milliseconds. So, the second wins.
In the third example, information on the success of the first participant comes in 22 milliseconds, of the second participant β in 22 milliseconds. So, it is be a draw.
|
q, w, e, r, t = map(int, input().split()); print("First" if(((q*w)+r+r)<(q*e)+t+t) else "Second" if(((q*w)+r+r)>(q*e)+t+t) else "Friendship")
|
4 5 3 1 5
5 1 2 1 2
3 3 1 1 1
|
Friendship
First
Second
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR STRING BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR STRING STRING
|
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The second participant types one character in v2 milliseconds and has ping t2 milliseconds.
If connection ping (delay) is t milliseconds, the competition passes for a participant as follows:
1. Exactly after t milliseconds after the start of the competition the participant receives the text to be entered.
2. Right after that he starts to type it.
3. Exactly t milliseconds after he ends typing all the text, the site receives information about it.
The winner is the participant whose information on the success comes earlier. If the information comes from both participants at the same time, it is considered that there is a draw.
Given the length of the text and the information about participants, determine the result of the game.
Input
The first line contains five integers s, v1, v2, t1, t2 (1 β€ s, v1, v2, t1, t2 β€ 1000) β the number of characters in the text, the time of typing one character for the first participant, the time of typing one character for the the second participant, the ping of the first participant and the ping of the second participant.
Output
If the first participant wins, print "First". If the second participant wins, print "Second". In case of a draw print "Friendship".
Examples
Input
5 1 2 1 2
Output
First
Input
3 3 1 1 1
Output
Second
Input
4 5 3 1 5
Output
Friendship
Note
In the first example, information on the success of the first participant comes in 7 milliseconds, of the second participant β in 14 milliseconds. So, the first wins.
In the second example, information on the success of the first participant comes in 11 milliseconds, of the second participant β in 5 milliseconds. So, the second wins.
In the third example, information on the success of the first participant comes in 22 milliseconds, of the second participant β in 22 milliseconds. So, it is be a draw.
|
a,b,c,d,e=map(int,input().split());print("First" if (b*a)+(2*d)<(c*a)+(2*e) else "Second" if (b*a)+(2*d)>(c*a)+(2*e) else "Friendship")
|
4 5 3 1 5
5 1 2 1 2
3 3 1 1 1
|
Friendship
First
Second
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR BIN_OP NUMBER VAR STRING BIN_OP BIN_OP VAR VAR BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR BIN_OP NUMBER VAR STRING STRING
|
Two boys decided to compete in text typing on the site "Key races". During the competition, they have to type a text consisting of s characters. The first participant types one character in v1 milliseconds and has ping t1 milliseconds. The second participant types one character in v2 milliseconds and has ping t2 milliseconds.
If connection ping (delay) is t milliseconds, the competition passes for a participant as follows:
1. Exactly after t milliseconds after the start of the competition the participant receives the text to be entered.
2. Right after that he starts to type it.
3. Exactly t milliseconds after he ends typing all the text, the site receives information about it.
The winner is the participant whose information on the success comes earlier. If the information comes from both participants at the same time, it is considered that there is a draw.
Given the length of the text and the information about participants, determine the result of the game.
Input
The first line contains five integers s, v1, v2, t1, t2 (1 β€ s, v1, v2, t1, t2 β€ 1000) β the number of characters in the text, the time of typing one character for the first participant, the time of typing one character for the the second participant, the ping of the first participant and the ping of the second participant.
Output
If the first participant wins, print "First". If the second participant wins, print "Second". In case of a draw print "Friendship".
Examples
Input
5 1 2 1 2
Output
First
Input
3 3 1 1 1
Output
Second
Input
4 5 3 1 5
Output
Friendship
Note
In the first example, information on the success of the first participant comes in 7 milliseconds, of the second participant β in 14 milliseconds. So, the first wins.
In the second example, information on the success of the first participant comes in 11 milliseconds, of the second participant β in 5 milliseconds. So, the second wins.
In the third example, information on the success of the first participant comes in 22 milliseconds, of the second participant β in 22 milliseconds. So, it is be a draw.
|
print(["Friendship", "Second", "First"][(lambda x: -1 if x < 0 else 1 if x > 0 else 0)((lambda s, v1, v2, t1, t2: (2 * t1 + s * v1) - (2 * t2 + s * v2))(*[int(x) for x in input().split()]))])
|
4 5 3 1 5
5 1 2 1 2
3 3 1 1 1
|
Friendship
First
Second
|
EXPR FUNC_CALL VAR LIST STRING STRING STRING FUNC_CALL VAR NUMBER NUMBER VAR NUMBER NUMBER NUMBER FUNC_CALL BIN_OP BIN_OP BIN_OP NUMBER VAR BIN_OP VAR VAR BIN_OP BIN_OP NUMBER VAR BIN_OP VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR
|
Given is a positive integer N. How many tuples (A,B,C) of positive integers satisfy A \times B + C = N?
Constraints
* 2 \leq N \leq 10^6
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
N
Output
Print the answer.
Examples
Input
3
Output
3
Input
100
Output
473
Input
1000000
Output
13969985
|
n=int(input())-1;print(sum(n//-~i for i in range(n)))
|
31001000000
|
347313969985
|
ASSIGN VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR VAR VAR FUNC_CALL VAR VAR
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
n=int(input());r=input().count('R');print('Yes'if r>n//2 else'No')
|
4
RRBR4
BRBR
|
YesNo
|
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR BIN_OP VAR NUMBER STRING STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print(["No","Yes"][int(input())//2 < input().count("R")])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR LIST STRING STRING BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER FUNC_CALL FUNC_CALL VAR STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
n,s=open(0);print('YNeos'[int(n)<=2*s.count('B')::2])
|
4
RRBR4
BRBR
|
YesNo
|
ASSIGN VAR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR STRING FUNC_CALL VAR VAR BIN_OP NUMBER FUNC_CALL VAR STRING NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print('YNeos'[int(input())<=2*input().count('B')::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR BIN_OP NUMBER FUNC_CALL FUNC_CALL VAR STRING NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
input();r,b=map(input().count,"RB");print("YNeos"[r<=b::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING VAR VAR NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
input();s=input(); print("Yes" if s.count("R") > s.count("B") else "No")
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING STRING STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
n=int(input());print("Yes" if input().count("R")>n//2 else"No")
|
4
RRBR4
BRBR
|
YesNo
|
ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR STRING BIN_OP VAR NUMBER STRING STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print('YNeos'[int(input())>=input().count('R')*2::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR BIN_OP FUNC_CALL FUNC_CALL VAR STRING NUMBER NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
input();s=input();print('YNeos'[s.count('B')>=s.count('R')::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
n,s=int(input()),str(input());print("Yes" if 2*s.count("R")>n else"No")
|
4
RRBR4
BRBR
|
YesNo
|
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP NUMBER FUNC_CALL VAR STRING VAR STRING STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print('Yes'if int(input())/2<input().count('R')else'No')
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER FUNC_CALL FUNC_CALL VAR STRING STRING STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
n,s=open(0);b=s.count("B");print("YNeos"[b>=int(n)-b::2])
|
4
RRBR4
BRBR
|
YesNo
|
ASSIGN VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print('YNeos'[int(input())/2>=input().count('R')::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR STRING BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER FUNC_CALL FUNC_CALL VAR STRING NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
input();a=input();print('Yes'if a.count('R')>a.count('B')else 'No')
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING STRING STRING
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
input();s=input().count;print('YNeos'[s('R')<=s('B')::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print("NYoe s"[int(input())<input().count("R")*2::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR BIN_OP FUNC_CALL FUNC_CALL VAR STRING NUMBER NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print('YNeos'[int(input())<=input().count('B')*2::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR BIN_OP FUNC_CALL FUNC_CALL VAR STRING NUMBER NUMBER
|
There are N people numbered 1 to N. Each person wears a red hat or a blue hat.
You are given a string s representing the colors of the people. Person i wears a red hat if s_i is `R`, and a blue hat if s_i is `B`.
Determine if there are more people wearing a red hat than people wearing a blue hat.
Constraints
* 1 \leq N \leq 100
* |s| = N
* s_i is `R` or `B`.
Input
Input is given from Standard Input in the following format:
N
s
Output
If there are more people wearing a red hat than there are people wearing a blue hat, print `Yes`; otherwise, print `No`.
Examples
Input
4
RRBR
Output
Yes
Input
4
BRBR
Output
No
|
print("YNeos"[int(input())>=input().count("R")*2::2])
|
4
RRBR4
BRBR
|
YesNo
|
EXPR FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR BIN_OP FUNC_CALL FUNC_CALL VAR STRING NUMBER NUMBER
|
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.
Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.
Constraints
* 1 β€ A, B, C β€ 5000
* 1 β€ X, Y β€ 10^5
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B C X Y
Output
Print the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.
Examples
Input
1500 2000 1600 3 2
Output
7900
Input
1500 2000 1900 3 2
Output
8500
Input
1500 2000 500 90000 100000
Output
100000000
|
a,b,c,x,y=map(int,input().split());print(min(x*a+y*b,2*x*c+b*max(0,y-x),2*y*c+a*max(0,x-y)))
|
1500 2000 1600 3 21500 2000 500 90000 1000001500 2000 1900 3 2
|
79001000000008500
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP BIN_OP BIN_OP NUMBER VAR VAR BIN_OP VAR FUNC_CALL VAR NUMBER BIN_OP VAR VAR BIN_OP BIN_OP BIN_OP NUMBER VAR VAR BIN_OP VAR FUNC_CALL VAR NUMBER BIN_OP VAR VAR
|
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.
Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.
Constraints
* 1 β€ A, B, C β€ 5000
* 1 β€ X, Y β€ 10^5
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B C X Y
Output
Print the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.
Examples
Input
1500 2000 1600 3 2
Output
7900
Input
1500 2000 1900 3 2
Output
8500
Input
1500 2000 500 90000 100000
Output
100000000
|
a,b,c,x,y=map(int,input().split());print(min(k*c*2+a*max(x-k,0)+b*max(y-k,0)for k in range(max(x,y)*3)))
|
1500 2000 1600 3 21500 2000 500 90000 1000001500 2000 1900 3 2
|
79001000000008500
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR NUMBER BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER BIN_OP VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR NUMBER
|
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.
Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.
Constraints
* 1 β€ A, B, C β€ 5000
* 1 β€ X, Y β€ 10^5
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B C X Y
Output
Print the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.
Examples
Input
1500 2000 1600 3 2
Output
7900
Input
1500 2000 1900 3 2
Output
8500
Input
1500 2000 500 90000 100000
Output
100000000
|
A,B,c,a,b=map(int,input().split());print(min(c*max(a,b)*2,A*a+B*b,[A,B][a<b]*abs(a-b)+c*min(a,b)*2))
|
1500 2000 1600 3 21500 2000 500 90000 1000001500 2000 1900 3 2
|
79001000000008500
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR VAR NUMBER BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP BIN_OP LIST VAR VAR VAR VAR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR VAR NUMBER
|
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.
Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.
Constraints
* 1 β€ A, B, C β€ 5000
* 1 β€ X, Y β€ 10^5
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B C X Y
Output
Print the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.
Examples
Input
1500 2000 1600 3 2
Output
7900
Input
1500 2000 1900 3 2
Output
8500
Input
1500 2000 500 90000 100000
Output
100000000
|
a,b,c,x,y=map(int,input().split());print(min(c*2*min(x,y)+abs(x-y)*min((a if x>y else b),2*c),a*x+b*y))
|
1500 2000 1600 3 21500 2000 500 90000 1000001500 2000 1900 3 2
|
79001000000008500
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER FUNC_CALL VAR VAR VAR BIN_OP FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR VAR VAR VAR VAR BIN_OP NUMBER VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR
|
"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of B-pizza combined together. The prices of one A-pizza, B-pizza and AB-pizza are A yen, B yen and C yen (yen is the currency of Japan), respectively.
Nakahashi needs to prepare X A-pizzas and Y B-pizzas for a party tonight. He can only obtain these pizzas by directly buying A-pizzas and B-pizzas, or buying two AB-pizzas and then rearrange them into one A-pizza and one B-pizza. At least how much money does he need for this? It is fine to have more pizzas than necessary by rearranging pizzas.
Constraints
* 1 β€ A, B, C β€ 5000
* 1 β€ X, Y β€ 10^5
* All values in input are integers.
Input
Input is given from Standard Input in the following format:
A B C X Y
Output
Print the minimum amount of money required to prepare X A-pizzas and Y B-pizzas.
Examples
Input
1500 2000 1600 3 2
Output
7900
Input
1500 2000 1900 3 2
Output
8500
Input
1500 2000 500 90000 100000
Output
100000000
|
a,b,c,d,e=map(int,input().split());m=min;C=2*c;print((a*d+b*e,C*m(d,e)+(m(a,C)*(d-e),m(b,C)*(e-d))[e>d])[a+b>C])
|
1500 2000 1600 3 21500 2000 500 90000 1000001500 2000 1900 3 2
|
79001000000008500
|
ASSIGN VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP NUMBER VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP BIN_OP VAR FUNC_CALL VAR VAR VAR BIN_OP FUNC_CALL VAR VAR VAR BIN_OP VAR VAR BIN_OP FUNC_CALL VAR VAR VAR BIN_OP VAR VAR VAR VAR BIN_OP VAR VAR VAR
|
Snuke has a string S consisting of three kinds of letters: `a`, `b` and `c`.
He has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.
Constraints
* 1 \leq |S| \leq 10^5
* S consists of `a`, `b` and `c`.
Input
Input is given from Standard Input in the following format:
S
Output
If the objective is achievable, print `YES`; if it is unachievable, print `NO`.
Examples
Input
abac
Output
YES
Input
aba
Output
NO
Input
babacccabab
Output
YES
|
s=input();l=[s.count(i)for i in'abc'];print('YNEOS'[max(l)-min(l)>1::2])
|
abaabacbabacccabab
|
NOYESYES
|
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR STRING EXPR FUNC_CALL VAR STRING BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR NUMBER NUMBER
|
Snuke has a string S consisting of three kinds of letters: `a`, `b` and `c`.
He has a phobia for palindromes, and wants to permute the characters in S so that S will not contain a palindrome of length 2 or more as a substring. Determine whether this is possible.
Constraints
* 1 \leq |S| \leq 10^5
* S consists of `a`, `b` and `c`.
Input
Input is given from Standard Input in the following format:
S
Output
If the objective is achievable, print `YES`; if it is unachievable, print `NO`.
Examples
Input
abac
Output
YES
Input
aba
Output
NO
Input
babacccabab
Output
YES
|
S=input(); C=list(map(S.count,["a","b","c"])); print("YES"if max(C)-min(C)<=1else"NO");
|
abaabacbabacccabab
|
NOYESYES
|
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR LIST STRING STRING STRING EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR NUMBER STRING STRING
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
_,t=open(0);*a,=map(int,t.split());print(max(a)-min(a))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
input();*a,=map(int,input().split());print(max(a)-min(a))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
N,*A=map(int,open(0).read().split());print(max(A)-min(A))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
n,*a=map(int,open(0).read().split());print(max(a)-min(a))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
_,*a=map(int,open(0).read().split());print(max(a)-min(a))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
n=input();a=list(map(int,input().split()));print(max(a)-min(a))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
input();a=sorted(map(int,input().split()));print(a[-1]-a[0])
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
n,a=int(input()),list(map(int,input().split()));a.sort();print(a[-1]-a[0])
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
a,s=open(0);k=sorted(s.split());print(eval(k[-1]+"-"+k[0]))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP VAR NUMBER STRING VAR NUMBER
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
input();l=sorted(list(map(int,input().split())));print(l[-1]-l[0])
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER VAR NUMBER
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
input();a = list(map(int,input().split()));print(max(a)-min(a))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.
There are N houses along TopCoDeer street. The i-th house is located at coordinate a_i. He has decided to deliver gifts to all these houses.
Find the minimum distance to be traveled when AtCoDeer can start and end his travel at any positions.
Constraints
* 1 β€ N β€ 100
* 0 β€ a_i β€ 1000
* a_i is an integer.
Input
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N
Output
Print the minimum distance to be traveled.
Examples
Input
4
2 3 7 9
Output
7
Input
8
3 1 4 1 5 9 2 6
Output
8
|
n,l=open(0);*l,=map(int,l.split());print(max(l)-min(l))
|
4
2 3 7 98
3 1 4 1 5 9 2 6
|
78
|
ASSIGN VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR FUNC_CALL VAR VAR
|
Addition of Big Integers
Given two integers $A$ and $B$, compute the sum, $A + B$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the sum in a line.
Constraints
* $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$
Sample Input 1
5 8
Sample Output 1
13
Sample Input 2
100 25
Sample Output 2
125
Sample Input 3
-1 1
Sample Output 3
0
Sample Input 4
12 -3
Sample Output 4
9
Example
Input
5 8
Output
13
|
print(eval(input().replace(' ','+')))
|
5 8
|
13
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR STRING STRING
|
Addition of Big Integers
Given two integers $A$ and $B$, compute the sum, $A + B$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the sum in a line.
Constraints
* $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$
Sample Input 1
5 8
Sample Output 1
13
Sample Input 2
100 25
Sample Output 2
125
Sample Input 3
-1 1
Sample Output 3
0
Sample Input 4
12 -3
Sample Output 4
9
Example
Input
5 8
Output
13
|
print(sum(list(map(int,input().split()))))
|
5 8
|
13
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR
|
Addition of Big Integers
Given two integers $A$ and $B$, compute the sum, $A + B$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the sum in a line.
Constraints
* $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$
Sample Input 1
5 8
Sample Output 1
13
Sample Input 2
100 25
Sample Output 2
125
Sample Input 3
-1 1
Sample Output 3
0
Sample Input 4
12 -3
Sample Output 4
9
Example
Input
5 8
Output
13
|
print(sum([int(x) for x in input().split()]))
|
5 8
|
13
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR
|
Addition of Big Integers
Given two integers $A$ and $B$, compute the sum, $A + B$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the sum in a line.
Constraints
* $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$
Sample Input 1
5 8
Sample Output 1
13
Sample Input 2
100 25
Sample Output 2
125
Sample Input 3
-1 1
Sample Output 3
0
Sample Input 4
12 -3
Sample Output 4
9
Example
Input
5 8
Output
13
|
print(sum(map(int, input().split())))
|
5 8
|
13
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR
|
Addition of Big Integers
Given two integers $A$ and $B$, compute the sum, $A + B$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the sum in a line.
Constraints
* $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$
Sample Input 1
5 8
Sample Output 1
13
Sample Input 2
100 25
Sample Output 2
125
Sample Input 3
-1 1
Sample Output 3
0
Sample Input 4
12 -3
Sample Output 4
9
Example
Input
5 8
Output
13
|
print(eval(input().replace(" ","+")))
|
5 8
|
13
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR STRING STRING
|
Addition of Big Integers
Given two integers $A$ and $B$, compute the sum, $A + B$.
Input
Two integers $A$ and $B$ separated by a space character are given in a line.
Output
Print the sum in a line.
Constraints
* $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$
Sample Input 1
5 8
Sample Output 1
13
Sample Input 2
100 25
Sample Output 2
125
Sample Input 3
-1 1
Sample Output 3
0
Sample Input 4
12 -3
Sample Output 4
9
Example
Input
5 8
Output
13
|
print(sum([int(i) for i in input().split()]))
|
5 8
|
13
|
EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR
|
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
|
for _ in range(int(input())): print(sum(map(lambda x:4*(x-1)*(x//2),range(1,int(input())+1)[::2])))
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP VAR NUMBER FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER
|
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
|
for _ in range(int(input())): n=int(input()); print(((n//2)*((n//2)+1)*((n-(n&1))+1)//6)*8)
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER BIN_OP BIN_OP VAR BIN_OP VAR NUMBER NUMBER NUMBER NUMBER
|
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
|
for s in[*open(0)][1:]:n=int(s);print(n//2*(n//2+1)*n//3*4)
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER
|
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
|
for z in range(int(input())):n = int(input());print(((((n//2)*((n//2)+1))*n)*4)//3)
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER VAR NUMBER NUMBER
|
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
|
for s in[*open(0)][1:]:n=int(s);print(sum(2*i*i for i in range(0,n,2)))
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR VAR FUNC_CALL VAR NUMBER VAR NUMBER
|
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
|
for s in[*open(0)][1:]:n=int(s);print((n**3-n)//3)
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER
|
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
|
for i in range(int(input())): print(sum(8 * i * i for i in range(int(input()) // 2 + 1)))
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR VAR VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER
|
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
|
for i in range(int(input())): print(sum( 4*(k//2)*(k-1) for k in range(int(input()),0,-2)) )
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP VAR NUMBER VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER
|
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
|
exec(int(input())*"\nn=int(input())//2;print(4*((n*(n+1)*(2*n+1))//3))")
|
3
1
5
499993
|
0
40
41664916690999888
|
EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING
|
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
|
for s in[*open(0)][1:]:a=int(s);print((a**3-a)//3)
|
3
1
5
499993
|
0
40
41664916690999888
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR NUMBER
|
Alica and Bob are playing a game.
Initially they have a binary string s consisting of only characters 0 and 1.
Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. During each move, the current player must choose two different adjacent characters of string s and delete them. For example, if s = 1011001 then the following moves are possible:
1. delete s_1 and s_2: 1011001 β 11001;
2. delete s_2 and s_3: 1011001 β 11001;
3. delete s_4 and s_5: 1011001 β 10101;
4. delete s_6 and s_7: 1011001 β 10110.
If a player can't make any move, they lose. Both players play optimally. You have to determine if Alice can win.
Input
First line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
Only line of each test case contains one string s (1 β€ |s| β€ 100), consisting of only characters 0 and 1.
Output
For each test case print answer in the single line.
If Alice can win print DA (YES in Russian) in any register. Otherwise print NET (NO in Russian) in any register.
Example
Input
3
01
1111
0011
Output
DA
NET
NET
Note
In the first test case after Alice's move string s become empty and Bob can not make any move.
In the second test case Alice can not make any move initially.
In the third test case after Alice's move string s turn into 01. Then, after Bob's move string s become empty and Alice can not make any move.
|
for _ in range(int(input())): s = input(); print(("NET","DA")[min(s.count('0'),s.count('1')) % 2])
|
3
01
1111
0011
|
DA
NET
NET
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR STRING STRING BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING NUMBER
|
Alica and Bob are playing a game.
Initially they have a binary string s consisting of only characters 0 and 1.
Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. During each move, the current player must choose two different adjacent characters of string s and delete them. For example, if s = 1011001 then the following moves are possible:
1. delete s_1 and s_2: 1011001 β 11001;
2. delete s_2 and s_3: 1011001 β 11001;
3. delete s_4 and s_5: 1011001 β 10101;
4. delete s_6 and s_7: 1011001 β 10110.
If a player can't make any move, they lose. Both players play optimally. You have to determine if Alice can win.
Input
First line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
Only line of each test case contains one string s (1 β€ |s| β€ 100), consisting of only characters 0 and 1.
Output
For each test case print answer in the single line.
If Alice can win print DA (YES in Russian) in any register. Otherwise print NET (NO in Russian) in any register.
Example
Input
3
01
1111
0011
Output
DA
NET
NET
Note
In the first test case after Alice's move string s become empty and Bob can not make any move.
In the second test case Alice can not make any move initially.
In the third test case after Alice's move string s turn into 01. Then, after Bob's move string s become empty and Alice can not make any move.
|
for _ in " "*int(input()):s=input();print('NDEAT'[min(s.count('0'),s.count('1'))%2::2])
|
3
01
1111
0011
|
DA
NET
NET
|
FOR VAR BIN_OP STRING FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR STRING BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING NUMBER NUMBER
|
Alica and Bob are playing a game.
Initially they have a binary string s consisting of only characters 0 and 1.
Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. During each move, the current player must choose two different adjacent characters of string s and delete them. For example, if s = 1011001 then the following moves are possible:
1. delete s_1 and s_2: 1011001 β 11001;
2. delete s_2 and s_3: 1011001 β 11001;
3. delete s_4 and s_5: 1011001 β 10101;
4. delete s_6 and s_7: 1011001 β 10110.
If a player can't make any move, they lose. Both players play optimally. You have to determine if Alice can win.
Input
First line contains one integer t (1 β€ t β€ 1000) β the number of test cases.
Only line of each test case contains one string s (1 β€ |s| β€ 100), consisting of only characters 0 and 1.
Output
For each test case print answer in the single line.
If Alice can win print DA (YES in Russian) in any register. Otherwise print NET (NO in Russian) in any register.
Example
Input
3
01
1111
0011
Output
DA
NET
NET
Note
In the first test case after Alice's move string s become empty and Bob can not make any move.
In the second test case Alice can not make any move initially.
In the third test case after Alice's move string s turn into 01. Then, after Bob's move string s become empty and Alice can not make any move.
|
for s in[*open(0)][1:]:print('NDEAT'[min(s.count('0'),s.count('1'))%2::2])
|
3
01
1111
0011
|
DA
NET
NET
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER EXPR FUNC_CALL VAR STRING BIN_OP FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING NUMBER NUMBER
|
How Many Divisors?
Write a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.
Constraints
* 1 β€ a, b, c β€ 10000
* a β€ b
Input
Three integers a, b and c are given in a line separated by a single space.
Output
Print the number of divisors in a line.
Example
Input
5 14 80
Output
3
|
a,b,c=map(int,input().split());print(len([x for x in range(a,b+1) if c % x == 0]))
|
5 14 80
|
3
|
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER BIN_OP VAR VAR NUMBER
|
How Many Divisors?
Write a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.
Constraints
* 1 β€ a, b, c β€ 10000
* a β€ b
Input
Three integers a, b and c are given in a line separated by a single space.
Output
Print the number of divisors in a line.
Example
Input
5 14 80
Output
3
|
print((lambda a: len([i for i in range(a[0], a[1]+1) if a[2] % i == 0]))(list(map(int, input().split()))))
|
5 14 80
|
3
|
EXPR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR NUMBER BIN_OP VAR NUMBER NUMBER BIN_OP VAR NUMBER VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR
|
How Many Divisors?
Write a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.
Constraints
* 1 β€ a, b, c β€ 10000
* a β€ b
Input
Three integers a, b and c are given in a line separated by a single space.
Output
Print the number of divisors in a line.
Example
Input
5 14 80
Output
3
|
a,b,c=map(int,input().split());print(sum(c%i==0for i in range(a,b+1)))
|
5 14 80
|
3
|
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP VAR VAR NUMBER VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER
|
The Fair Nut found a string s. The string consists of lowercase Latin letters. The Nut is a curious guy, so he wants to find the number of strictly increasing sequences p_1, p_2, β¦, p_k, such that:
1. For each i (1 β€ i β€ k), s_{p_i} = 'a'.
2. For each i (1 β€ i < k), there is such j that p_i < j < p_{i + 1} and s_j = 'b'.
The Nut is upset because he doesn't know how to find the number. Help him.
This number should be calculated modulo 10^9 + 7.
Input
The first line contains the string s (1 β€ |s| β€ 10^5) consisting of lowercase Latin letters.
Output
In a single line print the answer to the problem β the number of such sequences p_1, p_2, β¦, p_k modulo 10^9 + 7.
Examples
Input
abbaa
Output
5
Input
baaaa
Output
4
Input
agaa
Output
3
Note
In the first example, there are 5 possible sequences. [1], [4], [5], [1, 4], [1, 5].
In the second example, there are 4 possible sequences. [2], [3], [4], [5].
In the third example, there are 3 possible sequences. [1], [3], [4].
|
for i in ["inp = __import__('sys').stdin.readline", "a = [i.count('a') for i in inp().split('b') if i.count('a')]", "if not a: exit(print(0))", "b = a[0]", "for i in a[1:]: b = ((i + 1) * (b + 1) - 1) % (10 ** 9 + 7)", "print(b)"]: exec(i)
|
agaa
baaaa
abbaa
|
3
4
5
|
FOR VAR LIST STRING STRING STRING STRING STRING STRING EXPR FUNC_CALL VAR VAR
|
On a random day, Neko found n treasure chests and m keys. The i-th chest has an integer a_i written on it and the j-th key has an integer b_j on it. Neko knows those chests contain the powerful mysterious green Grapes, thus Neko wants to open as many treasure chests as possible.
The j-th key can be used to unlock the i-th chest if and only if the sum of the key number and the chest number is an odd number. Formally, a_i + b_j β‘ 1 \pmod{2}. One key can be used to open at most one chest, and one chest can be opened at most once.
Find the maximum number of chests Neko can open.
Input
The first line contains integers n and m (1 β€ n, m β€ 10^5) β the number of chests and the number of keys.
The second line contains n integers a_1, a_2, β¦, a_n (1 β€ a_i β€ 10^9) β the numbers written on the treasure chests.
The third line contains m integers b_1, b_2, β¦, b_m (1 β€ b_i β€ 10^9) β the numbers written on the keys.
Output
Print the maximum number of chests you can open.
Examples
Input
5 4
9 14 6 2 11
8 4 7 20
Output
3
Input
5 1
2 4 6 8 10
5
Output
1
Input
1 4
10
20 30 40 50
Output
0
Note
In the first example, one possible way to unlock 3 chests is as follows:
* Use first key to unlock the fifth chest,
* Use third key to unlock the second chest,
* Use fourth key to unlock the first chest.
In the second example, you can use the only key to unlock any single chest (note that one key can't be used twice).
In the third example, no key can unlock the given chest.
|
a=input;a();b=[i%2 for i in map(int,a().split())];c=[i%2 for i in map(int,a().split())];print(min(b.count(0),c.count(1))+min(b.count(1),c.count(0)))
|
5 1
2 4 6 8 10
5
1 4
10
20 30 40 50
5 4
9 14 6 2 11
8 4 7 20
|
1
0
3
|
ASSIGN VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR NUMBER VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR NUMBER
|
Dawid has four bags of candies. The i-th of them contains a_i candies. Also, Dawid has two friends. He wants to give each bag to one of his two friends. Is it possible to distribute the bags in such a way that each friend receives the same amount of candies in total?
Note, that you can't keep bags for yourself or throw them away, each bag should be given to one of the friends.
Input
The only line contains four integers a_1, a_2, a_3 and a_4 (1 β€ a_i β€ 100) β the numbers of candies in each bag.
Output
Output YES if it's possible to give the bags to Dawid's friends so that both friends receive the same amount of candies, or NO otherwise. Each character can be printed in any case (either uppercase or lowercase).
Examples
Input
1 7 11 5
Output
YES
Input
7 3 2 5
Output
NO
Note
In the first sample test, Dawid can give the first and the third bag to the first friend, and the second and the fourth bag to the second friend. This way, each friend will receive 12 candies.
In the second sample test, it's impossible to distribute the bags.
|
a,b,c,d=sorted(map(int, input().split())); print("YES" if a+d==b+c or a+b+c==d else "NO")
|
1 7 11 5
7 3 2 5
|
YES
NO
|
ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR STRING STRING
|
Dawid has four bags of candies. The i-th of them contains a_i candies. Also, Dawid has two friends. He wants to give each bag to one of his two friends. Is it possible to distribute the bags in such a way that each friend receives the same amount of candies in total?
Note, that you can't keep bags for yourself or throw them away, each bag should be given to one of the friends.
Input
The only line contains four integers a_1, a_2, a_3 and a_4 (1 β€ a_i β€ 100) β the numbers of candies in each bag.
Output
Output YES if it's possible to give the bags to Dawid's friends so that both friends receive the same amount of candies, or NO otherwise. Each character can be printed in any case (either uppercase or lowercase).
Examples
Input
1 7 11 5
Output
YES
Input
7 3 2 5
Output
NO
Note
In the first sample test, Dawid can give the first and the third bag to the first friend, and the second and the fourth bag to the second friend. This way, each friend will receive 12 candies.
In the second sample test, it's impossible to distribute the bags.
|
print((lambda rec, a: 'YES' if rec(rec, a, 0, 0) else 'NO')(lambda self_fn, a, i, cur_sum: (cur_sum == 0) if i == 4 else self_fn(self_fn, a, i + 1, cur_sum + a[i]) or self_fn(self_fn, a, i + 1, cur_sum - a[i]), tuple(int(i) for i in input().split())))
|
1 7 11 5
7 3 2 5
|
YES
NO
|
EXPR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR VAR VAR NUMBER NUMBER STRING STRING VAR NUMBER VAR NUMBER FUNC_CALL VAR VAR VAR BIN_OP VAR NUMBER BIN_OP VAR VAR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR NUMBER BIN_OP VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR
|
Dawid has four bags of candies. The i-th of them contains a_i candies. Also, Dawid has two friends. He wants to give each bag to one of his two friends. Is it possible to distribute the bags in such a way that each friend receives the same amount of candies in total?
Note, that you can't keep bags for yourself or throw them away, each bag should be given to one of the friends.
Input
The only line contains four integers a_1, a_2, a_3 and a_4 (1 β€ a_i β€ 100) β the numbers of candies in each bag.
Output
Output YES if it's possible to give the bags to Dawid's friends so that both friends receive the same amount of candies, or NO otherwise. Each character can be printed in any case (either uppercase or lowercase).
Examples
Input
1 7 11 5
Output
YES
Input
7 3 2 5
Output
NO
Note
In the first sample test, Dawid can give the first and the third bag to the first friend, and the second and the fourth bag to the second friend. This way, each friend will receive 12 candies.
In the second sample test, it's impossible to distribute the bags.
|
a,b,c,d=sorted(map(int,input().split()));print(["NO","YES"][a+d==b+c or a+b+c==d])
|
1 7 11 5
7 3 2 5
|
YES
NO
|
ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST STRING STRING BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR
|
Today the kindergarten has a new group of n kids who need to be seated at the dinner table. The chairs at the table are numbered from 1 to 4n. Two kids can't sit on the same chair. It is known that two kids who sit on chairs with numbers a and b (a β b) will indulge if:
1. gcd(a, b) = 1 or,
2. a divides b or b divides a.
gcd(a, b) β the maximum number x such that a is divisible by x and b is divisible by x.
For example, if n=3 and the kids sit on chairs with numbers 2, 3, 4, then they will indulge since 4 is divided by 2 and gcd(2, 3) = 1. If kids sit on chairs with numbers 4, 6, 10, then they will not indulge.
The teacher really doesn't want the mess at the table, so she wants to seat the kids so there are no 2 of the kid that can indulge. More formally, she wants no pair of chairs a and b that the kids occupy to fulfill the condition above.
Since the teacher is very busy with the entertainment of the kids, she asked you to solve this problem.
Input
The first line contains one integer t (1 β€ t β€ 100) β the number of test cases. Then t test cases follow.
Each test case consists of one line containing an integer n (1 β€ n β€ 100) β the number of kids.
Output
Output t lines, which contain n distinct integers from 1 to 4n β the numbers of chairs that the kids should occupy in the corresponding test case. If there are multiple answers, print any of them. You can print n numbers in any order.
Example
Input
3
2
3
4
Output
6 4
4 6 10
14 10 12 8
|
for s in [*open(0)][1:]:N=int(s);print(*range(2*N,4*N,2))
|
3
2
3
4
|
8 6
12 10 8
16 14 12 10
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP NUMBER VAR BIN_OP NUMBER VAR NUMBER
|
Today the kindergarten has a new group of n kids who need to be seated at the dinner table. The chairs at the table are numbered from 1 to 4n. Two kids can't sit on the same chair. It is known that two kids who sit on chairs with numbers a and b (a β b) will indulge if:
1. gcd(a, b) = 1 or,
2. a divides b or b divides a.
gcd(a, b) β the maximum number x such that a is divisible by x and b is divisible by x.
For example, if n=3 and the kids sit on chairs with numbers 2, 3, 4, then they will indulge since 4 is divided by 2 and gcd(2, 3) = 1. If kids sit on chairs with numbers 4, 6, 10, then they will not indulge.
The teacher really doesn't want the mess at the table, so she wants to seat the kids so there are no 2 of the kid that can indulge. More formally, she wants no pair of chairs a and b that the kids occupy to fulfill the condition above.
Since the teacher is very busy with the entertainment of the kids, she asked you to solve this problem.
Input
The first line contains one integer t (1 β€ t β€ 100) β the number of test cases. Then t test cases follow.
Each test case consists of one line containing an integer n (1 β€ n β€ 100) β the number of kids.
Output
Output t lines, which contain n distinct integers from 1 to 4n β the numbers of chairs that the kids should occupy in the corresponding test case. If there are multiple answers, print any of them. You can print n numbers in any order.
Example
Input
3
2
3
4
Output
6 4
4 6 10
14 10 12 8
|
for _ in range(int(input())):n = int(input());print(*range(4*n, 4*n - 2*n, -2))
|
3
2
3
4
|
8 6
12 10 8
16 14 12 10
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP NUMBER VAR BIN_OP BIN_OP NUMBER VAR BIN_OP NUMBER VAR NUMBER
|
Today the kindergarten has a new group of n kids who need to be seated at the dinner table. The chairs at the table are numbered from 1 to 4n. Two kids can't sit on the same chair. It is known that two kids who sit on chairs with numbers a and b (a β b) will indulge if:
1. gcd(a, b) = 1 or,
2. a divides b or b divides a.
gcd(a, b) β the maximum number x such that a is divisible by x and b is divisible by x.
For example, if n=3 and the kids sit on chairs with numbers 2, 3, 4, then they will indulge since 4 is divided by 2 and gcd(2, 3) = 1. If kids sit on chairs with numbers 4, 6, 10, then they will not indulge.
The teacher really doesn't want the mess at the table, so she wants to seat the kids so there are no 2 of the kid that can indulge. More formally, she wants no pair of chairs a and b that the kids occupy to fulfill the condition above.
Since the teacher is very busy with the entertainment of the kids, she asked you to solve this problem.
Input
The first line contains one integer t (1 β€ t β€ 100) β the number of test cases. Then t test cases follow.
Each test case consists of one line containing an integer n (1 β€ n β€ 100) β the number of kids.
Output
Output t lines, which contain n distinct integers from 1 to 4n β the numbers of chairs that the kids should occupy in the corresponding test case. If there are multiple answers, print any of them. You can print n numbers in any order.
Example
Input
3
2
3
4
Output
6 4
4 6 10
14 10 12 8
|
for _ in range(int(input())):n=int(input());print(*range(2*n,4*n,2))
|
3
2
3
4
|
8 6
12 10 8
16 14 12 10
|
FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP NUMBER VAR BIN_OP NUMBER VAR NUMBER
|
Today the kindergarten has a new group of n kids who need to be seated at the dinner table. The chairs at the table are numbered from 1 to 4n. Two kids can't sit on the same chair. It is known that two kids who sit on chairs with numbers a and b (a β b) will indulge if:
1. gcd(a, b) = 1 or,
2. a divides b or b divides a.
gcd(a, b) β the maximum number x such that a is divisible by x and b is divisible by x.
For example, if n=3 and the kids sit on chairs with numbers 2, 3, 4, then they will indulge since 4 is divided by 2 and gcd(2, 3) = 1. If kids sit on chairs with numbers 4, 6, 10, then they will not indulge.
The teacher really doesn't want the mess at the table, so she wants to seat the kids so there are no 2 of the kid that can indulge. More formally, she wants no pair of chairs a and b that the kids occupy to fulfill the condition above.
Since the teacher is very busy with the entertainment of the kids, she asked you to solve this problem.
Input
The first line contains one integer t (1 β€ t β€ 100) β the number of test cases. Then t test cases follow.
Each test case consists of one line containing an integer n (1 β€ n β€ 100) β the number of kids.
Output
Output t lines, which contain n distinct integers from 1 to 4n β the numbers of chairs that the kids should occupy in the corresponding test case. If there are multiple answers, print any of them. You can print n numbers in any order.
Example
Input
3
2
3
4
Output
6 4
4 6 10
14 10 12 8
|
for s in[*open(0)][1:]:n=int(s);print(*(x for x in range(2*n+2,4*n+2,2)))
|
3
2
3
4
|
8 6
12 10 8
16 14 12 10
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR FUNC_CALL VAR BIN_OP BIN_OP NUMBER VAR NUMBER BIN_OP BIN_OP NUMBER VAR NUMBER NUMBER
|
Today the kindergarten has a new group of n kids who need to be seated at the dinner table. The chairs at the table are numbered from 1 to 4n. Two kids can't sit on the same chair. It is known that two kids who sit on chairs with numbers a and b (a β b) will indulge if:
1. gcd(a, b) = 1 or,
2. a divides b or b divides a.
gcd(a, b) β the maximum number x such that a is divisible by x and b is divisible by x.
For example, if n=3 and the kids sit on chairs with numbers 2, 3, 4, then they will indulge since 4 is divided by 2 and gcd(2, 3) = 1. If kids sit on chairs with numbers 4, 6, 10, then they will not indulge.
The teacher really doesn't want the mess at the table, so she wants to seat the kids so there are no 2 of the kid that can indulge. More formally, she wants no pair of chairs a and b that the kids occupy to fulfill the condition above.
Since the teacher is very busy with the entertainment of the kids, she asked you to solve this problem.
Input
The first line contains one integer t (1 β€ t β€ 100) β the number of test cases. Then t test cases follow.
Each test case consists of one line containing an integer n (1 β€ n β€ 100) β the number of kids.
Output
Output t lines, which contain n distinct integers from 1 to 4n β the numbers of chairs that the kids should occupy in the corresponding test case. If there are multiple answers, print any of them. You can print n numbers in any order.
Example
Input
3
2
3
4
Output
6 4
4 6 10
14 10 12 8
|
for s in[*open(0)][1:]:n=int(s);print(*range(2*n,4*n,2))
|
3
2
3
4
|
8 6
12 10 8
16 14 12 10
|
FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP NUMBER VAR BIN_OP NUMBER VAR NUMBER
|
Valera had two bags of potatoes, the first of these bags contains x (x β₯ 1) potatoes, and the second β y (y β₯ 1) potatoes. Valera β very scattered boy, so the first bag of potatoes (it contains x potatoes) Valera lost. Valera remembers that the total amount of potatoes (x + y) in the two bags, firstly, was not gerater than n, and, secondly, was divisible by k.
Help Valera to determine how many potatoes could be in the first bag. Print all such possible numbers in ascending order.
Input
The first line of input contains three integers y, k, n (1 β€ y, k, n β€ 109; <image> β€ 105).
Output
Print the list of whitespace-separated integers β all possible values of x in ascending order. You should print each possible value of x exactly once.
If there are no such values of x print a single integer -1.
Examples
Input
10 1 10
Output
-1
Input
10 6 40
Output
2 8 14 20 26
|
y, k, n = map(int, input().split());print(' '.join(map(str, range(y//k*k+k-y, n-y+1, k))) if n//k>y//k else -1)
|
10 6 40
10 1 10
|
2 8 14 20 26
-1
|
ASSIGN VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR BIN_OP VAR VAR FUNC_CALL STRING FUNC_CALL VAR VAR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR BIN_OP BIN_OP VAR VAR NUMBER VAR NUMBER
|
Tonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The artful Heidi plans to crash the party, incognito, disguised as one of them. Her objective is to get away with at least one brain, so she can analyze the zombies' mindset back home and gain a strategic advantage.
They will be N guests tonight: N - 1 real zombies and a fake one, our Heidi. The living-dead love hierarchies as much as they love brains: each one has a unique rank in the range 1 to N - 1, and Heidi, who still appears slightly different from the others, is attributed the highest rank, N. Tonight there will be a chest with brains on display and every attendee sees how many there are. These will then be split among the attendees according to the following procedure:
The zombie of the highest rank makes a suggestion on who gets how many brains (every brain is an indivisible entity). A vote follows. If at least half of the attendees accept the offer, the brains are shared in the suggested way and the feast begins. But if majority is not reached, then the highest-ranked zombie is killed, and the next zombie in hierarchy has to make a suggestion. If he is killed too, then the third highest-ranked makes one, etc. (It's enough to have exactly half of the votes β in case of a tie, the vote of the highest-ranked alive zombie counts twice, and he will of course vote in favor of his own suggestion in order to stay alive.)
You should know that zombies are very greedy and sly, and they know this too β basically all zombie brains are alike. Consequently, a zombie will never accept an offer which is suboptimal for him. That is, if an offer is not strictly better than a potential later offer, he will vote against it. And make no mistake: while zombies may normally seem rather dull, tonight their intellects are perfect. Each zombie's priorities for tonight are, in descending order:
1. survive the event (they experienced death already once and know it is no fun),
2. get as many brains as possible.
Heidi goes first and must make an offer which at least half of the attendees will accept, and which allocates at least one brain for Heidi herself.
What is the smallest number of brains that have to be in the chest for this to be possible?
Input
The only line of input contains one integer: N, the number of attendees (1 β€ N β€ 109).
Output
Output one integer: the smallest number of brains in the chest which allows Heidi to take one brain home.
Examples
Input
1
Output
1
Input
4
Output
2
Note
|
print(int((int(input())+1)/2))
|
1
4
|
1
2
|
EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER
|
Tonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The artful Heidi plans to crash the party, incognito, disguised as one of them. Her objective is to get away with at least one brain, so she can analyze the zombies' mindset back home and gain a strategic advantage.
They will be N guests tonight: N - 1 real zombies and a fake one, our Heidi. The living-dead love hierarchies as much as they love brains: each one has a unique rank in the range 1 to N - 1, and Heidi, who still appears slightly different from the others, is attributed the highest rank, N. Tonight there will be a chest with brains on display and every attendee sees how many there are. These will then be split among the attendees according to the following procedure:
The zombie of the highest rank makes a suggestion on who gets how many brains (every brain is an indivisible entity). A vote follows. If at least half of the attendees accept the offer, the brains are shared in the suggested way and the feast begins. But if majority is not reached, then the highest-ranked zombie is killed, and the next zombie in hierarchy has to make a suggestion. If he is killed too, then the third highest-ranked makes one, etc. (It's enough to have exactly half of the votes β in case of a tie, the vote of the highest-ranked alive zombie counts twice, and he will of course vote in favor of his own suggestion in order to stay alive.)
You should know that zombies are very greedy and sly, and they know this too β basically all zombie brains are alike. Consequently, a zombie will never accept an offer which is suboptimal for him. That is, if an offer is not strictly better than a potential later offer, he will vote against it. And make no mistake: while zombies may normally seem rather dull, tonight their intellects are perfect. Each zombie's priorities for tonight are, in descending order:
1. survive the event (they experienced death already once and know it is no fun),
2. get as many brains as possible.
Heidi goes first and must make an offer which at least half of the attendees will accept, and which allocates at least one brain for Heidi herself.
What is the smallest number of brains that have to be in the chest for this to be possible?
Input
The only line of input contains one integer: N, the number of attendees (1 β€ N β€ 109).
Output
Output one integer: the smallest number of brains in the chest which allows Heidi to take one brain home.
Examples
Input
1
Output
1
Input
4
Output
2
Note
|
print(int(int(input())/2 + .5))
|
1
4
|
1
2
|
EXPR FUNC_CALL VAR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER
|
Tonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The artful Heidi plans to crash the party, incognito, disguised as one of them. Her objective is to get away with at least one brain, so she can analyze the zombies' mindset back home and gain a strategic advantage.
They will be N guests tonight: N - 1 real zombies and a fake one, our Heidi. The living-dead love hierarchies as much as they love brains: each one has a unique rank in the range 1 to N - 1, and Heidi, who still appears slightly different from the others, is attributed the highest rank, N. Tonight there will be a chest with brains on display and every attendee sees how many there are. These will then be split among the attendees according to the following procedure:
The zombie of the highest rank makes a suggestion on who gets how many brains (every brain is an indivisible entity). A vote follows. If at least half of the attendees accept the offer, the brains are shared in the suggested way and the feast begins. But if majority is not reached, then the highest-ranked zombie is killed, and the next zombie in hierarchy has to make a suggestion. If he is killed too, then the third highest-ranked makes one, etc. (It's enough to have exactly half of the votes β in case of a tie, the vote of the highest-ranked alive zombie counts twice, and he will of course vote in favor of his own suggestion in order to stay alive.)
You should know that zombies are very greedy and sly, and they know this too β basically all zombie brains are alike. Consequently, a zombie will never accept an offer which is suboptimal for him. That is, if an offer is not strictly better than a potential later offer, he will vote against it. And make no mistake: while zombies may normally seem rather dull, tonight their intellects are perfect. Each zombie's priorities for tonight are, in descending order:
1. survive the event (they experienced death already once and know it is no fun),
2. get as many brains as possible.
Heidi goes first and must make an offer which at least half of the attendees will accept, and which allocates at least one brain for Heidi herself.
What is the smallest number of brains that have to be in the chest for this to be possible?
Input
The only line of input contains one integer: N, the number of attendees (1 β€ N β€ 109).
Output
Output one integer: the smallest number of brains in the chest which allows Heidi to take one brain home.
Examples
Input
1
Output
1
Input
4
Output
2
Note
|
print((int(input())+1)//2)
|
1
4
|
1
2
|
EXPR FUNC_CALL VAR BIN_OP BIN_OP FUNC_CALL VAR FUNC_CALL VAR NUMBER NUMBER
|
Tonight is brain dinner night and all zombies will gather together to scarf down some delicious brains. The artful Heidi plans to crash the party, incognito, disguised as one of them. Her objective is to get away with at least one brain, so she can analyze the zombies' mindset back home and gain a strategic advantage.
They will be N guests tonight: N - 1 real zombies and a fake one, our Heidi. The living-dead love hierarchies as much as they love brains: each one has a unique rank in the range 1 to N - 1, and Heidi, who still appears slightly different from the others, is attributed the highest rank, N. Tonight there will be a chest with brains on display and every attendee sees how many there are. These will then be split among the attendees according to the following procedure:
The zombie of the highest rank makes a suggestion on who gets how many brains (every brain is an indivisible entity). A vote follows. If at least half of the attendees accept the offer, the brains are shared in the suggested way and the feast begins. But if majority is not reached, then the highest-ranked zombie is killed, and the next zombie in hierarchy has to make a suggestion. If he is killed too, then the third highest-ranked makes one, etc. (It's enough to have exactly half of the votes β in case of a tie, the vote of the highest-ranked alive zombie counts twice, and he will of course vote in favor of his own suggestion in order to stay alive.)
You should know that zombies are very greedy and sly, and they know this too β basically all zombie brains are alike. Consequently, a zombie will never accept an offer which is suboptimal for him. That is, if an offer is not strictly better than a potential later offer, he will vote against it. And make no mistake: while zombies may normally seem rather dull, tonight their intellects are perfect. Each zombie's priorities for tonight are, in descending order:
1. survive the event (they experienced death already once and know it is no fun),
2. get as many brains as possible.
Heidi goes first and must make an offer which at least half of the attendees will accept, and which allocates at least one brain for Heidi herself.
What is the smallest number of brains that have to be in the chest for this to be possible?
Input
The only line of input contains one integer: N, the number of attendees (1 β€ N β€ 109).
Output
Output one integer: the smallest number of brains in the chest which allows Heidi to take one brain home.
Examples
Input
1
Output
1
Input
4
Output
2
Note
|
print((1 + int(input())) // 2)
|
1
4
|
1
2
|
EXPR FUNC_CALL VAR BIN_OP BIN_OP NUMBER FUNC_CALL VAR FUNC_CALL VAR NUMBER
|
You are given two lists of non-zero digits.
Let's call an integer pretty if its (base 10) representation has at least one digit from the first list and at least one digit from the second list. What is the smallest positive pretty integer?
Input
The first line contains two integers n and m (1 β€ n, m β€ 9) β the lengths of the first and the second lists, respectively.
The second line contains n distinct digits a1, a2, ..., an (1 β€ ai β€ 9) β the elements of the first list.
The third line contains m distinct digits b1, b2, ..., bm (1 β€ bi β€ 9) β the elements of the second list.
Output
Print the smallest pretty integer.
Examples
Input
2 3
4 2
5 7 6
Output
25
Input
8 8
1 2 3 4 5 6 7 8
8 7 6 5 4 3 2 1
Output
1
Note
In the first example 25, 46, 24567 are pretty, as well as many other integers. The smallest among them is 25. 42 and 24 are not pretty because they don't have digits from the second list.
In the second example all integers that have at least one digit different from 9 are pretty. It's obvious that the smallest among them is 1, because it's the smallest positive integer.
|
print((lambda a,x,y: sorted([i for i in x if i in y])[0] if len([i for i in x if i in y])!=0 else str(min(min(x),min(y)))+str(max(min(x),min(y))))(input(),list(map(int,input().split())),list(map(int,input().split()))))
|
8 8
1 2 3 4 5 6 7 8
8 7 6 5 4 3 2 1
2 3
4 2
5 7 6
|
1
25
|
EXPR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER BIN_OP FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR
|
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(123) = 1 + 2 + 3 = 6.
We will call an integer n a Snuke number when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds.
Given an integer K, list the K smallest Snuke numbers.
Constraints
* 1 \leq K
* The K-th smallest Snuke number is not greater than 10^{15}.
Input
Input is given from Standard Input in the following format:
K
Output
Print K lines. The i-th line should contain the i-th smallest Snuke number.
Example
Input
10
Output
1
2
3
4
5
6
7
8
9
19
|
print(*[1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1099, 1199, 1299, 1399, 1499, 1599, 1699, 1799, 1899, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 10999, 11999, 12999, 13999, 14999, 15999, 16999, 17999, 18999, 19999, 20999, 21999, 22999, 23999, 24999, 25999, 26999, 27999, 28999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 109999, 119999, 129999, 139999, 149999, 159999, 169999, 179999, 189999, 199999, 209999, 219999, 229999, 239999, 249999, 259999, 269999, 279999, 289999, 299999, 309999, 319999, 329999, 339999, 349999, 359999, 369999, 379999, 389999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1099999, 1199999, 1299999, 1399999, 1499999, 1599999, 1699999, 1799999, 1899999, 1999999, 2099999, 2199999, 2299999, 2399999, 2499999, 2599999, 2699999, 2799999, 2899999, 2999999, 3099999, 3199999, 3299999, 3399999, 3499999, 3599999, 3699999, 3799999, 3899999, 3999999, 4099999, 4199999, 4299999, 4399999, 4499999, 4599999, 4699999, 4799999, 4899999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 10999999, 11999999, 12999999, 13999999, 14999999, 15999999, 16999999, 17999999, 18999999, 19999999, 20999999, 21999999, 22999999, 23999999, 24999999, 25999999, 26999999, 27999999, 28999999, 29999999, 30999999, 31999999, 32999999, 33999999, 34999999, 35999999, 36999999, 37999999, 38999999, 39999999, 40999999, 41999999, 42999999, 43999999, 44999999, 45999999, 46999999, 47999999, 48999999, 49999999, 50999999, 51999999, 52999999, 53999999, 54999999, 55999999, 56999999, 57999999, 58999999, 59999999, 69999999, 79999999, 89999999, 99999999, 109999999, 119999999, 129999999, 139999999, 149999999, 159999999, 169999999, 179999999, 189999999, 199999999, 209999999, 219999999, 229999999, 239999999, 249999999, 259999999, 269999999, 279999999, 289999999, 299999999, 309999999, 319999999, 329999999, 339999999, 349999999, 359999999, 369999999, 379999999, 389999999, 399999999, 409999999, 419999999, 429999999, 439999999, 449999999, 459999999, 469999999, 479999999, 489999999, 499999999, 509999999, 519999999, 529999999, 539999999, 549999999, 559999999, 569999999, 579999999, 589999999, 599999999, 609999999, 619999999, 629999999, 639999999, 649999999, 659999999, 669999999, 679999999, 689999999, 699999999, 799999999, 899999999, 999999999, 1099999999, 1199999999, 1299999999, 1399999999, 1499999999, 1599999999, 1699999999, 1799999999, 1899999999, 1999999999, 2099999999, 2199999999, 2299999999, 2399999999, 2499999999, 2599999999, 2699999999, 2799999999, 2899999999, 2999999999, 3099999999, 3199999999, 3299999999, 3399999999, 3499999999, 3599999999, 3699999999, 3799999999, 3899999999, 3999999999, 4099999999, 4199999999, 4299999999, 4399999999, 4499999999, 4599999999, 4699999999, 4799999999, 4899999999, 4999999999, 5099999999, 5199999999, 5299999999, 5399999999, 5499999999, 5599999999, 5699999999, 5799999999, 5899999999, 5999999999, 6099999999, 6199999999, 6299999999, 6399999999, 6499999999, 6599999999, 6699999999, 6799999999, 6899999999, 6999999999, 7099999999, 7199999999, 7299999999, 7399999999, 7499999999, 7599999999, 7699999999, 7799999999, 7899999999, 7999999999, 8999999999, 9999999999, 10999999999, 11999999999, 12999999999, 13999999999, 14999999999, 15999999999, 16999999999, 17999999999, 18999999999, 19999999999, 20999999999, 21999999999, 22999999999, 23999999999, 24999999999, 25999999999, 26999999999, 27999999999, 28999999999, 29999999999, 30999999999, 31999999999, 32999999999, 33999999999, 34999999999, 35999999999, 36999999999, 37999999999, 38999999999, 39999999999, 40999999999, 41999999999, 42999999999, 43999999999, 44999999999, 45999999999, 46999999999, 47999999999, 48999999999, 49999999999, 50999999999, 51999999999, 52999999999, 53999999999, 54999999999, 55999999999, 56999999999, 57999999999, 58999999999, 59999999999, 60999999999, 61999999999, 62999999999, 63999999999, 64999999999, 65999999999, 66999999999, 67999999999, 68999999999, 69999999999, 70999999999, 71999999999, 72999999999, 73999999999, 74999999999, 75999999999, 76999999999, 77999999999, 78999999999, 79999999999, 80999999999, 81999999999, 82999999999, 83999999999, 84999999999, 85999999999, 86999999999, 87999999999, 88999999999, 89999999999, 99999999999, 109999999999, 119999999999, 129999999999, 139999999999, 149999999999, 159999999999, 169999999999, 179999999999, 189999999999, 199999999999, 209999999999, 219999999999, 229999999999, 239999999999, 249999999999, 259999999999, 269999999999, 279999999999, 289999999999, 299999999999, 309999999999, 319999999999, 329999999999, 339999999999, 349999999999, 359999999999, 369999999999, 379999999999, 389999999999, 399999999999, 409999999999, 419999999999, 429999999999, 439999999999, 449999999999, 459999999999, 469999999999, 479999999999, 489999999999, 499999999999, 509999999999, 519999999999, 529999999999, 539999999999, 549999999999, 559999999999, 569999999999, 579999999999, 589999999999, 599999999999, 609999999999, 619999999999, 629999999999, 639999999999, 649999999999, 659999999999, 669999999999, 679999999999, 689999999999, 699999999999, 709999999999, 719999999999, 729999999999, 739999999999, 749999999999, 759999999999, 769999999999, 779999999999, 789999999999, 799999999999, 809999999999, 819999999999, 829999999999, 839999999999, 849999999999, 859999999999, 869999999999, 879999999999, 889999999999, 899999999999, 909999999999, 919999999999, 929999999999, 939999999999, 949999999999, 959999999999, 969999999999, 979999999999, 989999999999, 999999999999, 1099999999999, 1199999999999, 1299999999999, 1399999999999, 1499999999999, 1599999999999, 1699999999999, 1799999999999, 1899999999999, 1999999999999, 2099999999999, 2199999999999, 2299999999999, 2399999999999, 2499999999999, 2599999999999, 2699999999999, 2799999999999, 2899999999999, 2999999999999, 3099999999999, 3199999999999, 3299999999999, 3399999999999, 3499999999999, 3599999999999, 3699999999999, 3799999999999, 3899999999999, 3999999999999, 4099999999999, 4199999999999, 4299999999999, 4399999999999, 4499999999999, 4599999999999, 4699999999999, 4799999999999, 4899999999999, 4999999999999, 5099999999999, 5199999999999, 5299999999999, 5399999999999, 5499999999999, 5599999999999, 5699999999999, 5799999999999, 5899999999999, 5999999999999, 6099999999999, 6199999999999, 6299999999999, 6399999999999, 6499999999999, 6599999999999, 6699999999999, 6799999999999, 6899999999999, 6999999999999, 7099999999999, 7199999999999, 7299999999999, 7399999999999, 7499999999999, 7599999999999, 7699999999999, 7799999999999, 7899999999999, 7999999999999, 8099999999999, 8199999999999, 8299999999999, 8399999999999, 8499999999999, 8599999999999, 8699999999999, 8799999999999, 8899999999999, 8999999999999, 9099999999999, 9199999999999, 9299999999999, 9399999999999, 9499999999999, 9599999999999, 9699999999999, 9799999999999, 9899999999999, 9999999999999, 10999999999999, 11999999999999, 12999999999999, 13999999999999, 14999999999999, 15999999999999, 16999999999999, 17999999999999, 18999999999999, 19999999999999, 20999999999999, 21999999999999, 22999999999999, 23999999999999, 24999999999999, 25999999999999, 26999999999999, 27999999999999, 28999999999999, 29999999999999, 30999999999999, 31999999999999, 32999999999999, 33999999999999, 34999999999999, 35999999999999, 36999999999999, 37999999999999, 38999999999999, 39999999999999, 40999999999999, 41999999999999, 42999999999999, 43999999999999, 44999999999999, 45999999999999, 46999999999999, 47999999999999, 48999999999999, 49999999999999, 50999999999999, 51999999999999, 52999999999999, 53999999999999, 54999999999999, 55999999999999, 56999999999999, 57999999999999, 58999999999999, 59999999999999, 60999999999999, 61999999999999, 62999999999999, 63999999999999, 64999999999999, 65999999999999, 66999999999999, 67999999999999, 68999999999999, 69999999999999, 70999999999999, 71999999999999, 72999999999999, 73999999999999, 74999999999999, 75999999999999, 76999999999999, 77999999999999, 78999999999999, 79999999999999, 80999999999999, 81999999999999, 82999999999999, 83999999999999, 84999999999999, 85999999999999, 86999999999999, 87999999999999, 88999999999999, 89999999999999, 90999999999999, 91999999999999, 92999999999999, 93999999999999, 94999999999999, 95999999999999, 96999999999999, 97999999999999, 98999999999999, 99999999999999, 100999999999999, 101999999999999, 102999999999999, 103999999999999, 104999999999999, 105999999999999, 106999999999999, 107999999999999, 108999999999999, 109999999999999, 119999999999999, 129999999999999, 139999999999999, 149999999999999, 159999999999999, 169999999999999, 179999999999999, 189999999999999, 199999999999999, 209999999999999, 219999999999999, 229999999999999, 239999999999999, 249999999999999, 259999999999999, 269999999999999, 279999999999999, 289999999999999, 299999999999999, 309999999999999, 319999999999999, 329999999999999, 339999999999999, 349999999999999, 359999999999999, 369999999999999, 379999999999999, 389999999999999, 399999999999999, 409999999999999, 419999999999999, 429999999999999, 439999999999999, 449999999999999, 459999999999999, 469999999999999, 479999999999999, 489999999999999, 499999999999999, 509999999999999, 519999999999999, 529999999999999, 539999999999999, 549999999999999, 559999999999999, 569999999999999, 579999999999999, 589999999999999, 599999999999999, 609999999999999, 619999999999999, 629999999999999, 639999999999999, 649999999999999, 659999999999999, 669999999999999, 679999999999999, 689999999999999, 699999999999999, 709999999999999, 719999999999999, 729999999999999, 739999999999999, 749999999999999, 759999999999999, 769999999999999, 779999999999999, 789999999999999, 799999999999999, 809999999999999, 819999999999999, 829999999999999, 839999999999999, 849999999999999, 859999999999999, 869999999999999, 879999999999999, 889999999999999, 899999999999999, 909999999999999, 919999999999999, 929999999999999, 939999999999999, 949999999999999, 959999999999999, 969999999999999, 979999999999999, 989999999999999, 999999999999999][:int(input())])
|
10
|
1
2
3
4
5
6
7
8
9
19
|
EXPR FUNC_CALL VAR LIST NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER NUMBER FUNC_CALL VAR FUNC_CALL VAR
|
The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1)-th character is a hyphen `-`, and the other characters are digits from `0` through `9`.
You are given a string S. Determine whether it follows the postal code format in Atcoder Kingdom.
Constraints
* 1β€A,Bβ€5
* |S|=A+B+1
* S consists of `-` and digits from `0` through `9`.
Input
Input is given from Standard Input in the following format:
A B
S
Output
Print `Yes` if S follows the postal code format in AtCoder Kingdom; print `No` otherwise.
Examples
Input
3 4
269-6650
Output
Yes
Input
1 1
---
Output
No
Input
1 2
7444
Output
No
|
a,b=map(int,input().split());s=input().split("-");print("YNeos"[(len(s)!=2or len(s[0])!=a)::2])
|
1 2
74443 4
269-66501 1
---
|
NoYesNo
|
ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER VAR NUMBER
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.