source
int64 2
2
| difficulty
int64 7
25
| name
stringlengths 9
60
| description
stringlengths 164
7.12k
| public_tests
dict | private_tests
dict | cf_rating
int64 0
3.5k
| cf_points
float64 0
4k
|
---|---|---|---|---|---|---|---|
2 | 11 | 1037_E. Trips | There are n persons who initially don't know each other. On each morning, two of them, who were not friends before, become friends.
We want to plan a trip for every evening of m days. On each trip, you have to select a group of people that will go on the trip. For every person, one of the following should hold:
* Either this person does not go on the trip,
* Or at least k of his friends also go on the trip.
Note that the friendship is not transitive. That is, if a and b are friends and b and c are friends, it does not necessarily imply that a and c are friends.
For each day, find the maximum number of people that can go on the trip on that day.
Input
The first line contains three integers n, m, and k (2 ≤ n ≤ 2 ⋅ 10^5, 1 ≤ m ≤ 2 ⋅ 10^5, 1 ≤ k < n) — the number of people, the number of days and the number of friends each person on the trip should have in the group.
The i-th (1 ≤ i ≤ m) of the next m lines contains two integers x and y (1≤ x, y≤ n, x≠ y), meaning that persons x and y become friends on the morning of day i. It is guaranteed that x and y were not friends before.
Output
Print exactly m lines, where the i-th of them (1≤ i≤ m) contains the maximum number of people that can go on the trip on the evening of the day i.
Examples
Input
4 4 2
2 3
1 2
1 3
1 4
Output
0
0
3
3
Input
5 8 2
2 1
4 2
5 4
5 2
4 3
5 1
4 1
3 2
Output
0
0
0
3
3
4
4
5
Input
5 7 2
1 5
3 2
2 5
3 4
1 2
5 3
1 3
Output
0
0
0
0
3
4
4
Note
In the first example,
* 1,2,3 can go on day 3 and 4.
In the second example,
* 2,4,5 can go on day 4 and 5.
* 1,2,4,5 can go on day 6 and 7.
* 1,2,3,4,5 can go on day 8.
In the third example,
* 1,2,5 can go on day 5.
* 1,2,3,5 can go on day 6 and 7. | {
"input": [
"4 4 2\n2 3\n1 2\n1 3\n1 4\n",
"5 8 2\n2 1\n4 2\n5 4\n5 2\n4 3\n5 1\n4 1\n3 2\n",
"5 7 2\n1 5\n3 2\n2 5\n3 4\n1 2\n5 3\n1 3\n"
],
"output": [
"0\n0\n3\n3\n",
"0\n0\n0\n3\n3\n4\n4\n5\n",
"0\n0\n0\n0\n3\n4\n4\n"
]
} | {
"input": [
"16 20 2\n10 3\n5 3\n10 5\n12 7\n7 6\n9 12\n9 6\n1 10\n11 16\n11 1\n16 2\n10 2\n14 4\n15 14\n4 13\n13 15\n1 8\n7 15\n1 7\n8 15\n",
"2 1 1\n2 1\n"
],
"output": [
"0\n0\n3\n3\n3\n3\n7\n7\n7\n7\n7\n11\n11\n11\n11\n15\n15\n15\n15\n16\n",
"2\n"
]
} | 2,200 | 2,250 |
2 | 7 | 1060_A. Phone Numbers | Let's call a string a phone number if it has length 11 and fits the pattern "8xxxxxxxxxx", where each "x" is replaced by a digit.
For example, "80123456789" and "80000000000" are phone numbers, while "8012345678" and "79000000000" are not.
You have n cards with digits, and you want to use them to make as many phone numbers as possible. Each card must be used in at most one phone number, and you don't have to use all cards. The phone numbers do not necessarily have to be distinct.
Input
The first line contains an integer n — the number of cards with digits that you have (1 ≤ n ≤ 100).
The second line contains a string of n digits (characters "0", "1", ..., "9") s_1, s_2, …, s_n. The string will not contain any other characters, such as leading or trailing spaces.
Output
If at least one phone number can be made from these cards, output the maximum number of phone numbers that can be made. Otherwise, output 0.
Examples
Input
11
00000000008
Output
1
Input
22
0011223344556677889988
Output
2
Input
11
31415926535
Output
0
Note
In the first example, one phone number, "8000000000", can be made from these cards.
In the second example, you can make two phone numbers from the cards, for example, "80123456789" and "80123456789".
In the third example you can't make any phone number from the given cards. | {
"input": [
"22\n0011223344556677889988\n",
"11\n00000000008\n",
"11\n31415926535\n"
],
"output": [
"2\n",
"1\n",
"0\n"
]
} | {
"input": [
"51\n882889888888689888850888388887688788888888888858888\n",
"55\n7271714707719515303911625619272900050990324951111943573\n",
"72\n888488888888823288848804883838888888887888888888228888218488897809784868\n",
"65\n44542121362830719677175203560438858260878894083124543850593761845\n",
"54\n438283821340622774637957966575424773837418828888614203\n",
"100\n1976473621569903172721407763737179639055561746310369779167351419713916160700096173622427077757986026\n",
"100\n2833898888858387469888804083887280788584887487186899808436848018181838884988432785338497585788803883\n",
"42\n885887846290886288816884858898812858495482\n",
"75\n878909759892888846183608689257806813376950958863798487856148633095072259838\n",
"11\n55814018693\n",
"31\n0868889888343881888987888838808\n",
"21\n888888888888000000000\n",
"62\n18888883884288488882387888486858887882838885288886472818688888\n",
"77\n11111111111111111111111111111111111111111111111111111111111111111111111111111\n",
"30\n888888888888888888888888888888\n",
"64\n8885984815868480968883818886281846682409262501034555933863969284\n",
"44\n15920309219313427633220119270900111650391207\n",
"97\n4088468966684435599488804806521288358953088399738904557539253573051442198885776802972628197705081\n",
"100\n8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\n",
"50\n88888888888888888888888888888888888888888888888888\n",
"20\n88888888888888888888\n",
"32\n88888888888888888888888888888888\n",
"82\n8889809888888888485881851986857288588888888881988888868888836888887858888888888878\n",
"91\n8828880888888884883888488888888888888881888888888884888888848588888808888888888888888880888\n",
"87\n311753415808202195240425076966761033489788093280714672959929008324554784724650182457298\n",
"85\n6888887655188885918863889822590788834182048952565514598298586848861396753319582883848\n",
"100\n8088888818885808888888848829886788884187188858898888888788988688884828586988888888288078638898728181\n",
"21\n888111111111111111111\n",
"1\n8\n",
"93\n888088898748888038885888818882806848806887888888882087481868888888177809288888889648468888188\n",
"77\n11233392925013001334679215120076714945221576003953746107506364475115045309091\n",
"40\n8888888888888888888888888888888888888888\n",
"33\n888800000000000000000000000000000\n",
"21\n881234567900123456790\n",
"98\n87247250157776241281197787785951754485531639139778166755966603305697265958800376912432893847612736\n",
"90\n888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888\n",
"22\n4215079217017196952791\n",
"99\n509170332523502565755650047942914747120102240396245453406790272793996913905060450414255616791704320\n",
"96\n812087553199958040928832802441581868680188987878748641868838838835609806814288472573117388803351\n",
"1\n0\n",
"100\n8888888888828188888888888888888808888888888888888888891888888768888888888288888885886888838888888888\n",
"11\n80000000000\n",
"86\n84065885114540280210185082984888812185222886689129308815942798404861082196041321701260\n",
"92\n86888880558884738878888381088888888895888881888888888368878888888884888768881888888888808888\n",
"76\n7900795570936733366353829649382870728119825830883973668601071678041634916557\n",
"32\n88000000000000000000000000000000\n",
"70\n8888888888888888888888888888888888888888888888888888888888888888888888\n",
"11\n88888888888\n",
"21\n888000000000000000000\n",
"66\n747099435917145962031075767196746707764157706291155762576312312094\n",
"22\n8899999999999999999999\n",
"11\n81234567123\n",
"41\n78888884888874788841882882888088888588888\n",
"10\n8888888888\n",
"100\n2867878187889776883889958480848802884888888878218089281860321588888888987288888884288488988628618888\n",
"66\n157941266854773786962397310504192100434183957442977444078457168272\n",
"44\n30153452341853403190257244993442815171970194\n",
"63\n728385948188688801288285888788852829888898565895847689806684688\n",
"100\n1835563855281170226095294644116563180561156535623048783710060508361834822227075869575873675232708159\n",
"21\n888888555555555555555\n",
"100\n8881888389882878867888888888888888888886388888888870888884878888089888883898887888808688888487888888\n",
"53\n85838985300863473289888099788588319484149888886832906\n",
"60\n888888888888888888888888888888888888888888888888888888888888\n",
"100\n8820286285185244938452488887088871457098945874486988698468788381417332842888928188688887641132194956\n",
"11\n24572366390\n",
"84\n181288888282608548858058871581888853888486785801381108858832882809848798828837386086\n",
"32\n88257478884887437239023185588797\n",
"99\n097167815527663544905782574817314139311067328533970663873718450545467450059059869618211361469505108\n",
"43\n7404899846883344886153727489084158470112581\n",
"100\n0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008\n",
"8\n12345678\n",
"88\n2694079127792970410465292300936220976260790323517221561516591792566791677970332966660472\n",
"21\n582586788289484878588\n",
"33\n270375004567749549929235905225024\n",
"50\n88000000000000000000000000000000000000000000000000\n",
"33\n429980628264468835720540136177288\n",
"27\n888000000000000000000000000\n",
"10\n8000000000\n",
"74\n70988894874867688968816582886488688881063425288316858438189808828755218508\n",
"22\n6188156585823394680191\n",
"81\n808888883488887888888808888888888888188888888388888888888888868688888488888882888\n",
"57\n888888888888888888888888888888888888888888888888888888888\n",
"100\n6451941807833681891890004306065158148809856572066617888008875119881621810329816763604830895480467878\n",
"83\n88584458884288808888588388818938838468960248387898182887888867888888888886088895788\n",
"11\n81234567090\n",
"21\n880000000000000000000\n",
"94\n8188948828818938226378510887848897889883818858778688882933888883888898198978868888808082461388\n",
"52\n8878588869084488848898838898788838337877898817818888\n",
"61\n8880888836888988888988888887388888888888868898887888818888888\n",
"71\n88888888888888888888888188888805848888788088888883888883187888838888888\n",
"95\n29488352815808808845913584782288724288898869488882098428839370889284838688458247785878848884289\n",
"73\n2185806538483837898808836883483888818818988881880688028788888081888907898\n",
"80\n88888888888888888888888888888888888888888888888888888888888888888888888888888888\n",
"55\n3982037603326093160114589190899881252765957832414122484\n",
"100\n8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888\n"
],
"output": [
"4\n",
"0\n",
"6\n",
"5\n",
"4\n",
"1\n",
"9\n",
"3\n",
"6\n",
"1\n",
"2\n",
"1\n",
"5\n",
"0\n",
"2\n",
"5\n",
"0\n",
"8\n",
"2\n",
"4\n",
"1\n",
"2\n",
"7\n",
"8\n",
"7\n",
"7\n",
"9\n",
"1\n",
"0\n",
"8\n",
"0\n",
"3\n",
"3\n",
"1\n",
"8\n",
"8\n",
"0\n",
"0\n",
"8\n",
"0\n",
"9\n",
"1\n",
"7\n",
"8\n",
"6\n",
"2\n",
"6\n",
"1\n",
"1\n",
"0\n",
"2\n",
"1\n",
"3\n",
"0\n",
"9\n",
"5\n",
"2\n",
"5\n",
"9\n",
"1\n",
"9\n",
"4\n",
"5\n",
"9\n",
"0\n",
"7\n",
"2\n",
"9\n",
"3\n",
"1\n",
"0\n",
"0\n",
"1\n",
"0\n",
"2\n",
"3\n",
"2\n",
"0\n",
"6\n",
"2\n",
"7\n",
"5\n",
"9\n",
"7\n",
"1\n",
"1\n",
"8\n",
"4\n",
"5\n",
"6\n",
"8\n",
"6\n",
"7\n",
"5\n",
"9\n"
]
} | 800 | 500 |
2 | 7 | 1101_A. Minimum Integer | You are given q queries in the following form:
Given three integers l_i, r_i and d_i, find minimum positive integer x_i such that it is divisible by d_i and it does not belong to the segment [l_i, r_i].
Can you answer all the queries?
Recall that a number x belongs to segment [l, r] if l ≤ x ≤ r.
Input
The first line contains one integer q (1 ≤ q ≤ 500) — the number of queries.
Then q lines follow, each containing a query given in the format l_i r_i d_i (1 ≤ l_i ≤ r_i ≤ 10^9, 1 ≤ d_i ≤ 10^9). l_i, r_i and d_i are integers.
Output
For each query print one integer: the answer to this query.
Example
Input
5
2 4 2
5 10 4
3 10 1
1 2 3
4 6 5
Output
6
4
1
3
10 | {
"input": [
"5\n2 4 2\n5 10 4\n3 10 1\n1 2 3\n4 6 5\n"
],
"output": [
"6\n4\n1\n3\n10\n"
]
} | {
"input": [
"20\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n1 1000000000 2\n",
"1\n78 79 79\n",
"1\n6 6 6\n",
"20\n1 1 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n1 999999999 1\n",
"1\n78 1000 1\n",
"1\n77 10000 1\n",
"20\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n",
"10\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n",
"1\n78 80 1\n",
"20\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n1 1000000000 3\n",
"1\n1 1 123456789\n",
"1\n80 100 1\n",
"5\n1000000000 1000000000 1\n1000000000 1000000000 1\n1000000000 1000000000 1\n1000000000 1000000000 1\n1000000000 1000000000 1\n",
"1\n78 10000 1\n",
"1\n79 80 100\n",
"5\n1 1000000000 1\n1 999999999 1\n1 999999998 1\n1 999999997 1\n1 999999996 1\n",
"5\n1 1000000000 1\n1 1000000000 1000000000\n2 1000000000 1\n1 999999999 1000000000\n5 6 5\n",
"30\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n1 999999999 2\n",
"1\n78 89 34\n",
"1\n1 1 1\n",
"1\n1 3 2\n",
"10\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n1 999999998 1\n",
"4\n1 999999999 1\n1 999999998 1\n1 999999997 1\n1 999999996 1\n",
"5\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n",
"2\n1 1 2\n1 1 2\n",
"1\n80 100 80\n",
"25\n1 1000000000 1\n1 1000000000 1000000000\n2 1000000000 1\n1 999999999 1000000000\n5 6 5\n1 1000000000 1\n1 1000000000 1000000000\n2 1000000000 1\n1 999999999 1000000000\n5 6 5\n1 1000000000 1\n1 1000000000 1000000000\n2 1000000000 1\n1 999999999 1000000000\n5 6 5\n1 1000000000 1\n1 1000000000 1000000000\n2 1000000000 1\n1 999999999 1000000000\n5 6 5\n1 1000000000 1\n1 1000000000 1000000000\n2 1000000000 1\n1 999999999 1000000000\n5 6 5\n",
"30\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n",
"16\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n1 1000000000 1\n",
"1\n1 1000000000 6\n",
"1\n5 5 5\n",
"1\n2 5 6\n",
"8\n1 999999998 1\n1 999999997 1\n1 999999996 1\n1 999999995 1\n1 999999994 1\n1 999999993 1\n1 999999992 1\n1 999999991 1\n",
"5\n80 100 10\n5 10 4\n3 10 1\n1 2 3\n4 6 5\n",
"1\n1 1000000000 1017\n",
"1\n1 1000000000 2\n"
],
"output": [
"1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n",
"158\n",
"12\n",
"2\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n",
"1\n",
"1\n",
"1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n",
"1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n",
"1\n",
"1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n1000000002\n",
"123456789\n",
"1\n",
"1\n1\n1\n1\n1\n",
"1\n",
"100\n",
"1000000001\n1000000000\n999999999\n999999998\n999999997\n",
"1000000001\n2000000000\n1\n1000000000\n10\n",
"1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n1000000000\n",
"34\n",
"2\n",
"4\n",
"999999999\n999999999\n999999999\n999999999\n999999999\n999999999\n999999999\n999999999\n999999999\n999999999\n",
"1000000000\n999999999\n999999998\n999999997\n",
"1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n",
"2\n2\n",
"160\n",
"1000000001\n2000000000\n1\n1000000000\n10\n1000000001\n2000000000\n1\n1000000000\n10\n1000000001\n2000000000\n1\n1000000000\n10\n1000000001\n2000000000\n1\n1000000000\n10\n1000000001\n2000000000\n1\n1000000000\n10\n",
"1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n",
"1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n1000000001\n",
"1000000002\n",
"10\n",
"6\n",
"999999999\n999999998\n999999997\n999999996\n999999995\n999999994\n999999993\n999999992\n",
"10\n4\n1\n3\n10\n",
"1000000845\n",
"1000000002\n"
]
} | 1,000 | 0 |
2 | 10 | 1189_D1. Add on a Tree | Note that this is the first problem of the two similar problems. You can hack this problem only if you solve both problems.
You are given a tree with n nodes. In the beginning, 0 is written on all edges. In one operation, you can choose any 2 distinct leaves u, v and any real number x and add x to values written on all edges on the simple path between u and v.
For example, on the picture below you can see the result of applying two operations to the graph: adding 2 on the path from 7 to 6, and then adding -0.5 on the path from 4 to 5.
<image>
Is it true that for any configuration of real numbers written on edges, we can achieve it with a finite number of operations?
Leaf is a node of a tree of degree 1. Simple path is a path that doesn't contain any node twice.
Input
The first line contains a single integer n (2 ≤ n ≤ 10^5) — the number of nodes.
Each of the next n-1 lines contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v), meaning that there is an edge between nodes u and v. It is guaranteed that these edges form a tree.
Output
If there is a configuration of real numbers written on edges of the tree that we can't achieve by performing the operations, output "NO".
Otherwise, output "YES".
You can print each letter in any case (upper or lower).
Examples
Input
2
1 2
Output
YES
Input
3
1 2
2 3
Output
NO
Input
5
1 2
1 3
1 4
2 5
Output
NO
Input
6
1 2
1 3
1 4
2 5
2 6
Output
YES
Note
In the first example, we can add any real x to the value written on the only edge (1, 2).
<image>
In the second example, one of configurations that we can't reach is 0 written on (1, 2) and 1 written on (2, 3).
<image>
Below you can see graphs from examples 3, 4:
<image> <image> | {
"input": [
"2\n1 2\n",
"3\n1 2\n2 3\n",
"5\n1 2\n1 3\n1 4\n2 5\n",
"6\n1 2\n1 3\n1 4\n2 5\n2 6\n"
],
"output": [
"YES",
"NO",
"NO",
"YES"
]
} | {
"input": [
"50\n16 4\n17 9\n31 19\n22 10\n8 1\n40 30\n3 31\n20 29\n47 27\n22 25\n32 34\n12 15\n40 32\n10 33\n47 12\n6 24\n46 41\n14 23\n12 35\n31 42\n46 28\n31 20\n46 37\n1 39\n29 49\n37 47\n40 6\n42 36\n47 2\n24 46\n2 13\n8 45\n41 3\n32 17\n4 7\n47 26\n28 8\n41 50\n34 44\n33 21\n25 5\n16 40\n3 14\n8 18\n28 11\n32 22\n2 38\n3 48\n44 43\n",
"10\n8 1\n1 2\n8 9\n8 5\n1 3\n1 10\n1 6\n1 7\n8 4\n",
"5\n5 1\n5 4\n4 3\n1 2\n",
"7\n1 2\n2 3\n1 4\n1 5\n3 6\n3 7\n",
"3\n1 3\n2 3\n",
"60\n26 6\n59 30\n31 12\n31 3\n38 23\n59 29\n53 9\n38 56\n53 54\n29 21\n17 55\n59 38\n26 16\n24 59\n24 25\n17 35\n24 41\n30 15\n31 27\n8 44\n26 5\n26 48\n8 32\n53 17\n3 34\n3 51\n30 28\n47 10\n53 60\n36 42\n24 53\n59 22\n53 40\n26 52\n36 4\n59 8\n29 37\n36 20\n17 47\n53 18\n3 50\n30 2\n17 7\n8 58\n59 1\n31 11\n24 26\n24 43\n53 57\n59 45\n47 13\n26 46\n17 33\n30 31\n26 39\n26 19\n24 36\n8 49\n38 14\n",
"7\n1 2\n2 3\n3 4\n3 5\n1 6\n1 7\n",
"20\n19 16\n19 18\n20 7\n9 4\n6 17\n14 2\n9 15\n2 13\n5 11\n19 12\n12 20\n16 9\n11 8\n19 5\n3 1\n19 14\n5 3\n12 10\n19 6\n",
"7\n1 2\n1 3\n2 4\n2 5\n3 6\n3 7\n",
"10\n9 5\n7 1\n9 10\n7 2\n5 4\n9 6\n2 9\n10 8\n1 3\n",
"4\n2 4\n2 3\n2 1\n",
"4\n1 4\n3 2\n1 3\n",
"3\n1 2\n1 3\n",
"5\n1 2\n1 5\n1 3\n1 4\n",
"20\n14 9\n12 13\n10 15\n2 1\n20 19\n16 6\n16 3\n17 14\n3 5\n2 11\n3 10\n15 8\n14 2\n6 4\n3 20\n5 18\n1 7\n1 16\n4 12\n",
"20\n7 5\n14 13\n17 6\n3 8\n16 12\n18 9\n3 18\n14 1\n17 3\n15 2\n17 4\n9 11\n2 7\n15 17\n3 20\n16 10\n17 14\n2 16\n1 19\n",
"8\n1 2\n2 3\n3 4\n1 7\n1 8\n4 5\n4 6\n",
"5\n5 1\n5 2\n5 3\n5 4\n",
"50\n49 6\n43 7\n1 27\n19 35\n15 37\n16 12\n19 21\n16 28\n49 9\n48 39\n13 1\n2 48\n9 50\n44 3\n41 32\n48 31\n49 33\n6 11\n13 20\n49 22\n13 41\n48 29\n13 46\n15 47\n34 2\n49 13\n48 14\n34 24\n16 36\n13 40\n49 34\n49 17\n43 25\n11 23\n10 15\n19 26\n34 44\n16 42\n19 18\n46 8\n29 38\n1 45\n12 43\n13 16\n46 30\n15 5\n49 10\n11 19\n32 4\n",
"20\n13 1\n18 2\n3 7\n18 5\n20 16\n3 12\n18 9\n3 10\n18 11\n13 6\n3 18\n20 15\n20 17\n3 13\n3 4\n13 14\n3 20\n18 8\n3 19\n",
"10\n8 2\n5 6\n1 8\n2 9\n1 4\n8 10\n10 5\n2 7\n2 3\n"
],
"output": [
"NO",
"YES",
"NO",
"NO",
"NO",
"YES",
"NO",
"NO",
"NO",
"NO",
"YES",
"NO",
"NO",
"YES",
"NO",
"NO",
"NO",
"YES",
"NO",
"YES",
"NO"
]
} | 1,600 | 250 |
2 | 10 | 1208_D. Restore Permutation | An array of integers p_{1},p_{2}, …,p_{n} is called a permutation if it contains each number from 1 to n exactly once. For example, the following arrays are permutations: [3,1,2], [1], [1,2,3,4,5] and [4,3,1,2]. The following arrays are not permutations: [2], [1,1], [2,3,4].
There is a hidden permutation of length n.
For each index i, you are given s_{i}, which equals to the sum of all p_{j} such that j < i and p_{j} < p_{i}. In other words, s_i is the sum of elements before the i-th element that are smaller than the i-th element.
Your task is to restore the permutation.
Input
The first line contains a single integer n (1 ≤ n ≤ 2 ⋅ 10^{5}) — the size of the permutation.
The second line contains n integers s_{1}, s_{2}, …, s_{n} (0 ≤ s_{i} ≤ (n(n-1))/(2)).
It is guaranteed that the array s corresponds to a valid permutation of length n.
Output
Print n integers p_{1}, p_{2}, …, p_{n} — the elements of the restored permutation. We can show that the answer is always unique.
Examples
Input
3
0 0 0
Output
3 2 1
Input
2
0 1
Output
1 2
Input
5
0 1 1 1 10
Output
1 4 3 2 5
Note
In the first example for each i there is no index j satisfying both conditions, hence s_i are always 0.
In the second example for i = 2 it happens that j = 1 satisfies the conditions, so s_2 = p_1.
In the third example for i = 2, 3, 4 only j = 1 satisfies the conditions, so s_2 = s_3 = s_4 = 1. For i = 5 all j = 1, 2, 3, 4 are possible, so s_5 = p_1 + p_2 + p_3 + p_4 = 10. | {
"input": [
"3\n0 0 0\n",
"5\n0 1 1 1 10\n",
"2\n0 1\n"
],
"output": [
"3 2 1 ",
"1 4 3 2 5 ",
"1 2 "
]
} | {
"input": [
"100\n0 0 57 121 57 0 19 251 19 301 19 160 57 578 664 57 19 50 0 621 91 5 263 34 5 96 713 649 22 22 22 5 108 198 1412 1147 84 1326 1777 0 1780 132 2000 479 1314 525 68 690 1689 1431 1288 54 1514 1593 1037 1655 807 465 1674 1747 1982 423 837 139 1249 1997 1635 1309 661 334 3307 2691 21 3 533 1697 250 3920 0 343 96 242 2359 3877 3877 150 1226 96 358 829 228 2618 27 2854 119 1883 710 0 4248 435\n",
"20\n0 1 7 15 30 15 59 42 1 4 1 36 116 36 16 136 10 36 46 36\n",
"1\n0\n",
"15\n0 0 3 3 13 3 6 34 47 12 20 6 6 21 55\n"
],
"output": [
"94 57 64 90 58 19 53 71 50 67 38 56 45 86 89 42 31 36 5 68 37 10 49 24 7 32 65 59 14 12 11 6 27 34 91 72 21 87 98 3 97 25 100 46 85 48 18 51 88 83 70 13 79 82 62 80 55 43 73 76 81 40 52 22 60 77 69 61 47 35 92 84 9 4 41 66 28 99 2 33 17 26 74 96 95 20 54 15 29 44 23 75 8 78 16 63 39 1 93 30 ",
"1 6 8 15 17 12 18 16 3 4 2 14 20 13 7 19 5 10 11 9 ",
"1 ",
"2 1 15 10 12 3 6 13 14 8 9 5 4 7 11 "
]
} | 1,900 | 2,000 |
2 | 10 | 1227_D1. Optimal Subsequences (Easy Version) | This is the easier version of the problem. In this version 1 ≤ n, m ≤ 100. You can hack this problem only if you solve and lock both problems.
You are given a sequence of integers a=[a_1,a_2,...,a_n] of length n. Its subsequence is obtained by removing zero or more elements from the sequence a (they do not necessarily go consecutively). For example, for the sequence a=[11,20,11,33,11,20,11]:
* [11,20,11,33,11,20,11], [11,20,11,33,11,20], [11,11,11,11], [20], [33,20] are subsequences (these are just some of the long list);
* [40], [33,33], [33,20,20], [20,20,11,11] are not subsequences.
Suppose that an additional non-negative integer k (1 ≤ k ≤ n) is given, then the subsequence is called optimal if:
* it has a length of k and the sum of its elements is the maximum possible among all subsequences of length k;
* and among all subsequences of length k that satisfy the previous item, it is lexicographically minimal.
Recall that the sequence b=[b_1, b_2, ..., b_k] is lexicographically smaller than the sequence c=[c_1, c_2, ..., c_k] if the first element (from the left) in which they differ less in the sequence b than in c. Formally: there exists t (1 ≤ t ≤ k) such that b_1=c_1, b_2=c_2, ..., b_{t-1}=c_{t-1} and at the same time b_t<c_t. For example:
* [10, 20, 20] lexicographically less than [10, 21, 1],
* [7, 99, 99] is lexicographically less than [10, 21, 1],
* [10, 21, 0] is lexicographically less than [10, 21, 1].
You are given a sequence of a=[a_1,a_2,...,a_n] and m requests, each consisting of two numbers k_j and pos_j (1 ≤ k ≤ n, 1 ≤ pos_j ≤ k_j). For each query, print the value that is in the index pos_j of the optimal subsequence of the given sequence a for k=k_j.
For example, if n=4, a=[10,20,30,20], k_j=2, then the optimal subsequence is [20,30] — it is the minimum lexicographically among all subsequences of length 2 with the maximum total sum of items. Thus, the answer to the request k_j=2, pos_j=1 is the number 20, and the answer to the request k_j=2, pos_j=2 is the number 30.
Input
The first line contains an integer n (1 ≤ n ≤ 100) — the length of the sequence a.
The second line contains elements of the sequence a: integer numbers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9).
The third line contains an integer m (1 ≤ m ≤ 100) — the number of requests.
The following m lines contain pairs of integers k_j and pos_j (1 ≤ k ≤ n, 1 ≤ pos_j ≤ k_j) — the requests.
Output
Print m integers r_1, r_2, ..., r_m (1 ≤ r_j ≤ 10^9) one per line: answers to the requests in the order they appear in the input. The value of r_j should be equal to the value contained in the position pos_j of the optimal subsequence for k=k_j.
Examples
Input
3
10 20 10
6
1 1
2 1
2 2
3 1
3 2
3 3
Output
20
10
20
10
20
10
Input
7
1 2 1 3 1 2 1
9
2 1
2 2
3 1
3 2
3 3
1 1
7 1
7 7
7 4
Output
2
3
2
3
2
3
1
1
3
Note
In the first example, for a=[10,20,10] the optimal subsequences are:
* for k=1: [20],
* for k=2: [10,20],
* for k=3: [10,20,10]. | {
"input": [
"3\n10 20 10\n6\n1 1\n2 1\n2 2\n3 1\n3 2\n3 3\n",
"7\n1 2 1 3 1 2 1\n9\n2 1\n2 2\n3 1\n3 2\n3 3\n1 1\n7 1\n7 7\n7 4\n"
],
"output": [
"20\n10\n20\n10\n20\n10\n",
"2\n3\n2\n3\n2\n3\n1\n1\n3\n"
]
} | {
"input": [
"2\n1 10\n3\n2 2\n2 1\n1 1\n",
"2\n3922 3922\n3\n2 2\n2 1\n1 1\n",
"1\n1000000000\n1\n1 1\n",
"1\n1\n3\n1 1\n1 1\n1 1\n",
"5\n3 1 4 1 2\n15\n5 5\n5 4\n5 3\n5 2\n5 1\n4 4\n4 3\n4 2\n4 1\n3 3\n3 2\n3 1\n2 2\n2 1\n1 1\n",
"2\n392222 322\n3\n2 2\n2 1\n1 1\n"
],
"output": [
"10\n1\n10\n",
"3922\n3922\n3922\n",
"1000000000\n",
"1\n1\n1\n",
"2\n1\n4\n1\n3\n2\n4\n1\n3\n2\n4\n3\n4\n3\n4\n",
"322\n392222\n392222\n"
]
} | 1,600 | 500 |
2 | 11 | 1269_E. K Integers | You are given a permutation p_1, p_2, …, p_n.
In one move you can swap two adjacent values.
You want to perform a minimum number of moves, such that in the end there will exist a subsegment 1,2,…, k, in other words in the end there should be an integer i, 1 ≤ i ≤ n-k+1 such that p_i = 1, p_{i+1} = 2, …, p_{i+k-1}=k.
Let f(k) be the minimum number of moves that you need to make a subsegment with values 1,2,…,k appear in the permutation.
You need to find f(1), f(2), …, f(n).
Input
The first line of input contains one integer n (1 ≤ n ≤ 200 000): the number of elements in the permutation.
The next line of input contains n integers p_1, p_2, …, p_n: given permutation (1 ≤ p_i ≤ n).
Output
Print n integers, the minimum number of moves that you need to make a subsegment with values 1,2,…,k appear in the permutation, for k=1, 2, …, n.
Examples
Input
5
5 4 3 2 1
Output
0 1 3 6 10
Input
3
1 2 3
Output
0 0 0 | {
"input": [
"3\n1 2 3\n",
"5\n5 4 3 2 1\n"
],
"output": [
"0 0 0\n",
"0 1 3 6 10\n"
]
} | {
"input": [
"1\n1\n",
"100\n98 52 63 2 18 96 31 58 84 40 41 45 66 100 46 71 26 48 81 20 73 91 68 76 13 93 17 29 64 95 79 21 55 75 19 85 54 51 89 78 15 87 43 59 36 1 90 35 65 56 62 28 86 5 82 49 3 99 33 9 92 32 74 69 27 22 77 16 44 94 34 6 57 70 23 12 61 25 8 11 67 47 83 88 10 14 30 7 97 60 42 37 24 38 53 50 4 80 72 39\n",
"10\n5 1 6 2 8 3 4 10 9 7\n"
],
"output": [
"0\n",
"0 42 52 101 101 117 146 166 166 188 194 197 249 258 294 298 345 415 445 492 522 529 540 562 569 628 628 644 684 699 765 766 768 774 791 812 828 844 863 931 996 1011 1036 1040 1105 1166 1175 1232 1237 1251 1282 1364 1377 1409 1445 1455 1461 1534 1553 1565 1572 1581 1664 1706 1715 1779 1787 1837 1841 1847 1909 1919 1973 1976 2010 2060 2063 2087 2125 2133 2192 2193 2196 2276 2305 2305 2324 2327 2352 2361 2417 2418 2467 2468 2510 2598 2599 2697 2697 2770\n",
"0 1 2 3 8 9 12 12 13 13\n"
]
} | 2,300 | 1,500 |
2 | 11 | 1291_E. Prefix Enlightenment | There are n lamps on a line, numbered from 1 to n. Each one has an initial state off (0) or on (1).
You're given k subsets A_1, …, A_k of \{1, 2, ..., n\}, such that the intersection of any three subsets is empty. In other words, for all 1 ≤ i_1 < i_2 < i_3 ≤ k, A_{i_1} ∩ A_{i_2} ∩ A_{i_3} = ∅.
In one operation, you can choose one of these k subsets and switch the state of all lamps in it. It is guaranteed that, with the given subsets, it's possible to make all lamps be simultaneously on using this type of operation.
Let m_i be the minimum number of operations you have to do in order to make the i first lamps be simultaneously on. Note that there is no condition upon the state of other lamps (between i+1 and n), they can be either off or on.
You have to compute m_i for all 1 ≤ i ≤ n.
Input
The first line contains two integers n and k (1 ≤ n, k ≤ 3 ⋅ 10^5).
The second line contains a binary string of length n, representing the initial state of each lamp (the lamp i is off if s_i = 0, on if s_i = 1).
The description of each one of the k subsets follows, in the following format:
The first line of the description contains a single integer c (1 ≤ c ≤ n) — the number of elements in the subset.
The second line of the description contains c distinct integers x_1, …, x_c (1 ≤ x_i ≤ n) — the elements of the subset.
It is guaranteed that:
* The intersection of any three subsets is empty;
* It's possible to make all lamps be simultaneously on using some operations.
Output
You must output n lines. The i-th line should contain a single integer m_i — the minimum number of operations required to make the lamps 1 to i be simultaneously on.
Examples
Input
7 3
0011100
3
1 4 6
3
3 4 7
2
2 3
Output
1
2
3
3
3
3
3
Input
8 6
00110011
3
1 3 8
5
1 2 5 6 7
2
6 8
2
3 5
2
4 7
1
2
Output
1
1
1
1
1
1
4
4
Input
5 3
00011
3
1 2 3
1
4
3
3 4 5
Output
1
1
1
1
1
Input
19 5
1001001001100000110
2
2 3
2
5 6
2
8 9
5
12 13 14 15 16
1
19
Output
0
1
1
1
2
2
2
3
3
3
3
4
4
4
4
4
4
4
5
Note
In the first example:
* For i = 1, we can just apply one operation on A_1, the final states will be 1010110;
* For i = 2, we can apply operations on A_1 and A_3, the final states will be 1100110;
* For i ≥ 3, we can apply operations on A_1, A_2 and A_3, the final states will be 1111111.
In the second example:
* For i ≤ 6, we can just apply one operation on A_2, the final states will be 11111101;
* For i ≥ 7, we can apply operations on A_1, A_3, A_4, A_6, the final states will be 11111111. | {
"input": [
"5 3\n00011\n3\n1 2 3\n1\n4\n3\n3 4 5\n",
"8 6\n00110011\n3\n1 3 8\n5\n1 2 5 6 7\n2\n6 8\n2\n3 5\n2\n4 7\n1\n2\n",
"19 5\n1001001001100000110\n2\n2 3\n2\n5 6\n2\n8 9\n5\n12 13 14 15 16\n1\n19\n",
"7 3\n0011100\n3\n1 4 6\n3\n3 4 7\n2\n2 3\n"
],
"output": [
"1\n1\n1\n1\n1\n",
"1\n1\n1\n1\n1\n1\n4\n4\n",
"0\n1\n1\n1\n2\n2\n2\n3\n3\n3\n3\n4\n4\n4\n4\n4\n4\n4\n5\n",
"1\n2\n3\n3\n3\n3\n3\n"
]
} | {
"input": [
"1 1\n1\n1\n1\n"
],
"output": [
"0\n"
]
} | 2,400 | 1,750 |
2 | 10 | 1334_D. Minimum Euler Cycle | You are given a complete directed graph K_n with n vertices: each pair of vertices u ≠ v in K_n have both directed edges (u, v) and (v, u); there are no self-loops.
You should find such a cycle in K_n that visits every directed edge exactly once (allowing for revisiting vertices).
We can write such cycle as a list of n(n - 1) + 1 vertices v_1, v_2, v_3, ..., v_{n(n - 1) - 1}, v_{n(n - 1)}, v_{n(n - 1) + 1} = v_1 — a visiting order, where each (v_i, v_{i + 1}) occurs exactly once.
Find the lexicographically smallest such cycle. It's not hard to prove that the cycle always exists.
Since the answer can be too large print its [l, r] segment, in other words, v_l, v_{l + 1}, ..., v_r.
Input
The first line contains the single integer T (1 ≤ T ≤ 100) — the number of test cases.
Next T lines contain test cases — one per line. The first and only line of each test case contains three integers n, l and r (2 ≤ n ≤ 10^5, 1 ≤ l ≤ r ≤ n(n - 1) + 1, r - l + 1 ≤ 10^5) — the number of vertices in K_n, and segment of the cycle to print.
It's guaranteed that the total sum of n doesn't exceed 10^5 and the total sum of r - l + 1 doesn't exceed 10^5.
Output
For each test case print the segment v_l, v_{l + 1}, ..., v_r of the lexicographically smallest cycle that visits every edge exactly once.
Example
Input
3
2 1 3
3 3 6
99995 9998900031 9998900031
Output
1 2 1
1 3 2 3
1
Note
In the second test case, the lexicographically minimum cycle looks like: 1, 2, 1, 3, 2, 3, 1.
In the third test case, it's quite obvious that the cycle should start and end in vertex 1. | {
"input": [
"3\n2 1 3\n3 3 6\n99995 9998900031 9998900031\n"
],
"output": [
"1 2 1 \n1 3 2 3 \n1 \n"
]
} | {
"input": [
"1\n2 2 3\n",
"1\n4 13 13\n",
"1\n3 1 1\n",
"10\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n2 1 3\n",
"1\n3 7 7\n",
"1\n25 30 295\n",
"1\n4 12 13\n",
"5\n3 7 7\n4 13 13\n5 21 21\n6 31 31\n7 42 43\n",
"1\n5 4 4\n"
],
"output": [
"2 1 \n",
"1 \n",
"1 \n",
"1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n1 2 1 \n",
"1 \n",
"16 1 17 1 18 1 19 1 20 1 21 1 22 1 23 1 24 1 25 2 3 2 4 2 5 2 6 2 7 2 8 2 9 2 10 2 11 2 12 2 13 2 14 2 15 2 16 2 17 2 18 2 19 2 20 2 21 2 22 2 23 2 24 2 25 3 4 3 5 3 6 3 7 3 8 3 9 3 10 3 11 3 12 3 13 3 14 3 15 3 16 3 17 3 18 3 19 3 20 3 21 3 22 3 23 3 24 3 25 4 5 4 6 4 7 4 8 4 9 4 10 4 11 4 12 4 13 4 14 4 15 4 16 4 17 4 18 4 19 4 20 4 21 4 22 4 23 4 24 4 25 5 6 5 7 5 8 5 9 5 10 5 11 5 12 5 13 5 14 5 15 5 16 5 17 5 18 5 19 5 20 5 21 5 22 5 23 5 24 5 25 6 7 6 8 6 9 6 10 6 11 6 12 6 13 6 14 6 15 6 16 6 17 6 18 6 19 6 20 6 21 6 22 6 23 6 24 6 25 7 8 7 9 7 10 7 11 7 12 7 13 7 14 7 15 7 16 7 17 7 18 7 19 7 20 7 21 7 22 7 23 7 24 7 25 8 \n",
"4 1 \n",
"1 \n1 \n1 \n1 \n7 1 \n",
"3 \n"
]
} | 1,800 | 0 |
2 | 12 | 1354_F. Summoning Minions | Polycarp plays a computer game. In this game, the players summon armies of magical minions, which then fight each other.
Polycarp can summon n different minions. The initial power level of the i-th minion is a_i, and when it is summoned, all previously summoned minions' power levels are increased by b_i. The minions can be summoned in any order.
Unfortunately, Polycarp cannot have more than k minions under his control. To get rid of unwanted minions after summoning them, he may destroy them. Each minion can be summoned (and destroyed) only once.
Polycarp's goal is to summon the strongest possible army. Formally, he wants to maximize the sum of power levels of all minions under his control (those which are summoned and not destroyed).
Help Polycarp to make up a plan of actions to summon the strongest possible army!
Input
The first line contains one integer T (1 ≤ T ≤ 75) — the number of test cases.
Each test case begins with a line containing two integers n and k (1 ≤ k ≤ n ≤ 75) — the number of minions availible for summoning, and the maximum number of minions that can be controlled by Polycarp, respectively.
Then n lines follow, the i-th line contains 2 integers a_i and b_i (1 ≤ a_i ≤ 10^5, 0 ≤ b_i ≤ 10^5) — the parameters of the i-th minion.
Output
For each test case print the optimal sequence of actions as follows:
Firstly, print m — the number of actions which Polycarp has to perform (0 ≤ m ≤ 2n). Then print m integers o_1, o_2, ..., o_m, where o_i denotes the i-th action as follows: if the i-th action is to summon the minion x, then o_i = x, and if the i-th action is to destroy the minion x, then o_i = -x. Each minion can be summoned at most once and cannot be destroyed before being summoned (and, obviously, cannot be destroyed more than once). The number of minions in Polycarp's army should be not greater than k after every action.
If there are multiple optimal sequences, print any of them.
Example
Input
3
5 2
5 3
7 0
5 0
4 0
10 0
2 1
10 100
50 10
5 5
1 5
2 4
3 3
4 2
5 1
Output
4
2 1 -1 5
1
2
5
5 4 3 2 1
Note
Consider the example test.
In the first test case, Polycarp can summon the minion 2 with power level 7, then summon the minion 1, which will increase the power level of the previous minion by 3, then destroy the minion 1, and finally, summon the minion 5. After this, Polycarp will have two minions with power levels of 10.
In the second test case, Polycarp can control only one minion, so he should choose the strongest of them and summon it.
In the third test case, Polycarp is able to summon and control all five minions. | {
"input": [
"3\n5 2\n5 3\n7 0\n5 0\n4 0\n10 0\n2 1\n10 100\n50 10\n5 5\n1 5\n2 4\n3 3\n4 2\n5 1\n"
],
"output": [
"8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1\n"
]
} | {
"input": [
"3\n5 2\n5 3\n7 0\n5 0\n4 0\n10 0\n2 1\n10 100\n50 10\n5 5\n1 5\n2 4\n3 3\n4 2\n5 1\n"
],
"output": [
"8\n2 3 -3 4 -4 1 -1 5\n3\n1 -1 2\n5\n5 4 3 2 1\n"
]
} | 2,500 | 0 |
2 | 11 | 1374_E1. Reading Books (easy version) | Easy and hard versions are actually different problems, so read statements of both problems completely and carefully.
Summer vacation has started so Alice and Bob want to play and joy, but... Their mom doesn't think so. She says that they have to read some amount of books before all entertainments. Alice and Bob will read each book together to end this exercise faster.
There are n books in the family library. The i-th book is described by three integers: t_i — the amount of time Alice and Bob need to spend to read it, a_i (equals 1 if Alice likes the i-th book and 0 if not), and b_i (equals 1 if Bob likes the i-th book and 0 if not).
So they need to choose some books from the given n books in such a way that:
* Alice likes at least k books from the chosen set and Bob likes at least k books from the chosen set;
* the total reading time of these books is minimized (they are children and want to play and joy as soon a possible).
The set they choose is the same for both Alice an Bob (it's shared between them) and they read all books together, so the total reading time is the sum of t_i over all books that are in the chosen set.
Your task is to help them and find any suitable set of books or determine that it is impossible to find such a set.
Input
The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 2 ⋅ 10^5).
The next n lines contain descriptions of books, one description per line: the i-th line contains three integers t_i, a_i and b_i (1 ≤ t_i ≤ 10^4, 0 ≤ a_i, b_i ≤ 1), where:
* t_i — the amount of time required for reading the i-th book;
* a_i equals 1 if Alice likes the i-th book and 0 otherwise;
* b_i equals 1 if Bob likes the i-th book and 0 otherwise.
Output
If there is no solution, print only one integer -1. Otherwise print one integer T — the minimum total reading time of the suitable set of books.
Examples
Input
8 4
7 1 1
2 1 1
4 0 1
8 1 1
1 0 1
1 1 1
1 0 1
3 0 0
Output
18
Input
5 2
6 0 0
9 0 0
1 0 1
2 1 1
5 1 0
Output
8
Input
5 3
3 0 0
2 1 0
3 1 0
5 0 1
3 0 1
Output
-1 | {
"input": [
"8 4\n7 1 1\n2 1 1\n4 0 1\n8 1 1\n1 0 1\n1 1 1\n1 0 1\n3 0 0\n",
"5 2\n6 0 0\n9 0 0\n1 0 1\n2 1 1\n5 1 0\n",
"5 3\n3 0 0\n2 1 0\n3 1 0\n5 0 1\n3 0 1\n"
],
"output": [
"18\n",
"8\n",
"-1\n"
]
} | {
"input": [
"2 1\n7 1 1\n2 1 1\n",
"5 1\n2 1 0\n2 0 1\n1 0 1\n1 1 0\n1 0 1\n",
"6 2\n6 0 0\n11 1 0\n9 0 1\n21 1 1\n10 1 0\n8 0 1\n",
"3 1\n3 0 1\n3 1 0\n3 0 0\n",
"6 3\n7 1 1\n8 0 0\n9 1 1\n6 1 0\n10 1 1\n5 0 0\n",
"8 4 3\n1 1 1\n3 1 1\n12 1 1\n12 1 1\n4 0 0\n4 0 0\n5 1 0\n5 0 1\n",
"6 3 1\n6 0 0\n11 1 0\n9 0 1\n21 1 1\n10 1 0\n8 0 1\n",
"3 3 1\n27 0 0\n28 0 0\n11 0 0\n",
"1 1 1\n3 0 1\n",
"8 5 1\n43 0 1\n5 0 1\n23 1 1\n55 0 1\n19 1 1\n73 1 1\n16 1 1\n42 1 1\n",
"6 3 2\n6 0 0\n11 1 0\n9 0 1\n21 1 1\n10 1 0\n8 0 1\n",
"9 2 2\n74 0 0\n78 1 0\n21 1 0\n47 1 0\n20 0 0\n22 0 1\n52 0 0\n78 0 0\n90 0 0\n",
"3 2 1\n3 0 1\n3 1 0\n3 0 0\n",
"27 5 1\n232 0 1\n72 0 1\n235 0 1\n2 0 1\n158 0 0\n267 0 0\n242 0 1\n1 0 0\n64 0 0\n139 1 1\n250 0 1\n208 0 1\n127 0 1\n29 0 1\n53 0 1\n100 0 1\n52 0 1\n229 0 0\n1 0 1\n29 0 0\n17 0 1\n74 0 1\n211 0 1\n248 0 1\n15 0 0\n252 0 0\n159 0 1\n",
"6 4 3\n19 0 0\n6 1 1\n57 1 0\n21 0 1\n53 1 1\n9 1 1\n"
],
"output": [
"2\n",
"2\n",
"38\n",
"6\n",
"26\n",
"-1",
"-1",
"-1\n",
"-1\n",
"-1",
"-1",
"-1\n",
"-1\n",
"-1\n",
"-1"
]
} | 1,600 | 0 |
2 | 7 | 1398_A. Bad Triangle | You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}).
Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct a non-degenerate triangle (a triangle with nonzero area) having sides equal to a_i, a_j and a_k (for example it is possible to construct a non-degenerate triangle with sides 3, 4 and 5 but impossible with sides 3, 4 and 7). If it is impossible to find such triple, report it.
Input
The first line contains one integer t (1 ≤ t ≤ 1000) — the number of test cases.
The first line of each test case contains one integer n (3 ≤ n ≤ 5 ⋅ 10^4) — the length of the array a.
The second line of each test case contains n integers a_1, a_2, ... , a_n (1 ≤ a_i ≤ 10^9; a_{i - 1} ≤ a_i) — the array a.
It is guaranteed that the sum of n over all test cases does not exceed 10^5.
Output
For each test case print the answer to it in one line.
If there is a triple of indices i, j, k (i < j < k) such that it is impossible to construct a non-degenerate triangle having sides equal to a_i, a_j and a_k, print that three indices in ascending order. If there are multiple answers, print any of them.
Otherwise, print -1.
Example
Input
3
7
4 6 11 11 15 18 20
4
10 10 10 11
3
1 1 1000000000
Output
2 3 6
-1
1 2 3
Note
In the first test case it is impossible with sides 6, 11 and 18. Note, that this is not the only correct answer.
In the second test case you always can construct a non-degenerate triangle. | {
"input": [
"3\n7\n4 6 11 11 15 18 20\n4\n10 10 10 11\n3\n1 1 1000000000\n"
],
"output": [
"1 2 7\n-1\n1 2 3\n"
]
} | {
"input": [
"3\n7\n4 6 11 11 15 18 20\n4\n10 10 10 11\n3\n1 1 1000000000\n",
"1\n6\n1 1 1 2 2 3\n",
"1\n3\n21 78868 80000\n",
"1\n14\n1 2 2 2 2 2 2 2 2 2 2 2 2 4\n",
"1\n3\n78788 78788 157577\n",
"1\n3\n5623 5624 10000000\n",
"1\n10\n1 7 7 7 7 9 9 9 9 9\n",
"1\n3\n5739271 5739272 20000000\n",
"1\n3\n1 65535 10000000\n",
"1\n3\n78788 78788 100000\n",
"1\n15\n3 4 7 8 9 10 11 12 13 14 15 16 32 36 39\n"
],
"output": [
"1 2 7\n-1\n1 2 3\n",
"1 2 6\n",
"1 2 3\n",
"1 2 14\n",
"1 2 3\n",
"1 2 3\n",
"1 2 10\n",
"1 2 3\n",
"1 2 3\n",
"-1\n",
"1 2 15\n"
]
} | 800 | 0 |
2 | 8 | 1421_B. Putting Bricks in the Wall | Pink Floyd are pulling a prank on Roger Waters. They know he doesn't like [walls](https://www.youtube.com/watch?v=YR5ApYxkU-U), he wants to be able to walk freely, so they are blocking him from exiting his room which can be seen as a grid.
Roger Waters has a square grid of size n× n and he wants to traverse his grid from the upper left (1,1) corner to the lower right corner (n,n). Waters can move from a square to any other square adjacent by a side, as long as he is still in the grid. Also except for the cells (1,1) and (n,n) every cell has a value 0 or 1 in it.
Before starting his traversal he will pick either a 0 or a 1 and will be able to only go to cells values in which are equal to the digit he chose. The starting and finishing cells (1,1) and (n,n) are exempt from this rule, he may go through them regardless of picked digit. Because of this the cell (1,1) takes value the letter 'S' and the cell (n,n) takes value the letter 'F'.
For example, in the first example test case, he can go from (1, 1) to (n, n) by using the zeroes on this path: (1, 1), (2, 1), (2, 2), (2, 3), (3, 3), (3, 4), (4, 4)
The rest of the band (Pink Floyd) wants Waters to not be able to do his traversal, so while he is not looking they will invert at most two cells in the grid (from 0 to 1 or vice versa). They are afraid they will not be quick enough and asked for your help in choosing the cells. Note that you cannot invert cells (1, 1) and (n, n).
We can show that there always exists a solution for the given constraints.
Also note that Waters will pick his digit of the traversal after the band has changed his grid, so he must not be able to reach (n,n) no matter what digit he picks.
Input
Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 50). Description of the test cases follows.
The first line of each test case contains one integers n (3 ≤ n ≤ 200).
The following n lines of each test case contain the binary grid, square (1, 1) being colored in 'S' and square (n, n) being colored in 'F'.
The sum of values of n doesn't exceed 200.
Output
For each test case output on the first line an integer c (0 ≤ c ≤ 2) — the number of inverted cells.
In i-th of the following c lines, print the coordinates of the i-th cell you inverted. You may not invert the same cell twice. Note that you cannot invert cells (1, 1) and (n, n).
Example
Input
3
4
S010
0001
1000
111F
3
S10
101
01F
5
S0101
00000
01111
11111
0001F
Output
1
3 4
2
1 2
2 1
0
Note
For the first test case, after inverting the cell, we get the following grid:
S010
0001
1001
111F
| {
"input": [
"3\n4\nS010\n0001\n1000\n111F\n3\nS10\n101\n01F\n5\nS0101\n00000\n01111\n11111\n0001F\n"
],
"output": [
"1\n3 4\n2\n1 2\n2 1\n0\n"
]
} | {
"input": [
"1\n3\nS01\n111\n00F\n",
"1\n5\nS0000\n00000\n00000\n00000\n0000F\n",
"1\n3\nS10\n010\n11F\n",
"1\n3\nS11\n011\n01F\n",
"1\n3\nS10\n010\n01F\n",
"1\n10\nS000000000\n0000000000\n0000000000\n0000000000\n0000001000\n0000000101\n0000000000\n0000000000\n0000000000\n000000000F\n"
],
"output": [
"2\n1 2\n2 3\n",
"2\n1 2\n2 1\n",
"2\n1 2\n2 3\n",
"1\n1 2\n",
"2\n1 2\n2 3\n",
"2\n1 2\n2 1\n"
]
} | 1,100 | 1,000 |
2 | 7 | 143_A. Help Vasilisa the Wise 2 | Vasilisa the Wise from the Kingdom of Far Far Away got a magic box with a secret as a present from her friend Hellawisa the Wise from the Kingdom of A Little Closer. However, Vasilisa the Wise does not know what the box's secret is, since she cannot open it again. She hopes that you will help her one more time with that.
The box's lock looks as follows: it contains 4 identical deepenings for gems as a 2 × 2 square, and some integer numbers are written at the lock's edge near the deepenings. The example of a lock is given on the picture below.
<image>
The box is accompanied with 9 gems. Their shapes match the deepenings' shapes and each gem contains one number from 1 to 9 (each number is written on exactly one gem). The box will only open after it is decorated with gems correctly: that is, each deepening in the lock should be filled with exactly one gem. Also, the sums of numbers in the square's rows, columns and two diagonals of the square should match the numbers written at the lock's edge. For example, the above lock will open if we fill the deepenings with gems with numbers as is shown on the picture below.
<image>
Now Vasilisa the Wise wants to define, given the numbers on the box's lock, which gems she should put in the deepenings to open the box. Help Vasilisa to solve this challenging task.
Input
The input contains numbers written on the edges of the lock of the box. The first line contains space-separated integers r1 and r2 that define the required sums of numbers in the rows of the square. The second line contains space-separated integers c1 and c2 that define the required sums of numbers in the columns of the square. The third line contains space-separated integers d1 and d2 that define the required sums of numbers on the main and on the side diagonals of the square (1 ≤ r1, r2, c1, c2, d1, d2 ≤ 20). Correspondence between the above 6 variables and places where they are written is shown on the picture below. For more clarifications please look at the second sample test that demonstrates the example given in the problem statement.
<image>
Output
Print the scheme of decorating the box with stones: two lines containing two space-separated integers from 1 to 9. The numbers should be pairwise different. If there is no solution for the given lock, then print the single number "-1" (without the quotes).
If there are several solutions, output any.
Examples
Input
3 7
4 6
5 5
Output
1 2
3 4
Input
11 10
13 8
5 16
Output
4 7
9 1
Input
1 2
3 4
5 6
Output
-1
Input
10 10
10 10
10 10
Output
-1
Note
Pay attention to the last test from the statement: it is impossible to open the box because for that Vasilisa the Wise would need 4 identical gems containing number "5". However, Vasilisa only has one gem with each number from 1 to 9. | {
"input": [
"1 2\n3 4\n5 6\n",
"11 10\n13 8\n5 16\n",
"3 7\n4 6\n5 5\n",
"10 10\n10 10\n10 10\n"
],
"output": [
"-1\n",
"4 7\n9 1\n",
"1 2\n3 4\n",
"-1\n"
]
} | {
"input": [
"3 14\n8 9\n10 7\n",
"12 11\n11 12\n16 7\n",
"12 17\n10 19\n13 16\n",
"9 12\n3 17\n10 10\n",
"10 7\n4 13\n11 6\n",
"7 9\n4 12\n5 11\n",
"2 4\n1 5\n3 3\n",
"13 8\n15 6\n11 10\n",
"8 10\n9 9\n13 5\n",
"12 7\n5 14\n8 11\n",
"9 6\n5 10\n3 12\n",
"16 5\n13 8\n10 11\n",
"14 16\n16 14\n18 12\n",
"8 12\n5 15\n11 9\n",
"3 8\n2 9\n6 5\n",
"16 10\n16 10\n12 14\n",
"5 14\n10 9\n10 9\n",
"13 6\n10 9\n6 13\n",
"11 9\n12 8\n11 9\n",
"10 8\n10 8\n4 14\n",
"13 7\n10 10\n5 15\n",
"7 8\n8 7\n12 3\n",
"12 14\n11 15\n9 17\n",
"14 8\n11 11\n13 9\n",
"10 6\n6 10\n4 12\n",
"12 12\n14 10\n16 8\n",
"5 9\n7 7\n8 6\n",
"11 11\n17 5\n12 10\n",
"3 8\n4 6\n5 5\n",
"5 13\n8 10\n11 7\n",
"10 16\n14 12\n14 12\n",
"18 10\n16 12\n12 16\n",
"14 11\n16 9\n13 12\n",
"6 5\n2 9\n5 6\n",
"12 11\n13 10\n10 13\n",
"15 11\n16 10\n9 17\n",
"14 13\n9 18\n14 13\n",
"17 16\n14 19\n18 15\n",
"12 8\n14 6\n8 12\n",
"14 11\n9 16\n16 9\n",
"11 13\n19 5\n12 12\n",
"14 17\n18 13\n15 16\n",
"8 5\n11 2\n8 5\n",
"16 14\n15 15\n17 13\n",
"7 11\n7 11\n6 12\n",
"9 14\n8 15\n8 15\n",
"13 10\n11 12\n7 16\n",
"13 7\n9 11\n14 6\n"
],
"output": [
"2 1\n6 8\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"9 4\n6 2\n",
"6 2\n3 7\n",
"3 9\n2 5\n",
"1 8\n4 2\n",
"9 7\n4 1\n",
"-1\n",
"2 6\n3 9\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"4 9\n6 1\n",
"-1\n",
"3 9\n8 6\n",
"8 6\n3 5\n",
"-1\n",
"9 3\n5 7\n",
"3 2\n4 5\n",
"9 2\n8 3\n",
"-1\n",
"3 2\n5 8\n",
"-1\n",
"-1\n",
"9 5\n7 4\n",
"-1\n",
"-1\n",
"7 8\n9 2\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"-1\n",
"9 7\n6 8\n",
"-1\n",
"-1\n",
"4 9\n7 3\n",
"8 5\n1 6\n"
]
} | 1,000 | 500 |
2 | 12 | 1466_F. Euclid's nightmare | You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare.
In his bad dream Euclid has a set S of n m-dimensional vectors over the Z_2 field and can perform vector addition on them. In other words he has vectors with m coordinates, each one equal either 0 or 1. Vector addition is defined as follows: let u+v = w, then w_i = (u_i + v_i) mod 2.
Euclid can sum any subset of S and archive another m-dimensional vector over Z_2. In particular, he can sum together an empty subset; in such a case, the resulting vector has all coordinates equal 0.
Let T be the set of all the vectors that can be written as a sum of some vectors from S. Now Euclid wonders the size of T and whether he can use only a subset S' of S to obtain all the vectors from T. As it is usually the case in such scenarios, he will not wake up until he figures this out. So far, things are looking rather grim for the philosopher. But there is hope, as he noticed that all vectors in S have at most 2 coordinates equal 1.
Help Euclid and calculate |T|, the number of m-dimensional vectors over Z_2 that can be written as a sum of some vectors from S. As it can be quite large, calculate it modulo 10^9+7. You should also find S', the smallest such subset of S, that all vectors in T can be written as a sum of vectors from S'. In case there are multiple such sets with a minimal number of elements, output the lexicographically smallest one with respect to the order in which their elements are given in the input.
Consider sets A and B such that |A| = |B|. Let a_1, a_2, ... a_{|A|} and b_1, b_2, ... b_{|B|} be increasing arrays of indices elements of A and B correspondingly. A is lexicographically smaller than B iff there exists such i that a_j = b_j for all j < i and a_i < b_i.
Input
In the first line of input, there are two integers n, m (1 ≤ n, m ≤ 5 ⋅ 10^5) denoting the number of vectors in S and the number of dimensions.
Next n lines contain the description of the vectors in S. In each of them there is an integer k (1 ≤ k ≤ 2) and then follow k distinct integers x_1, ... x_k (1 ≤ x_i ≤ m). This encodes an m-dimensional vector having 1s on coordinates x_1, ... x_k and 0s on the rest of them.
Among the n vectors, no two are the same.
Output
In the first line, output two integers: remainder modulo 10^9+7 of |T| and |S'|. In the second line, output |S'| numbers, indices of the elements of S' in ascending order. The elements of S are numbered from 1 in the order they are given in the input.
Examples
Input
3 2
1 1
1 2
2 2 1
Output
4 2
1 2
Input
2 3
2 1 3
2 1 2
Output
4 2
1 2
Input
3 5
2 1 2
1 3
1 4
Output
8 3
1 2 3
Note
In the first example we are given three vectors:
* 10
* 01
* 11
It turns out that we can represent all vectors from our 2-dimensional space using these vectors:
* 00 is a sum of the empty subset of above vectors;
* 01 = 11 + 10, is a sum of the first and third vector;
* 10 = 10, is just the first vector;
* 11 = 10 + 01, is a sum of the first and the second vector.
Hence, T = \{00, 01, 10, 11\}. We can choose any two of the three vectors from S and still be able to obtain all the vectors in T. In such a case, we choose the two vectors which appear first in the input. Since we cannot obtain all vectors in T using only a single vector from S, |S'| = 2 and S' = \{10, 01\} (indices 1 and 2), as set \{1, 2 \} is lexicographically the smallest. We can represent all vectors from T, using only vectors from S', as shown below:
* 00 is a sum of the empty subset;
* 01 = 01 is just the second vector;
* 10 = 10 is just the first vector;
* 11 = 10 + 01 is a sum of the first and the second vector. | {
"input": [
"3 2\n1 1\n1 2\n2 2 1\n",
"3 5\n2 1 2\n1 3\n1 4\n",
"2 3\n2 1 3\n2 1 2\n"
],
"output": [
"\n4 2\n1 2 \n",
"\n8 3\n1 2 3 \n",
"\n4 2\n1 2 \n"
]
} | {
"input": [
"50 5000\n2 35 46\n2 43 92\n2 16 88\n2 67 99\n2 36 93\n2 12 20\n2 33 96\n2 55 82\n2 18 32\n2 48 87\n2 29 83\n2 19 37\n2 68 100\n2 13 76\n2 73 90\n2 25 86\n2 17 61\n2 10 27\n2 70 94\n2 28 41\n2 14 53\n2 15 72\n2 8 95\n2 23 60\n2 3 98\n2 6 34\n2 44 56\n2 2 66\n2 5 91\n2 49 74\n2 38 77\n2 64 71\n2 65 89\n2 7 75\n2 30 57\n2 4 40\n2 1 97\n2 11 78\n2 39 63\n2 26 50\n2 24 81\n2 21 59\n2 51 80\n2 22 85\n2 52 79\n2 9 45\n2 47 62\n2 31 54\n2 58 69\n2 42 84\n",
"1 1\n1 1\n",
"7 8\n2 4 5\n2 1 5\n2 2 8\n2 5 8\n2 2 3\n2 2 7\n2 4 6\n",
"50 500000\n2 57 94\n2 1 10\n2 97 98\n2 15 86\n2 66 84\n2 40 100\n2 8 27\n2 14 43\n2 55 75\n2 25 90\n2 22 69\n2 9 12\n2 32 34\n2 24 48\n2 54 88\n2 13 50\n2 30 56\n2 38 77\n2 4 70\n2 39 92\n2 23 72\n2 17 36\n2 20 29\n2 6 51\n2 11 87\n2 21 68\n2 59 80\n2 52 61\n2 26 42\n2 2 37\n2 45 62\n2 28 83\n2 41 73\n2 46 71\n2 78 99\n2 49 58\n2 3 53\n2 67 95\n2 31 93\n2 5 44\n2 7 47\n2 65 79\n2 82 85\n2 89 96\n2 35 76\n2 60 64\n2 18 19\n2 63 81\n2 33 91\n2 16 74\n",
"50 50\n2 12 48\n2 36 44\n2 12 41\n2 10 36\n2 2 13\n2 34 36\n2 4 20\n2 3 12\n2 43 48\n2 6 12\n2 11 27\n2 30 47\n2 16 33\n2 15 42\n2 3 25\n2 1 31\n2 15 23\n2 12 40\n2 6 39\n2 6 20\n2 12 32\n2 9 50\n2 7 10\n2 11 12\n2 11 13\n2 23 49\n2 42 47\n2 13 22\n2 24 36\n2 21 35\n2 1 19\n2 14 44\n2 7 45\n2 10 26\n2 23 31\n2 7 18\n2 38 47\n2 34 37\n2 28 35\n2 29 40\n2 10 46\n2 10 12\n2 8 20\n2 9 36\n2 15 35\n2 5 12\n2 6 33\n2 5 42\n2 15 17\n2 23 48\n",
"48 50\n2 4 10\n2 16 26\n2 6 16\n2 16 28\n2 8 9\n2 20 22\n2 7 36\n2 24 39\n2 8 22\n2 5 35\n2 27 33\n2 15 17\n2 6 37\n2 25 40\n2 13 20\n2 19 30\n2 2 28\n2 7 26\n2 21 28\n2 17 36\n2 3 11\n2 12 27\n2 6 20\n2 23 38\n2 20 32\n2 20 34\n2 27 40\n2 10 29\n2 9 29\n2 22 27\n2 5 14\n2 20 21\n2 28 40\n2 15 39\n2 30 40\n2 9 16\n2 25 31\n2 26 36\n2 18 21\n2 26 28\n2 1 31\n2 9 39\n2 31 34\n2 11 34\n2 17 24\n2 31 32\n2 2 19\n2 13 30\n"
],
"output": [
"898961331 50\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 \n",
"2 1\n1 \n",
"128 7\n1 2 3 4 5 6 7 \n",
"898961331 50\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 \n",
"949480669 49\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 \n",
"438952513 37\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 34 35 37 39 41 44 \n"
]
} | 2,100 | 1,750 |
2 | 9 | 1513_C. Add One | You are given an integer n. You have to apply m operations to it.
In a single operation, you must replace every digit d of the number with the decimal representation of integer d + 1. For example, 1912 becomes 21023 after applying the operation once.
You have to find the length of n after applying m operations. Since the answer can be very large, print it modulo 10^9+7.
Input
The first line contains a single integer t (1 ≤ t ≤ 2 ⋅ 10^5) — the number of test cases.
The only line of each test case contains two integers n (1 ≤ n ≤ 10^9) and m (1 ≤ m ≤ 2 ⋅ 10^5) — the initial number and the number of operations.
Output
For each test case output the length of the resulting number modulo 10^9+7.
Example
Input
5
1912 1
5 6
999 1
88 2
12 100
Output
5
2
6
4
2115
Note
For the first test, 1912 becomes 21023 after 1 operation which is of length 5.
For the second test, 5 becomes 21 after 6 operations which is of length 2.
For the third test, 999 becomes 101010 after 1 operation which is of length 6.
For the fourth test, 88 becomes 1010 after 2 operations which is of length 4. | {
"input": [
"5\n1912 1\n5 6\n999 1\n88 2\n12 100\n"
],
"output": [
"\n5\n2\n6\n4\n2115\n"
]
} | {
"input": [
"5\n90 94\n26 25\n64 84\n14 6\n20 96\n"
],
"output": [
"1842\n12\n1015\n3\n1908\n"
]
} | 1,600 | 1,500 |
2 | 9 | 1540_C1. Converging Array (Easy Version) | This is the easy version of the problem. The only difference is that in this version q = 1. You can make hacks only if both versions of the problem are solved.
There is a process that takes place on arrays a and b of length n and length n-1 respectively.
The process is an infinite sequence of operations. Each operation is as follows:
* First, choose a random integer i (1 ≤ i ≤ n-1).
* Then, simultaneously set a_i = min\left(a_i, \frac{a_i+a_{i+1}-b_i}{2}\right) and a_{i+1} = max\left(a_{i+1}, \frac{a_i+a_{i+1}+b_i}{2}\right) without any rounding (so values may become non-integer).
See notes for an example of an operation.
It can be proven that array a converges, i. e. for each i there exists a limit a_i converges to. Let function F(a, b) return the value a_1 converges to after a process on a and b.
You are given array b, but not array a. However, you are given a third array c. Array a is good if it contains only integers and satisfies 0 ≤ a_i ≤ c_i for 1 ≤ i ≤ n.
Your task is to count the number of good arrays a where F(a, b) ≥ x for q values of x. Since the number of arrays can be very large, print it modulo 10^9+7.
Input
The first line contains a single integer n (2 ≤ n ≤ 100).
The second line contains n integers c_1, c_2 …, c_n (0 ≤ c_i ≤ 100).
The third line contains n-1 integers b_1, b_2, …, b_{n-1} (0 ≤ b_i ≤ 100).
The fourth line contains a single integer q (q=1).
The fifth line contains q space separated integers x_1, x_2, …, x_q (-10^5 ≤ x_i ≤ 10^5).
Output
Output q integers, where the i-th integer is the answer to the i-th query, i. e. the number of good arrays a where F(a, b) ≥ x_i modulo 10^9+7.
Example
Input
3
2 3 4
2 1
1
-1
Output
56
Note
The following explanation assumes b = [2, 1] and c=[2, 3, 4] (as in the sample).
Examples of arrays a that are not good:
* a = [3, 2, 3] is not good because a_1 > c_1;
* a = [0, -1, 3] is not good because a_2 < 0.
One possible good array a is [0, 2, 4]. We can show that no operation has any effect on this array, so F(a, b) = a_1 = 0.
Another possible good array a is [0, 1, 4]. In a single operation with i = 1, we set a_1 = min((0+1-2)/(2), 0) and a_2 = max((0+1+2)/(2), 1). So, after a single operation with i = 1, a becomes equal to [-1/2, 3/2, 4]. We can show that no operation has any effect on this array, so F(a, b) = -1/2. | {
"input": [
"3\n2 3 4\n2 1\n1\n-1\n"
],
"output": [
"56\n"
]
} | {
"input": [
"100\n95 54 23 27 51 58 94 34 29 95 53 53 8 5 64 32 17 62 14 37 26 95 27 85 94 37 85 72 88 69 43 9 60 3 48 26 81 48 89 56 34 28 2 63 26 6 13 19 99 41 70 24 92 41 9 73 52 42 34 98 16 82 7 81 28 80 18 33 90 69 19 13 51 96 8 21 86 32 96 7 5 42 52 87 24 82 14 88 4 69 7 69 4 16 55 14 27 89 32 42\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n1\n44\n",
"50\n22 43 83 63 10 95 45 4 6 73 41 86 77 90 0 79 44 9 95 40 79 81 95 39 52 36 49 25 24 17 50 46 69 92 22 20 22 48 76 36 39 27 73 37 9 95 59 49 26 32\n3 4 5 2 3 1 5 5 3 5 4 3 4 2 2 1 2 2 2 1 1 2 4 5 2 1 4 4 4 5 1 2 3 2 0 0 0 1 1 1 0 0 0 1 5 5 2 5 1\n1\n-62\n",
"20\n88 74 27 3 73 12 63 14 8 33 27 57 49 91 81 1 69 45 21 100\n1 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0\n1\n-100000\n",
"20\n12 46 89 16 75 93 35 2 43 68 24 37 83 46 82 49 49 25 4 53\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n1\n-50\n",
"30\n62 48 36 36 7 90 52 14 100 3 90 79 79 1 69 100 74 69 93 65 11 98 50 54 61 31 38 65 14 98\n3 0 3 2 1 2 2 3 0 2 3 2 0 0 1 2 3 3 0 2 0 3 1 3 1 1 0 0 2\n1\n-20\n",
"2\n7 28\n83\n1\n-46\n",
"20\n54 52 44 46 92 3 45 82 95 6 72 86 37 55 91 55 65 85 52 6\n1 1 1 1 0 0 0 1 1 0 1 1 1 1 1 1 0 0 0\n1\n24\n",
"40\n48 62 9 44 65 93 94 54 41 44 37 43 78 79 74 56 81 95 10 64 50 6 5 86 57 90 27 12 75 41 71 15 35 42 65 73 67 45 15 25\n0 3 3 3 3 4 1 1 4 2 2 4 2 2 3 4 2 3 1 2 4 4 4 4 2 1 4 3 1 3 0 4 0 4 3 4 3 0 1\n1\n-44\n",
"60\n99 63 10 93 9 69 81 82 41 3 52 49 6 72 61 95 86 44 20 83 50 52 41 20 22 94 33 79 40 31 22 89 92 69 78 82 87 98 14 55 100 62 77 83 63 70 14 65 17 69 23 73 55 76 30 70 67 26 63 68\n1 2 0 3 1 1 2 2 5 1 0 0 5 0 2 4 5 1 1 1 5 2 3 1 0 0 1 4 1 4 0 3 4 2 5 2 5 1 5 0 0 2 1 4 1 3 5 1 4 5 1 5 4 2 1 2 5 1 3\n1\n-11\n",
"20\n48 55 46 38 12 63 24 34 54 97 35 68 36 74 12 95 34 33 7 59\n3 5 2 3 3 0 0 5 2 0 5 5 5 4 4 6 3 1 6\n1\n2\n",
"10\n26 10 19 71 11 48 81 100 96 85\n3 0 5 5 0 4 4 1 0\n1\n-12\n",
"20\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100\n2 1 3 1 3 3 3 3 0 3 0 2 2 1 1 3 1 2 2\n1\n100000\n",
"20\n17 83 51 51 66 64 2 18 64 70 22 92 96 23 61 2 100 7 60 79\n4 3 0 5 6 4 9 8 8 9 4 4 1 0 5 6 4 9 5\n1\n-15\n",
"20\n42 69 54 74 18 35 55 12 43 49 20 35 71 91 23 45 70 66 57 11\n1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 0 0 0 1\n1\n-2\n",
"70\n40 75 61 51 0 1 60 90 99 23 62 45 60 56 49 36 8 86 92 36 86 8 49 2 20 82 74 71 92 24 72 14 51 75 63 53 32 51 33 33 42 53 47 91 31 35 26 63 7 32 63 49 2 11 93 41 79 67 24 39 33 54 21 8 64 44 11 78 1 84\n1 0 0 1 4 1 0 3 4 2 2 5 5 1 5 0 4 5 0 3 2 0 4 2 1 2 5 0 0 1 0 4 2 5 5 1 4 3 2 1 2 5 2 4 2 5 5 5 5 0 4 0 1 4 0 5 0 5 4 0 4 0 2 0 5 0 3 0 2\n1\n-41\n",
"40\n37 40 93 32 34 41 79 65 48 36 25 77 18 14 0 41 60 81 9 51 46 35 2 92 1 48 13 81 41 73 50 81 16 25 64 89 61 60 62 94\n3 2 2 4 4 4 4 2 0 0 2 1 1 4 4 1 3 4 4 1 1 1 1 4 1 1 2 1 4 1 2 1 0 2 3 2 4 2 4\n1\n-3\n",
"100\n45 21 34 56 15 0 46 59 40 39 78 83 29 77 19 30 60 39 90 64 11 47 10 47 35 79 30 13 21 31 26 68 0 67 52 43 29 94 100 76 16 61 74 34 62 63 4 41 78 31 77 21 90 2 43 70 53 15 53 29 47 87 33 20 23 30 55 57 13 25 19 89 10 17 92 24 47 6 4 91 52 9 11 25 81 14 82 75 46 49 66 62 28 84 88 57 0 19 34 94\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n1\n21\n",
"20\n33 94 53 35 47 78 90 32 54 98 3 65 12 12 21 55 94 5 36 83\n0 0 0 2 2 2 2 2 1 2 2 2 1 0 0 1 1 0 2\n1\n19\n",
"20\n57 42 39 79 84 90 23 96 40 18 65 1 90 67 0 27 48 32 55 86\n8 4 4 8 1 5 7 4 2 8 6 10 9 7 6 4 2 10 5\n1\n-23\n",
"100\n17 9 8 16 34 17 52 66 41 2 43 16 18 2 6 16 73 35 48 79 31 13 74 63 91 87 14 49 18 61 94 2 76 97 40 100 32 53 33 31 64 96 12 53 64 71 25 85 44 6 93 88 32 17 90 65 14 70 45 5 11 86 58 58 83 92 24 4 90 25 14 45 24 42 37 4 35 79 30 31 88 13 68 56 3 58 64 75 1 8 9 90 74 77 29 97 36 69 17 88\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n1\n1\n",
"70\n53 6 86 15 90 85 33 71 97 20 63 86 77 74 73 6 39 35 40 25 79 85 60 66 39 37 0 83 94 86 96 93 5 72 36 57 10 80 84 54 22 9 23 74 74 45 76 74 42 30 21 36 36 32 25 19 77 27 0 53 29 26 52 92 94 88 61 37 21 14\n4 1 3 4 0 2 3 0 2 0 4 3 3 5 3 5 3 3 3 0 5 4 1 1 4 2 3 1 4 2 4 2 5 0 0 5 2 0 5 2 3 5 2 4 5 0 4 5 5 5 2 5 2 1 3 4 3 0 1 5 3 0 1 1 2 3 5 3 5\n1\n-85\n",
"100\n45 4 100 7 62 78 23 54 97 21 41 14 0 20 23 85 30 94 26 23 38 15 9 48 72 54 21 52 28 11 98 47 17 77 29 10 95 31 26 24 67 27 50 91 37 52 93 58 18 33 73 40 43 51 31 96 68 85 97 10 80 49 51 70 6 8 35 44 49 72 79 62 13 97 6 69 40 70 10 22 59 71 94 53 16 47 28 51 73 69 41 51 6 59 90 24 97 12 72 8\n0 1 0 0 1 0 1 0 0 1 1 1 1 1 1 0 1 1 1 0 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 1 0 0 0 1 1 1 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0 1 0 1 1 1 0 0 1 0 1 0 1 1 1 1 0 0 1 0 1 1 0 1 1 1 1 1 0 1 1 0 0 0\n1\n5\n",
"20\n97 76 80 25 49 7 76 39 49 19 67 25 68 31 46 45 31 32 5 88\n1 1 1 0 1 1 0 1 1 0 0 1 0 1 1 0 1 1 1\n1\n36\n",
"20\n79 33 19 90 72 83 79 78 81 59 33 91 13 76 81 28 76 90 71 41\n0 1 10 1 8 2 9 8 0 4 5 5 2 2 5 0 9 9 2\n1\n-9\n",
"10\n4 56 67 26 94 57 56 67 84 76\n0 5 2 1 3 0 5 0 2\n1\n4\n",
"10\n77 16 42 68 100 38 40 99 75 67\n0 1 0 2 1 1 0 0 0\n1\n43\n",
"100\n31 4 40 53 75 6 10 72 62 52 92 37 63 19 12 52 21 63 90 78 32 7 98 68 53 60 26 68 40 62 2 47 44 40 43 12 74 76 87 61 52 40 59 86 44 17 12 17 39 77 94 22 61 43 98 15 93 51 57 12 70 3 1 17 84 96 13 7 12 12 70 84 0 51 23 58 92 62 63 64 82 87 82 10 8 20 39 25 85 17 38 63 17 73 94 28 34 21 27 2\n0 0 1 1 0 0 1 1 1 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 0 1 1 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 1 0 1 0 0 0 1 0 1 1 1 1 0 0 1 0 0 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 0 1 0 1 1 0\n1\n-11\n",
"2\n8 70\n90\n1\n-10044\n",
"15\n32 93 82 70 57 2 54 62 31 40 45 23 49 51 24\n2 1 2 1 1 2 1 2 1 0 1 0 1 0\n1\n30\n",
"20\n39 6 41 50 22 11 24 35 4 46 23 80 88 33 63 3 71 97 76 91\n5 0 0 5 0 3 4 7 3 1 2 5 6 0 2 3 0 5 1\n1\n4\n",
"20\n70 79 36 48 68 10 79 84 96 72 35 89 39 5 92 96 38 12 56 3\n2 4 3 2 4 1 2 3 1 2 5 3 3 3 2 3 5 2 0\n1\n5\n",
"10\n8 39 84 74 25 3 75 39 19 51\n1 2 2 2 2 2 1 0 0\n1\n-6\n",
"30\n45 63 41 0 9 11 50 83 33 74 62 85 42 29 17 26 4 0 33 85 16 11 46 98 87 81 70 50 0 22\n1 3 0 1 2 2 0 1 2 1 3 2 0 1 1 2 0 0 2 1 0 2 0 1 3 1 0 3 1\n1\n19\n",
"60\n29 25 14 70 34 23 42 4 23 89 57 5 0 9 75 24 54 14 61 51 66 90 19 89 5 37 25 76 91 31 16 3 42 47 8 86 52 26 96 28 83 61 22 67 79 40 92 3 87 9 13 33 62 95 1 47 43 50 82 47\n5 2 4 2 0 2 4 0 2 0 2 3 1 0 2 5 0 4 3 1 2 3 4 1 0 3 5 5 4 2 0 4 5 3 5 0 3 5 5 0 5 2 4 2 1 1 4 4 1 0 4 5 3 5 1 4 3 3 3\n1\n-65\n",
"2\n73 16\n25\n1\n9988\n",
"100\n63 7 18 73 45 1 30 16 100 61 76 95 15 3 4 15 1 46 100 34 72 36 15 67 44 65 27 46 79 91 71 0 23 80 45 37 3 12 6 61 93 19 66 73 42 24 48 55 52 18 25 67 8 18 20 72 58 17 70 35 39 8 89 53 88 76 67 93 1 53 42 33 82 26 24 10 14 7 24 81 23 48 58 71 42 17 91 89 78 93 97 20 13 79 39 31 7 9 9 97\n1 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 1 0 0 1 1 0 0 0 0 1 1 0 0 0 1 0 0 1 0 0 0 0 0 1 1 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 0 1 1 1 0 1 1 1 0 0 1 0 1 1 0 0 0 0 1 1\n1\n-18\n",
"2\n9 59\n22\n1\n9\n",
"20\n24 80 16 48 46 37 91 66 37 13 2 77 97 15 61 97 98 69 4 26\n3 3 0 4 4 4 2 1 4 0 3 0 3 0 3 1 0 4 2\n1\n8\n",
"20\n79 3 74 58 91 63 79 83 12 22 3 9 21 13 41 65 1 48 20 38\n1 0 2 2 0 2 2 3 2 1 3 2 1 0 3 1 0 0 1\n1\n17\n",
"50\n41 51 1 29 15 13 7 83 74 32 55 69 16 44 41 11 38 6 96 28 29 94 15 98 84 4 35 89 82 67 31 16 79 33 80 59 81 53 7 89 96 67 12 85 12 9 52 94 57 15\n5 4 3 2 0 3 1 3 2 3 5 1 5 4 3 5 5 0 5 0 2 1 2 3 1 5 4 2 5 1 2 2 1 2 4 3 2 4 5 2 1 0 3 4 3 5 0 4 4\n1\n-28\n",
"15\n1 90 89 8 53 49 67 44 96 10 25 22 93 77 24\n1 2 0 0 1 2 1 0 2 0 2 0 1 2\n1\n-4\n"
],
"output": [
"907807822\n",
"408830248\n",
"789889900\n",
"123629641\n",
"832833773\n",
"232\n",
"57024642\n",
"306268707\n",
"517730103\n",
"614879607\n",
"367574431\n",
"0\n",
"970766156\n",
"3235671\n",
"6060798\n",
"398097764\n",
"505914704\n",
"114801142\n",
"218316571\n",
"590810078\n",
"128076327\n",
"181290753\n",
"725187430\n",
"492539982\n",
"57117241\n",
"764609643\n",
"227004414\n",
"639\n",
"414551113\n",
"819983018\n",
"580682236\n",
"682295888\n",
"286438863\n",
"354295915\n",
"0\n",
"388832500\n",
"29\n",
"618918958\n",
"190959448\n",
"119200780\n",
"225489981\n"
]
} | 2,700 | 1,500 |
2 | 7 | 168_A. Wizards and Demonstration | Some country is populated by wizards. They want to organize a demonstration.
There are n people living in the city, x of them are the wizards who will surely go to the demonstration. Other city people (n - x people) do not support the wizards and aren't going to go to the demonstration. We know that the city administration will react only to the demonstration involving at least y percent of the city people. Having considered the matter, the wizards decided to create clone puppets which can substitute the city people on the demonstration.
So all in all, the demonstration will involve only the wizards and their puppets. The city administration cannot tell the difference between a puppet and a person, so, as they calculate the percentage, the administration will consider the city to be consisting of only n people and not containing any clone puppets.
Help the wizards and find the minimum number of clones to create to that the demonstration had no less than y percent of the city people.
Input
The first line contains three space-separated integers, n, x, y (1 ≤ n, x, y ≤ 104, x ≤ n) — the number of citizens in the city, the number of wizards and the percentage the administration needs, correspondingly.
Please note that y can exceed 100 percent, that is, the administration wants to see on a demonstration more people that actually live in the city ( > n).
Output
Print a single integer — the answer to the problem, the minimum number of clones to create, so that the demonstration involved no less than y percent of n (the real total city population).
Examples
Input
10 1 14
Output
1
Input
20 10 50
Output
0
Input
1000 352 146
Output
1108
Note
In the first sample it is necessary that at least 14% of 10 people came to the demonstration. As the number of people should be integer, then at least two people should come. There is only one wizard living in the city and he is going to come. That isn't enough, so he needs to create one clone.
In the second sample 10 people should come to the demonstration. The city has 10 wizards. They will all come to the demonstration, so nobody has to create any clones. | {
"input": [
"1000 352 146\n",
"10 1 14\n",
"20 10 50\n"
],
"output": [
"1108\n",
"1\n",
"0\n"
]
} | {
"input": [
"7879 2590 2818\n",
"78 28 27\n",
"9178 2255 7996\n",
"6571 6449 8965\n",
"6151 6148 3746\n",
"6487 5670 8\n",
"4890 1112 5\n",
"4909 2111 8860\n",
"10000 10000 10000\n",
"78 55 96\n",
"3271 5 50\n",
"1 1 10000\n",
"8484 6400 547\n",
"10000 10000 1\n",
"9678 6173 5658\n",
"8403 7401 4769\n",
"10000 1 10000\n",
"7261 5328 10\n",
"2379 1436 9663\n",
"11 9 60\n",
"71 49 65\n",
"3871 3795 7\n",
"10000 1 1\n",
"54 4 38\n",
"78 73 58\n",
"3 1 69\n",
"1 1 1\n",
"8890 5449 8734\n",
"7835 6710 1639\n",
"4470 2543 6\n",
"68 65 20\n",
"7878 4534 9159\n",
"67 1 3\n",
"70 38 66\n",
"1138 570 6666\n",
"2765 768 9020\n",
"3478 1728 9727\n",
"7754 204 9038\n",
"9620 6557 6\n"
],
"output": [
"219441\n",
"0\n",
"731618\n",
"582642\n",
"224269\n",
"0\n",
"0\n",
"432827\n",
"990000\n",
"20\n",
"1631\n",
"99\n",
"40008\n",
"0\n",
"541409\n",
"393339\n",
"999999\n",
"0\n",
"228447\n",
"0\n",
"0\n",
"0\n",
"99\n",
"17\n",
"0\n",
"2\n",
"0\n",
"771004\n",
"121706\n",
"0\n",
"0\n",
"717013\n",
"2\n",
"9\n",
"75290\n",
"248635\n",
"336578\n",
"700603\n",
"0\n"
]
} | 900 | 500 |
2 | 8 | 20_B. Equation | You are given an equation:
Ax2 + Bx + C = 0.
Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
Input
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
Output
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
Examples
Input
1 -5 6
Output
2
2.0000000000
3.0000000000 | {
"input": [
"1 -5 6\n"
],
"output": [
"2\n2.000000\n3.000000\n"
]
} | {
"input": [
"0 -2 0\n",
"1223 -23532 1232\n",
"0 1 0\n",
"-1 10 20\n",
"0 3431 43123\n",
"-50000 100000 -50000\n",
"1 1 0\n",
"50000 100000 50000\n",
"0 -2 1\n",
"0 -4 -4\n",
"1 1 1\n",
"1 -100000 0\n",
"-2 -5 0\n",
"0 1 -1\n",
"1 0 0\n",
"-2 -4 0\n",
"-2 0 0\n",
"-1 -2 -1\n",
"1 100000 -100000\n",
"1 -2 1\n",
"0 0 1\n",
"0 0 -100000\n",
"5 0 5\n",
"1000 -5000 6000\n",
"0 0 0\n",
"0 -100000 0\n",
"0 10000 -100000\n",
"1 2 1\n",
"100 200 100\n",
"1 0 1\n"
],
"output": [
"1\n0.000000",
"2\n0.052497\n19.188713\n",
"1\n-0.000000",
"2\n-1.708204\n11.708204\n",
"1\n-12.568639",
"1\n1.000000",
"2\n-1.000000\n0.000000\n",
"1\n-1.000000",
"1\n0.500000",
"1\n-1.000000",
"0\n",
"2\n0.000000\n100000.000000\n",
"2\n-2.500000\n-0.000000\n",
"1\n1.000000",
"1\n0.000000",
"2\n-2.000000\n-0.000000\n",
"1\n-0.000000",
"1\n-1.000000",
"2\n-100000.999990\n0.999990\n",
"1\n1.000000",
"0\n",
"0\n",
"0\n",
"2\n2.000000\n3.000000\n",
"-1\n",
"1\n0.000000",
"1\n10.000000",
"1\n-1.000000",
"1\n-1.000000",
"0\n"
]
} | 2,000 | 1,000 |
2 | 8 | 260_B. Ancient Prophesy | A recently found Ancient Prophesy is believed to contain the exact Apocalypse date. The prophesy is a string that only consists of digits and characters "-".
We'll say that some date is mentioned in the Prophesy if there is a substring in the Prophesy that is the date's record in the format "dd-mm-yyyy". We'll say that the number of the date's occurrences is the number of such substrings in the Prophesy. For example, the Prophesy "0012-10-2012-10-2012" mentions date 12-10-2012 twice (first time as "0012-10-2012-10-2012", second time as "0012-10-2012-10-2012").
The date of the Apocalypse is such correct date that the number of times it is mentioned in the Prophesy is strictly larger than that of any other correct date.
A date is correct if the year lies in the range from 2013 to 2015, the month is from 1 to 12, and the number of the day is strictly more than a zero and doesn't exceed the number of days in the current month. Note that a date is written in the format "dd-mm-yyyy", that means that leading zeroes may be added to the numbers of the months or days if needed. In other words, date "1-1-2013" isn't recorded in the format "dd-mm-yyyy", and date "01-01-2013" is recorded in it.
Notice, that any year between 2013 and 2015 is not a leap year.
Input
The first line contains the Prophesy: a non-empty string that only consists of digits and characters "-". The length of the Prophesy doesn't exceed 105 characters.
Output
In a single line print the date of the Apocalypse. It is guaranteed that such date exists and is unique.
Examples
Input
777-444---21-12-2013-12-2013-12-2013---444-777
Output
13-12-2013 | {
"input": [
"777-444---21-12-2013-12-2013-12-2013---444-777\n"
],
"output": [
"13-12-2013\n"
]
} | {
"input": [
"12-12-201312-12-201312-12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-201313--12-2013\n",
"01--01--2013-12-2013-01--01--2013\n",
"01-04-201425-08-201386-04-201525-10-2014878-04-20102-06-201501-04-2014-08-20159533-45-00-1212\n",
"00-12-2014-00-12-2014-00-12-2014-12-12-2014\n",
"23-11-201413-07-201412-06-2015124-03-20140-19-201323-11-201424-03-2014537523-11-20143575015-10-2014\n",
"32-13-2100-32-13-2100-32-13-2100-12-12-2013\n",
"14-08-201314-08-201314-08-201381-16-20172406414-08-201314-08-201314-08-20134237014-08-201314-08-2013\n",
"14-01-201402-04-201514-01-201485-26-1443948-14-278314-01-2014615259-09-178413-06-201314-05-2014\n",
"30-12-201429-15-208830-12-2014\n",
"29-02-2014--29-02-2014--28-02-2014\n",
"15-04-201413-08-201589-09-201013-08-20130-74-28-201620-8497-14-1063713-08-2013813-02-201513-08-2013\n",
"29-02-201329-02-201321-12-2013\n",
"19-07-201419-07-201424-06-201719-07-201419-07-201413-10-201419-07-201468-01-201619-07-20142\n",
"01-2-02013---01-2-02013----13-02-2014\n",
"15-11-201413-02-20147-86-25-298813-02-201413-02-201434615-11-201415-11-201415-11-201415-11-2014\n",
"13-05-201412-11-2013-12-11-201314-12-201329-05-201306-24-188814-07-201312-11-201312-04-2010\n",
"20-12-2012----20-12-2012-----01-01-2013\n",
"120110201311-10-20151201102013\n",
"29-02-2013-02-2013-29-02-2013\n",
"01-01-2014\n",
"21-12-201221-12-201221-12-201221-12-201213-12-2013\n",
"11111111111111111111---21-12-2013\n",
"10-10-2023-10-10-2023-10-10-2013\n",
"31-08-2013---31-08-2013---03-03-2013\n",
"31-12-201331-11-201331-11-2013\n",
"15-1--201315-1--201301-01-2013\n"
],
"output": [
"12-12-2013\n",
"13-12-2013\n",
"01-04-2014\n",
"12-12-2014\n",
"23-11-2014\n",
"12-12-2013\n",
"14-08-2013\n",
"14-01-2014\n",
"30-12-2014\n",
"28-02-2014\n",
"13-08-2013\n",
"21-12-2013\n",
"19-07-2014\n",
"13-02-2014\n",
"15-11-2014\n",
"12-11-2013\n",
"01-01-2013\n",
"11-10-2015\n",
"13-02-2013\n",
"01-01-2014\n",
"13-12-2013\n",
"21-12-2013\n",
"10-10-2013\n",
"31-08-2013\n",
"31-12-2013\n",
"01-01-2013\n"
]
} | 1,600 | 1,000 |
2 | 8 | 284_B. Cows and Poker Game | There are n cows playing poker at a table. For the current betting phase, each player's status is either "ALLIN", "IN", or "FOLDED", and does not change throughout the phase. To increase the suspense, a player whose current status is not "FOLDED" may show his/her hand to the table. However, so as not to affect any betting decisions, he/she may only do so if all other players have a status of either "ALLIN" or "FOLDED". The player's own status may be either "ALLIN" or "IN".
Find the number of cows that can currently show their hands without affecting any betting decisions.
Input
The first line contains a single integer, n (2 ≤ n ≤ 2·105). The second line contains n characters, each either "A", "I", or "F". The i-th character is "A" if the i-th player's status is "ALLIN", "I" if the i-th player's status is "IN", or "F" if the i-th player's status is "FOLDED".
Output
The first line should contain a single integer denoting the number of players that can currently show their hands.
Examples
Input
6
AFFAAA
Output
4
Input
3
AFI
Output
1
Note
In the first sample, cows 1, 4, 5, and 6 can show their hands. In the second sample, only cow 3 can show her hand. | {
"input": [
"3\nAFI\n",
"6\nAFFAAA\n"
],
"output": [
"1",
"4"
]
} | {
"input": [
"2\nFF\n",
"5\nIIIIF\n",
"5\nFAFFF\n",
"2\nFA\n",
"3\nAAA\n",
"5\nFAIAF\n",
"5\nAIFFF\n",
"3\nFFF\n",
"3\nFIF\n",
"3\nIII\n",
"5\nFAAII\n",
"2\nIF\n",
"8\nAFFFFIAF\n",
"5\nIIIII\n",
"3\nIAA\n",
"10\nAAAAAAAAAA\n",
"3\nIIF\n",
"8\nIAAIFFFI\n",
"3\nAFF\n",
"3\nIIA\n",
"5\nAFAFA\n",
"5\nAAAAI\n",
"5\nAIAIF\n",
"100\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n"
],
"output": [
"0",
"0",
"1",
"1",
"3",
"1",
"1",
"0",
"1",
"0",
"0",
"1",
"1",
"0",
"1",
"10",
"0",
"0",
"1",
"0",
"3",
"1",
"0",
"100"
]
} | 1,000 | 1,000 |
2 | 7 | 379_A. New Year Candles | Vasily the Programmer loves romance, so this year he decided to illuminate his room with candles.
Vasily has a candles.When Vasily lights up a new candle, it first burns for an hour and then it goes out. Vasily is smart, so he can make b went out candles into a new candle. As a result, this new candle can be used like any other new candle.
Now Vasily wonders: for how many hours can his candles light up the room if he acts optimally well? Help him find this number.
Input
The single line contains two integers, a and b (1 ≤ a ≤ 1000; 2 ≤ b ≤ 1000).
Output
Print a single integer — the number of hours Vasily can light up the room for.
Examples
Input
4 2
Output
7
Input
6 3
Output
8
Note
Consider the first sample. For the first four hours Vasily lights up new candles, then he uses four burned out candles to make two new ones and lights them up. When these candles go out (stop burning), Vasily can make another candle. Overall, Vasily can light up the room for 7 hours. | {
"input": [
"4 2\n",
"6 3\n"
],
"output": [
"7\n",
"8\n"
]
} | {
"input": [
"5 3\n",
"1000 3\n",
"777 17\n",
"4 3\n",
"2 2\n",
"100 4\n",
"10 4\n",
"999 2\n",
"6 4\n",
"1 2\n",
"17 3\n",
"1 4\n",
"26 8\n",
"91 5\n",
"1 3\n",
"1000 2\n",
"20 3\n",
"9 4\n",
"123 5\n",
"1000 1000\n",
"3 2\n",
"3 3\n",
"80 970\n",
"1000 4\n",
"1 1000\n"
],
"output": [
"7\n",
"1499\n",
"825\n",
"5\n",
"3\n",
"133\n",
"13\n",
"1997\n",
"7\n",
"1\n",
"25\n",
"1\n",
"29\n",
"113\n",
"1\n",
"1999\n",
"29\n",
"11\n",
"153\n",
"1001\n",
"5\n",
"4\n",
"80\n",
"1333\n",
"1\n"
]
} | 1,000 | 500 |
2 | 14 | 39_H. Multiplication Table | Petya studies positional notations. He has already learned to add and subtract numbers in the systems of notations with different radices and has moved on to a more complicated action — multiplication. To multiply large numbers one has to learn the multiplication table. Unfortunately, in the second grade students learn only the multiplication table of decimals (and some students even learn it in the first grade). Help Petya make a multiplication table for numbers in the system of notations with the radix k.
Input
The first line contains a single integer k (2 ≤ k ≤ 10) — the radix of the system.
Output
Output the multiplication table for the system of notations with the radix k. The table must contain k - 1 rows and k - 1 columns. The element on the crossing of the i-th row and the j-th column is equal to the product of i and j in the system of notations with the radix k. Each line may have any number of spaces between the numbers (the extra spaces in the samples are put for clarity).
Examples
Input
10
Output
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81
Input
3
Output
1 2
2 11 | {
"input": [
"10\n",
"3\n"
],
"output": [
"1 2 3 4 5 6 7 8 9 \n2 4 6 8 10 12 14 16 18 \n3 6 9 12 15 18 21 24 27 \n4 8 12 16 20 24 28 32 36 \n5 10 15 20 25 30 35 40 45 \n6 12 18 24 30 36 42 48 54 \n7 14 21 28 35 42 49 56 63 \n8 16 24 32 40 48 56 64 72 \n9 18 27 36 45 54 63 72 81 \n",
"1 2 \n2 11 \n"
]
} | {
"input": [
"9\n",
"8\n",
"6\n",
"4\n",
"7\n",
"5\n",
"2\n"
],
"output": [
"1 2 3 4 5 6 7 8 \n2 4 6 8 11 13 15 17 \n3 6 10 13 16 20 23 26 \n4 8 13 17 22 26 31 35 \n5 11 16 22 27 33 38 44 \n6 13 20 26 33 40 46 53 \n7 15 23 31 38 46 54 62 \n8 17 26 35 44 53 62 71 \n",
"1 2 3 4 5 6 7 \n2 4 6 10 12 14 16 \n3 6 11 14 17 22 25 \n4 10 14 20 24 30 34 \n5 12 17 24 31 36 43 \n6 14 22 30 36 44 52 \n7 16 25 34 43 52 61 \n",
"1 2 3 4 5 \n2 4 10 12 14 \n3 10 13 20 23 \n4 12 20 24 32 \n5 14 23 32 41 \n",
"1 2 3 \n2 10 12 \n3 12 21 \n",
"1 2 3 4 5 6 \n2 4 6 11 13 15 \n3 6 12 15 21 24 \n4 11 15 22 26 33 \n5 13 21 26 34 42 \n6 15 24 33 42 51 \n",
"1 2 3 4 \n2 4 11 13 \n3 11 14 22 \n4 13 22 31 \n",
"1 \n"
]
} | 1,300 | 0 |
2 | 8 | 44_B. Cola | To celebrate the opening of the Winter Computer School the organizers decided to buy in n liters of cola. However, an unexpected difficulty occurred in the shop: it turned out that cola is sold in bottles 0.5, 1 and 2 liters in volume. At that, there are exactly a bottles 0.5 in volume, b one-liter bottles and c of two-liter ones. The organizers have enough money to buy any amount of cola. What did cause the heated arguments was how many bottles of every kind to buy, as this question is pivotal for the distribution of cola among the participants (and organizers as well).
Thus, while the organizers are having the argument, discussing different variants of buying cola, the Winter School can't start. Your task is to count the number of all the possible ways to buy exactly n liters of cola and persuade the organizers that this number is too large, and if they keep on arguing, then the Winter Computer School will have to be organized in summer.
All the bottles of cola are considered indistinguishable, i.e. two variants of buying are different from each other only if they differ in the number of bottles of at least one kind.
Input
The first line contains four integers — n, a, b, c (1 ≤ n ≤ 10000, 0 ≤ a, b, c ≤ 5000).
Output
Print the unique number — the solution to the problem. If it is impossible to buy exactly n liters of cola, print 0.
Examples
Input
10 5 5 5
Output
9
Input
3 0 0 2
Output
0 | {
"input": [
"10 5 5 5\n",
"3 0 0 2\n"
],
"output": [
"9\n",
"0\n"
]
} | {
"input": [
"10 20 10 5\n",
"20 1 2 3\n",
"7 2 2 2\n",
"25 10 5 10\n",
"999 999 899 299\n",
"10000 5000 0 5000\n",
"2 2 2 2\n",
"1 0 2 0\n",
"3 3 2 1\n",
"1 1 0 0\n",
"1 0 0 1\n",
"20 10 20 30\n",
"505 142 321 12\n",
"101 10 10 50\n",
"10 19 15 100\n",
"10000 5000 5000 0\n",
"1234 645 876 1000\n",
"3 10 10 10\n",
"1 0 1 0\n",
"7 3 0 5\n",
"101 10 0 50\n",
"1 0 0 0\n",
"10 0 8 10\n",
"1 2 0 0\n",
"5 2 1 1\n",
"8765 2432 2789 4993\n",
"8987 4000 2534 4534\n",
"10000 5000 5000 5000\n",
"10000 5000 2500 2500\n",
"10000 0 5000 5000\n",
"10000 4999 2500 2500\n",
"5 5000 5000 5000\n",
"10000 4534 2345 4231\n",
"5643 1524 1423 2111\n",
"7777 4444 3333 2222\n",
"2500 5000 5000 5000\n",
"10000 2500 2500 2500\n",
"5000 5000 5000 5000\n"
],
"output": [
"36\n",
"0\n",
"1\n",
"12\n",
"145000\n",
"1251\n",
"3\n",
"1\n",
"3\n",
"0\n",
"0\n",
"57\n",
"0\n",
"33\n",
"35\n",
"0\n",
"141636\n",
"6\n",
"1\n",
"1\n",
"3\n",
"0\n",
"5\n",
"1\n",
"0\n",
"1697715\n",
"2536267\n",
"6253751\n",
"1\n",
"2501\n",
"0\n",
"12\n",
"2069003\n",
"146687\n",
"1236544\n",
"1565001\n",
"0\n",
"4691251\n"
]
} | 1,500 | 0 |
2 | 8 | 519_B. A and B and Compilation Errors | A and B are preparing themselves for programming contests.
B loves to debug his code. But before he runs the solution and starts debugging, he has to first compile the code.
Initially, the compiler displayed n compilation errors, each of them is represented as a positive integer. After some effort, B managed to fix some mistake and then another one mistake.
However, despite the fact that B is sure that he corrected the two errors, he can not understand exactly what compilation errors disappeared — the compiler of the language which B uses shows errors in the new order every time! B is sure that unlike many other programming languages, compilation errors for his programming language do not depend on each other, that is, if you correct one error, the set of other error does not change.
Can you help B find out exactly what two errors he corrected?
Input
The first line of the input contains integer n (3 ≤ n ≤ 105) — the initial number of compilation errors.
The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the errors the compiler displayed for the first time.
The third line contains n - 1 space-separated integers b1, b2, ..., bn - 1 — the errors displayed at the second compilation. It is guaranteed that the sequence in the third line contains all numbers of the second string except for exactly one.
The fourth line contains n - 2 space-separated integers с1, с2, ..., сn - 2 — the errors displayed at the third compilation. It is guaranteed that the sequence in the fourth line contains all numbers of the third line except for exactly one.
Output
Print two numbers on a single line: the numbers of the compilation errors that disappeared after B made the first and the second correction, respectively.
Examples
Input
5
1 5 8 123 7
123 7 5 1
5 1 7
Output
8
123
Input
6
1 4 3 3 5 7
3 7 5 4 3
4 3 7 5
Output
1
3
Note
In the first test sample B first corrects the error number 8, then the error number 123.
In the second test sample B first corrects the error number 1, then the error number 3. Note that if there are multiple errors with the same number, B can correct only one of them in one step. | {
"input": [
"6\n1 4 3 3 5 7\n3 7 5 4 3\n4 3 7 5\n",
"5\n1 5 8 123 7\n123 7 5 1\n5 1 7\n"
],
"output": [
"1\n3\n",
"8\n123\n"
]
} | {
"input": [
"3\n1 2 3\n3 2\n2\n",
"3\n84 30 9\n9 84\n9\n",
"4\n1 5 7 8\n1 5 7\n1 5\n",
"3\n796067435 964699482 819602309\n964699482 796067435\n964699482\n",
"10\n460626451 802090732 277246428 661369649 388684428 784303821 376287098 656422756 9301599 25720377\n277246428 388684428 661369649 460626451 656422756 802090732 9301599 784303821 376287098\n376287098 802090732 388684428 9301599 656422756 784303821 460626451 277246428\n",
"6\n5 4 3 3 5 5\n3 5 5 4 3\n3 5 4 3\n",
"3\n168638990 939116221 323703261\n168638990 323703261\n168638990\n",
"3\n77 77 77\n77 77\n77\n",
"3\n374054998 726316780 902899520\n902899520 726316780\n726316780\n"
],
"output": [
"1\n3\n",
"30\n84\n",
"8\n7\n",
"819602309\n796067435\n",
"25720377\n661369649\n",
"5\n5\n",
"939116221\n323703261\n",
"77\n77\n",
"374054998\n902899520\n"
]
} | 1,100 | 1,000 |
2 | 9 | 545_C. Woodcutters | Little Susie listens to fairy tales before bed every day. Today's fairy tale was about wood cutters and the little girl immediately started imagining the choppers cutting wood. She imagined the situation that is described below.
There are n trees located along the road at points with coordinates x1, x2, ..., xn. Each tree has its height hi. Woodcutters can cut down a tree and fell it to the left or to the right. After that it occupies one of the segments [xi - hi, xi] or [xi;xi + hi]. The tree that is not cut down occupies a single point with coordinate xi. Woodcutters can fell a tree if the segment to be occupied by the fallen tree doesn't contain any occupied point. The woodcutters want to process as many trees as possible, so Susie wonders, what is the maximum number of trees to fell.
Input
The first line contains integer n (1 ≤ n ≤ 105) — the number of trees.
Next n lines contain pairs of integers xi, hi (1 ≤ xi, hi ≤ 109) — the coordinate and the height of the і-th tree.
The pairs are given in the order of ascending xi. No two trees are located at the point with the same coordinate.
Output
Print a single number — the maximum number of trees that you can cut down by the given rules.
Examples
Input
5
1 2
2 1
5 10
10 9
19 1
Output
3
Input
5
1 2
2 1
5 10
10 9
20 1
Output
4
Note
In the first sample you can fell the trees like that:
* fell the 1-st tree to the left — now it occupies segment [ - 1;1]
* fell the 2-nd tree to the right — now it occupies segment [2;3]
* leave the 3-rd tree — it occupies point 5
* leave the 4-th tree — it occupies point 10
* fell the 5-th tree to the right — now it occupies segment [19;20]
In the second sample you can also fell 4-th tree to the right, after that it will occupy segment [10;19]. | {
"input": [
"5\n1 2\n2 1\n5 10\n10 9\n20 1\n",
"5\n1 2\n2 1\n5 10\n10 9\n19 1\n"
],
"output": [
"4\n",
"3\n"
]
} | {
"input": [
"4\n10 4\n15 1\n19 3\n20 1\n",
"2\n1 999999999\n1000000000 1000000000\n",
"67\n1 1\n3 8\n4 10\n7 8\n9 2\n10 1\n11 5\n12 8\n13 4\n16 6\n18 3\n19 3\n22 5\n24 6\n27 5\n28 3\n29 3\n30 5\n32 5\n33 10\n34 7\n35 8\n36 5\n41 3\n42 2\n43 5\n46 4\n48 4\n49 9\n52 4\n53 9\n55 1\n56 4\n59 7\n68 7\n69 4\n71 9\n72 10\n74 5\n76 4\n77 9\n80 7\n81 9\n82 5\n83 5\n84 9\n85 7\n86 9\n87 4\n88 7\n89 10\n90 3\n91 5\n92 10\n93 5\n94 8\n95 4\n96 2\n97 10\n98 1\n99 3\n100 1\n101 5\n102 4\n103 8\n104 8\n105 8\n",
"10\n999999900 1000000000\n999999901 1000000000\n999999902 1000000000\n999999903 1000000000\n999999904 1000000000\n999999905 1000000000\n999999906 1000000000\n999999907 1000000000\n999999908 1000000000\n999999909 1000000000\n",
"35\n1 7\n3 11\n6 12\n7 6\n8 5\n9 11\n15 3\n16 10\n22 2\n23 3\n25 7\n27 3\n34 5\n35 10\n37 3\n39 4\n40 5\n41 1\n44 1\n47 7\n48 11\n50 6\n52 5\n57 2\n58 7\n60 4\n62 1\n67 3\n68 12\n69 8\n70 1\n71 5\n72 5\n73 6\n74 4\n",
"1\n1000000000 1000000000\n",
"2\n100000000 1000000000\n1000000000 1000000000\n",
"10\n7 12\n10 2\n12 2\n15 1\n19 2\n20 1\n53 25\n63 10\n75 12\n87 1\n",
"3\n1 1\n1000 1000\n1000000000 1000000000\n",
"40\n1 1\n2 1\n3 1\n4 1\n5 1\n6 1\n7 1\n8 1\n9 1\n10 1\n11 1\n12 1\n13 1\n14 1\n15 1\n16 1\n17 1\n18 1\n19 1\n20 1\n21 1\n22 1\n23 1\n24 1\n25 1\n26 1\n27 1\n28 1\n29 1\n30 1\n31 1\n32 1\n33 1\n34 1\n35 1\n36 1\n37 1\n38 1\n39 1\n40 1\n"
],
"output": [
"4\n",
"2\n",
"5\n",
"2\n",
"10\n",
"1\n",
"2\n",
"9\n",
"3\n",
"2\n"
]
} | 1,500 | 1,750 |
2 | 9 | 593_C. Beautiful Function | Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that there is at least one point from the set inside or on the border of each of the imagined circles.
Yesterday Ruslan tried to solve this problem for the case when the set of points is considered beautiful if it is given as (xt = f(t), yt = g(t)), where argument t takes all integer values from 0 to 50. Moreover, f(t) and g(t) should be correct functions.
Assume that w(t) and h(t) are some correct functions, and c is an integer ranging from 0 to 50. The function s(t) is correct if it's obtained by one of the following rules:
1. s(t) = abs(w(t)), where abs(x) means taking the absolute value of a number x, i.e. |x|;
2. s(t) = (w(t) + h(t));
3. s(t) = (w(t) - h(t));
4. s(t) = (w(t) * h(t)), where * means multiplication, i.e. (w(t)·h(t));
5. s(t) = c;
6. s(t) = t;
Yesterday Ruslan thought on and on, but he could not cope with the task. Now he asks you to write a program that computes the appropriate f(t) and g(t) for any set of at most 50 circles.
In each of the functions f(t) and g(t) you are allowed to use no more than 50 multiplications. The length of any function should not exceed 100·n characters. The function should not contain spaces.
Ruslan can't keep big numbers in his memory, so you should choose f(t) and g(t), such that for all integer t from 0 to 50 value of f(t) and g(t) and all the intermediate calculations won't exceed 109 by their absolute value.
Input
The first line of the input contains number n (1 ≤ n ≤ 50) — the number of circles Ruslan thinks of. Next follow n lines, each of them containing three integers xi, yi and ri (0 ≤ xi, yi ≤ 50, 2 ≤ ri ≤ 50) — the coordinates of the center and the raduis of the i-th circle.
Output
In the first line print a correct function f(t). In the second line print a correct function g(t). The set of the points (xt = f(t), yt = g(t)) (0 ≤ t ≤ 50) must satisfy the condition, that there is at least one point inside or on the border of each of the circles, Ruslan thinks of at the beginning.
Examples
Input
3
0 10 4
10 0 4
20 10 4
Output
t
abs((t-10))
Note
Correct functions:
1. 10
2. (1+2)
3. ((t-3)+(t*4))
4. abs((t-10))
5. (abs((((23-t)*(t*t))+((45+12)*(t*t))))*((5*t)+((12*t)-13)))
6. abs((t-(abs((t*31))+14))))
Incorrect functions:
1. 3+5+7 (not enough brackets, it should be ((3+5)+7) or (3+(5+7)))
2. abs(t-3) (not enough brackets, it should be abs((t-3))
3. 2+(2-3 (one bracket too many)
4. 1(t+5) (no arithmetic operation between 1 and the bracket)
5. 5000*5000 (the number exceeds the maximum)
<image> The picture shows one of the possible solutions | {
"input": [
"3\n0 10 4\n10 0 4\n20 10 4\n"
],
"output": [
"(((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(5*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(10*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n(((5*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(5*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n"
]
} | {
"input": [
"3\n9 5 8\n8 9 10\n9 5 2\n",
"50\n48 45 42\n32 45 8\n15 41 47\n32 29 38\n7 16 48\n19 9 21\n18 40 5\n39 40 7\n37 0 6\n42 15 37\n9 33 37\n40 41 33\n25 43 2\n23 21 38\n30 20 32\n28 15 5\n47 9 19\n47 22 26\n26 9 18\n24 23 24\n11 29 5\n38 44 9\n49 22 42\n1 15 32\n18 25 21\n8 48 39\n48 7 26\n3 30 26\n34 21 47\n34 14 4\n36 43 40\n49 19 12\n33 8 30\n42 35 28\n47 21 14\n36 11 27\n40 46 17\n7 12 32\n47 5 4\n9 33 43\n35 31 3\n3 48 43\n2 19 9\n29 15 36\n1 13 2\n28 28 19\n31 33 21\n9 33 18\n7 12 22\n45 14 23\n",
"3\n3 3 3\n5 9 3\n49 1 7\n",
"5\n0 0 2\n1 1 2\n3 3 2\n40 40 2\n50 50 50\n",
"3\n0 10 4\n10 0 4\n20 10 4\n",
"50\n1 1 2\n1 1 42\n0 0 46\n1 1 16\n1 0 9\n0 0 43\n1 0 39\n1 1 41\n1 1 6\n1 1 43\n0 1 25\n0 1 40\n0 0 11\n0 1 27\n1 0 5\n1 0 9\n1 1 49\n0 0 25\n0 0 32\n0 1 6\n0 1 31\n1 1 22\n0 0 47\n0 1 6\n0 0 6\n0 1 49\n1 0 44\n0 0 50\n1 0 3\n0 1 15\n1 0 37\n0 0 14\n1 1 28\n1 1 49\n1 0 9\n0 1 12\n0 0 35\n1 0 42\n1 1 28\n0 1 20\n1 1 24\n1 1 33\n0 0 38\n1 0 17\n0 1 21\n0 0 22\n1 1 37\n0 1 34\n0 1 46\n1 1 21\n",
"5\n2 0 4\n5 6 10\n7 2 8\n3 10 8\n8 2 9\n",
"49\n48 9 48\n9 38 8\n27 43 43\n19 48 2\n35 3 11\n25 3 37\n26 40 20\n30 28 46\n19 35 44\n20 28 43\n34 40 37\n12 45 47\n28 2 38\n13 32 31\n50 10 28\n12 6 19\n31 50 5\n38 22 8\n25 33 50\n32 1 42\n8 37 26\n31 27 25\n21 4 25\n3 1 47\n21 15 42\n40 21 27\n43 20 9\n9 29 21\n15 35 36\n9 30 6\n46 39 22\n41 40 47\n11 5 32\n12 47 23\n24 2 27\n15 9 24\n0 8 45\n4 11 3\n28 13 27\n12 43 30\n23 42 40\n38 24 9\n13 46 42\n20 50 41\n29 32 11\n35 21 12\n10 34 47\n24 29 3\n46 4 7\n",
"10\n7 3 5\n2 1 6\n8 6 2\n1 2 6\n2 0 9\n10 9 2\n2 6 4\n10 3 6\n4 6 3\n9 9 2\n",
"50\n7 13 2\n41 17 2\n49 32 2\n22 16 2\n11 16 2\n2 10 2\n15 2 2\n8 12 2\n1 17 2\n22 44 2\n10 1 2\n18 45 2\n11 31 2\n4 43 2\n26 14 2\n33 47 2\n3 5 2\n49 22 2\n44 3 2\n3 41 2\n0 26 2\n30 1 2\n37 6 2\n10 48 2\n11 47 2\n5 41 2\n2 46 2\n32 3 2\n37 42 2\n25 17 2\n18 32 2\n47 21 2\n46 24 2\n7 2 2\n14 2 2\n17 17 2\n13 30 2\n23 19 2\n43 40 2\n42 26 2\n20 20 2\n17 5 2\n43 38 2\n4 32 2\n48 4 2\n1 3 2\n4 41 2\n49 36 2\n7 10 2\n9 6 2\n",
"49\n36 12 10\n50 6 19\n13 31 36\n15 47 9\n23 43 11\n31 17 14\n25 28 7\n2 20 50\n42 7 4\n7 12 43\n20 33 34\n27 44 26\n19 39 21\n40 29 16\n37 1 2\n13 27 26\n2 4 47\n49 30 13\n4 14 36\n21 36 18\n42 32 22\n21 22 18\n23 35 43\n15 31 27\n17 46 8\n22 3 34\n3 50 19\n47 47 9\n18 42 20\n30 26 42\n44 32 47\n29 20 42\n35 33 20\n43 16 9\n45 24 12\n11 1 21\n32 50 9\n38 19 48\n21 31 7\n5 42 5\n23 0 21\n39 50 8\n42 21 12\n21 20 41\n43 44 23\n43 34 4\n31 2 28\n7 0 38\n28 35 46\n",
"1\n50 50 50\n",
"3\n0 0 2\n5 7 5\n20 25 10\n",
"50\n10 26 2\n20 36 2\n32 43 2\n34 6 2\n19 37 2\n20 29 2\n31 12 2\n30 9 2\n31 5 2\n23 6 2\n0 44 2\n5 36 2\n34 22 2\n6 39 2\n19 18 2\n9 50 2\n40 11 2\n32 4 2\n42 46 2\n22 45 2\n28 2 2\n34 4 2\n16 30 2\n17 47 2\n14 46 2\n32 36 2\n43 11 2\n22 34 2\n34 9 2\n2 4 2\n18 15 2\n48 38 2\n27 28 2\n24 38 2\n33 32 2\n11 7 2\n37 35 2\n50 23 2\n25 28 2\n25 50 2\n28 26 2\n20 31 2\n12 31 2\n15 2 2\n31 45 2\n14 12 2\n16 18 2\n23 30 2\n16 26 2\n30 0 2\n",
"49\n33 40 10\n30 24 11\n4 36 23\n38 50 18\n23 28 29\n9 39 21\n47 15 35\n2 41 27\n1 45 28\n39 15 24\n7 7 28\n1 34 6\n47 17 43\n20 28 12\n23 22 15\n33 41 23\n34 3 44\n39 37 25\n41 49 39\n13 14 26\n4 35 18\n17 8 45\n23 23 16\n37 48 40\n12 48 29\n16 5 6\n29 1 5\n1 18 27\n37 11 3\n46 11 44\n9 25 40\n26 1 17\n12 26 45\n3 18 19\n15 32 38\n41 8 27\n8 39 35\n42 35 13\n5 19 43\n31 47 4\n16 47 38\n12 9 23\n10 23 3\n49 43 16\n38 28 6\n3 46 38\n13 27 28\n0 26 3\n23 1 15\n",
"1\n0 0 2\n",
"50\n34 7 2\n18 14 2\n15 24 2\n2 24 2\n27 2 2\n50 45 2\n49 19 2\n7 23 2\n16 22 2\n23 25 2\n18 23 2\n11 29 2\n22 14 2\n31 15 2\n10 42 2\n8 11 2\n9 33 2\n15 0 2\n30 25 2\n12 4 2\n14 13 2\n5 16 2\n13 43 2\n1 8 2\n26 34 2\n44 13 2\n10 17 2\n40 5 2\n48 39 2\n39 23 2\n19 10 2\n22 17 2\n36 26 2\n2 34 2\n11 42 2\n14 37 2\n25 7 2\n11 35 2\n22 34 2\n22 25 2\n12 36 2\n18 6 2\n2 47 2\n47 29 2\n13 37 2\n8 46 2\n9 4 2\n11 34 2\n12 31 2\n7 16 2\n",
"49\n9 43 6\n23 35 9\n46 39 11\n34 14 12\n30 8 4\n10 32 7\n43 10 45\n30 34 27\n27 26 21\n7 31 14\n38 13 33\n34 11 46\n33 31 32\n38 31 7\n3 24 13\n38 12 41\n21 26 32\n33 0 43\n17 44 25\n11 21 27\n27 43 28\n45 8 38\n47 50 47\n49 45 8\n2 9 34\n34 32 49\n21 30 9\n13 19 38\n8 45 32\n16 47 35\n45 28 14\n3 25 43\n45 7 32\n49 35 12\n22 35 35\n14 33 42\n19 23 10\n49 4 2\n44 37 40\n27 17 15\n7 37 30\n38 50 39\n32 12 19\n3 48 9\n26 36 27\n38 18 39\n25 40 50\n45 3 2\n23 40 36\n",
"50\n47 43 2\n31 38 2\n35 21 2\n18 41 2\n24 33 2\n35 0 2\n15 41 2\n6 3 2\n23 40 2\n11 29 2\n48 46 2\n33 45 2\n28 18 2\n31 14 2\n14 4 2\n35 18 2\n50 11 2\n10 28 2\n23 9 2\n43 25 2\n34 21 2\n19 49 2\n40 37 2\n22 27 2\n7 1 2\n37 24 2\n14 26 2\n18 46 2\n40 50 2\n21 40 2\n19 26 2\n35 2 2\n19 27 2\n13 23 2\n9 50 2\n38 9 2\n44 22 2\n5 30 2\n36 7 2\n10 26 2\n21 30 2\n19 6 2\n21 13 2\n5 3 2\n9 41 2\n10 17 2\n1 11 2\n5 6 2\n40 17 2\n6 7 2\n",
"10\n1 9 2\n3 10 2\n7 7 2\n6 12 2\n14 15 2\n2 12 2\n8 0 2\n0 12 2\n4 11 2\n15 9 2\n",
"7\n13 15 5\n2 10 3\n12 12 8\n9 12 11\n10 3 10\n9 6 13\n11 10 3\n",
"50\n0 1 2\n1 0 2\n1 1 2\n1 1 2\n1 1 2\n1 1 2\n0 1 2\n0 1 2\n0 0 2\n1 0 2\n1 1 2\n1 0 2\n1 0 2\n1 0 2\n1 0 2\n0 0 2\n0 1 2\n1 0 2\n1 0 2\n0 0 2\n0 1 2\n0 1 2\n0 1 2\n0 1 2\n0 1 2\n1 0 2\n0 0 2\n1 1 2\n0 0 2\n0 1 2\n0 0 2\n1 0 2\n1 1 2\n0 0 2\n0 0 2\n1 1 2\n0 1 2\n0 1 2\n1 0 2\n0 0 2\n1 0 2\n0 1 2\n0 0 2\n1 1 2\n1 1 2\n0 1 2\n0 0 2\n0 0 2\n0 0 2\n0 0 2\n",
"49\n22 28 2\n37 8 19\n17 36 19\n50 31 10\n26 39 17\n46 37 45\n8 33 30\n29 14 19\n34 42 37\n20 35 34\n17 10 39\n6 28 16\n38 35 27\n39 4 41\n8 37 7\n39 21 4\n12 28 20\n28 27 29\n36 28 10\n41 16 22\n21 0 20\n6 15 4\n48 43 21\n19 12 18\n10 27 15\n27 44 12\n25 14 19\n43 8 43\n1 31 26\n49 11 4\n45 18 7\n16 35 48\n2 8 21\n8 0 30\n20 42 5\n39 30 2\n13 36 34\n43 50 50\n7 9 43\n17 42 10\n15 5 21\n39 25 18\n25 29 35\n12 46 15\n48 41 6\n41 13 17\n16 46 15\n38 27 39\n50 25 16\n",
"1\n1 1 32\n",
"50\n21 22 2\n4 16 2\n19 29 2\n37 7 2\n31 47 2\n38 15 2\n32 24 2\n7 18 2\n9 7 2\n36 48 2\n14 26 2\n40 12 2\n18 10 2\n29 42 2\n32 27 2\n34 3 2\n44 33 2\n19 49 2\n12 39 2\n33 10 2\n21 8 2\n44 9 2\n13 0 2\n6 16 2\n18 15 2\n50 1 2\n31 31 2\n36 43 2\n30 2 2\n7 33 2\n18 22 2\n9 7 2\n3 25 2\n17 18 2\n13 10 2\n41 41 2\n32 44 2\n17 40 2\n7 11 2\n31 50 2\n3 40 2\n17 30 2\n10 5 2\n13 30 2\n44 33 2\n6 50 2\n45 49 2\n18 9 2\n35 46 2\n8 50 2\n",
"4\n0 0 2\n50 50 2\n50 0 2\n0 50 2\n"
],
"output": [
"(((4*((1-abs((t-0)))+abs((abs((t-0))-1))))+(4*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(4*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n(((2*((1-abs((t-0)))+abs((abs((t-0))-1))))+(4*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(2*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((24*((1-abs((t-0)))+abs((abs((t-0))-1))))+(16*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(7*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(16*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(3*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(9*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(9*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(19*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(18*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(21*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(4*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(20*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(12*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(11*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(15*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(14*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(23*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(23*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(13*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(12*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(5*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(19*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(24*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(9*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(4*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(24*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(1*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(17*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(17*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(18*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(24*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(16*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(21*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(23*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(18*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(20*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(3*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(23*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(4*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(17*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(1*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(1*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(14*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(0*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(14*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(15*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(4*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(3*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(22*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((22*((1-abs((t-0)))+abs((abs((t-0))-1))))+(22*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(20*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(14*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(8*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(4*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(20*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(20*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(7*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(16*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(20*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(21*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(10*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(10*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(7*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(4*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(11*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(4*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(11*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(14*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(22*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(11*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(7*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(12*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(24*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(3*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(15*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(10*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(7*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(21*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(9*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(4*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(17*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(10*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(5*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(23*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(6*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(2*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(16*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(15*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(24*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(9*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(7*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(6*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(14*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(16*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(16*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(6*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(7*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"(((1*((1-abs((t-0)))+abs((abs((t-0))-1))))+(2*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(24*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n(((1*((1-abs((t-0)))+abs((abs((t-0))-1))))+(4*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(0*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n",
"(((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(1*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(20*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(25*((1-abs((t-4)))+abs((abs((t-4))-1)))))\n(((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(1*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(20*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(25*((1-abs((t-4)))+abs((abs((t-4))-1)))))\n",
"(((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(5*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(10*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n(((5*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(5*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(0*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(0*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(0*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(0*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(0*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(0*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(0*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(0*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(0*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(0*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(0*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(0*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(0*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(0*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(0*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(0*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(0*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(0*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(0*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(0*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(0*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(0*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(0*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(0*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(0*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(0*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(0*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(0*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(0*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(0*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(0*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(0*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(0*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(0*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(0*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(0*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(0*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(0*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(0*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(0*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(0*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(0*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(0*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(0*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(0*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(0*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(0*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(0*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(0*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(0*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(0*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(0*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(0*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(0*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(0*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(0*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(0*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(0*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(0*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(0*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(0*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(0*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(0*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(0*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(0*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(0*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(0*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(0*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(0*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(0*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(0*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(0*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(0*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(0*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(0*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(0*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(0*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(0*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(0*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(0*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(0*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(0*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(0*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(0*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(0*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(0*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(0*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(0*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(0*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(0*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(0*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(0*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"(((((1*((1-abs((t-0)))+abs((abs((t-0))-1))))+(2*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(3*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(1*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(4*((1-abs((t-4)))+abs((abs((t-4))-1)))))\n(((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(3*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(1*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(5*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(1*((1-abs((t-4)))+abs((abs((t-4))-1)))))\n",
"(((((((((((((((((((((((((((((((((((((((((((((((((24*((1-abs((t-0)))+abs((abs((t-0))-1))))+(4*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(13*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(9*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(17*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(12*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(13*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(15*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(9*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(10*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(17*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(6*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(14*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(6*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(25*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(6*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(15*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(19*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(12*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(16*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(4*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(15*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(10*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(1*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(10*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(20*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(21*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(4*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(7*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(4*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(23*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(20*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(5*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(6*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(12*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(7*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(0*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(2*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(14*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(6*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(11*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(19*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(6*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(10*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(14*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(17*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(5*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(12*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(23*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n(((((((((((((((((((((((((((((((((((((((((((((((((4*((1-abs((t-0)))+abs((abs((t-0))-1))))+(19*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(21*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(24*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(1*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(1*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(20*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(14*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(17*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(14*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(20*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(22*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(1*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(16*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(5*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(3*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(25*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(11*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(16*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(0*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(18*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(13*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(2*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(7*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(10*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(10*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(14*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(17*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(15*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(19*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(20*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(2*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(23*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(1*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(4*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(4*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(5*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(6*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(21*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(21*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(12*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(23*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(25*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(16*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(10*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(17*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(14*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(2*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n",
"((((((((((3*((1-abs((t-0)))+abs((abs((t-0))-1))))+(1*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(4*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(0*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(1*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(5*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(1*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(5*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(2*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(4*((1-abs((t-9)))+abs((abs((t-9))-1)))))\n((((((((((1*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(3*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(1*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(0*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(4*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(3*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(1*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(3*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(4*((1-abs((t-9)))+abs((abs((t-9))-1)))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((3*((1-abs((t-0)))+abs((abs((t-0))-1))))+(20*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(24*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(11*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(5*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(1*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(7*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(4*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(11*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(5*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(9*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(5*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(2*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(13*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(16*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(1*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(24*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(22*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(1*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(0*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(15*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(18*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(5*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(5*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(2*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(1*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(16*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(18*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(12*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(9*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(23*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(23*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(3*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(7*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(8*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(6*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(11*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(21*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(21*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(10*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(8*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(21*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(2*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(24*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(0*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(2*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(24*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(3*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(4*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((6*((1-abs((t-0)))+abs((abs((t-0))-1))))+(8*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(16*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(8*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(8*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(5*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(1*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(6*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(8*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(22*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(0*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(22*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(15*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(21*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(7*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(23*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(2*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(11*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(1*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(20*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(13*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(0*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(3*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(24*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(23*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(20*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(23*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(1*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(21*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(8*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(16*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(10*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(12*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(1*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(1*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(8*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(15*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(9*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(20*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(13*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(10*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(2*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(19*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(16*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(2*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(1*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(20*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(18*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(5*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(3*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"(((((((((((((((((((((((((((((((((((((((((((((((((18*((1-abs((t-0)))+abs((abs((t-0))-1))))+(25*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(6*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(7*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(11*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(15*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(12*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(1*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(21*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(3*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(10*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(13*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(9*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(20*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(18*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(6*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(1*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(24*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(2*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(10*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(21*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(10*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(11*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(7*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(8*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(11*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(1*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(23*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(9*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(15*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(22*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(14*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(17*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(21*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(22*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(5*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(16*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(19*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(10*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(2*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(11*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(19*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(21*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(10*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(21*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(21*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(15*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(3*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(14*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n(((((((((((((((((((((((((((((((((((((((((((((((((6*((1-abs((t-0)))+abs((abs((t-0))-1))))+(3*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(15*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(23*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(21*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(8*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(14*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(10*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(3*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(6*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(16*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(22*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(19*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(14*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(0*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(13*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(2*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(15*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(7*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(18*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(16*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(11*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(17*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(15*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(23*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(1*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(25*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(23*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(21*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(13*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(16*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(10*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(16*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(8*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(12*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(0*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(25*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(9*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(15*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(21*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(0*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(25*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(10*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(10*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(22*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(17*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(1*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(0*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(17*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n",
"(25*((1-abs((t-0)))+abs((abs((t-0))-1))))\n(25*((1-abs((t-0)))+abs((abs((t-0))-1))))\n",
"(((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(2*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(10*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n(((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(3*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(12*((1-abs((t-2)))+abs((abs((t-2))-1)))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((5*((1-abs((t-0)))+abs((abs((t-0))-1))))+(10*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(16*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(17*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(9*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(10*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(15*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(15*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(15*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(11*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(0*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(2*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(17*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(3*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(9*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(4*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(20*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(16*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(21*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(11*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(14*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(17*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(8*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(8*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(7*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(16*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(21*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(11*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(17*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(1*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(9*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(24*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(13*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(12*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(16*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(5*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(18*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(25*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(12*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(12*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(14*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(10*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(6*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(7*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(15*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(7*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(8*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(11*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(8*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(15*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((13*((1-abs((t-0)))+abs((abs((t-0))-1))))+(18*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(21*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(3*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(18*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(14*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(6*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(4*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(2*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(3*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(22*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(18*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(11*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(19*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(9*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(25*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(5*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(2*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(23*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(22*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(1*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(2*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(15*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(23*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(23*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(18*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(5*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(17*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(4*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(2*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(7*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(19*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(14*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(19*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(16*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(3*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(17*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(11*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(14*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(25*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(13*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(15*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(15*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(1*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(22*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(6*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(9*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(15*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(13*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(0*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"(((((((((((((((((((((((((((((((((((((((((((((((((16*((1-abs((t-0)))+abs((abs((t-0))-1))))+(15*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(2*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(19*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(11*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(4*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(23*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(1*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(19*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(3*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(0*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(23*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(10*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(11*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(16*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(17*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(19*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(20*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(6*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(2*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(8*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(11*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(18*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(6*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(8*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(14*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(0*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(18*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(23*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(4*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(13*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(6*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(1*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(7*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(20*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(4*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(21*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(2*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(15*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(8*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(6*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(5*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(24*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(19*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(1*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(6*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(0*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(11*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n(((((((((((((((((((((((((((((((((((((((((((((((((20*((1-abs((t-0)))+abs((abs((t-0))-1))))+(12*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(18*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(25*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(14*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(19*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(7*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(20*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(22*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(7*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(3*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(17*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(8*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(14*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(11*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(20*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(1*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(18*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(24*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(7*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(17*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(4*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(11*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(24*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(24*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(2*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(0*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(9*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(5*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(5*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(12*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(0*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(13*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(9*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(16*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(4*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(19*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(17*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(9*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(23*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(23*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(4*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(11*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(21*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(14*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(23*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(13*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(13*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(0*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n",
"(0*((1-abs((t-0)))+abs((abs((t-0))-1))))\n(0*((1-abs((t-0)))+abs((abs((t-0))-1))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((17*((1-abs((t-0)))+abs((abs((t-0))-1))))+(9*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(7*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(1*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(13*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(25*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(24*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(3*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(8*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(11*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(9*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(5*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(11*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(15*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(5*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(4*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(4*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(7*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(15*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(6*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(7*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(2*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(6*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(13*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(22*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(5*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(20*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(24*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(19*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(9*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(11*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(18*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(1*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(5*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(7*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(12*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(5*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(11*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(11*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(6*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(9*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(1*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(23*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(6*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(4*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(4*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(5*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(6*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(3*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((3*((1-abs((t-0)))+abs((abs((t-0))-1))))+(7*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(12*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(12*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(1*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(22*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(9*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(11*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(11*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(12*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(11*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(14*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(7*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(7*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(21*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(5*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(16*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(0*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(12*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(2*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(6*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(8*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(21*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(4*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(17*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(6*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(8*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(2*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(19*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(11*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(5*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(8*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(13*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(17*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(21*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(18*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(3*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(17*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(17*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(12*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(18*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(3*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(23*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(14*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(18*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(23*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(2*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(17*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(15*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(8*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"(((((((((((((((((((((((((((((((((((((((((((((((((4*((1-abs((t-0)))+abs((abs((t-0))-1))))+(11*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(23*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(17*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(15*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(5*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(21*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(15*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(13*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(3*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(19*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(17*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(16*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(19*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(1*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(19*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(10*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(16*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(8*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(5*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(13*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(22*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(23*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(24*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(1*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(17*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(10*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(6*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(4*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(8*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(22*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(1*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(22*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(24*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(11*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(7*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(9*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(24*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(22*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(13*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(3*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(19*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(16*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(1*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(13*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(19*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(12*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(22*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(11*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n(((((((((((((((((((((((((((((((((((((((((((((((((21*((1-abs((t-0)))+abs((abs((t-0))-1))))+(17*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(19*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(7*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(4*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(16*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(5*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(17*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(13*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(15*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(6*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(5*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(15*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(15*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(12*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(6*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(13*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(0*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(22*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(10*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(21*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(4*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(25*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(22*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(4*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(16*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(15*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(9*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(22*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(23*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(14*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(12*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(3*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(17*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(17*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(16*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(11*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(2*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(18*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(8*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(18*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(25*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(6*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(24*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(18*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(9*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(20*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(1*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(20*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((23*((1-abs((t-0)))+abs((abs((t-0))-1))))+(15*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(17*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(9*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(12*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(17*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(7*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(3*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(11*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(5*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(24*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(16*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(14*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(15*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(7*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(17*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(25*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(5*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(11*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(21*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(17*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(9*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(20*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(11*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(3*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(18*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(7*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(9*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(20*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(10*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(9*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(17*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(9*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(6*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(4*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(19*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(22*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(2*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(18*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(5*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(10*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(9*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(10*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(2*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(4*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(5*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(0*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(2*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(20*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(3*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((21*((1-abs((t-0)))+abs((abs((t-0))-1))))+(19*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(10*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(20*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(16*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(0*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(20*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(1*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(20*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(14*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(23*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(22*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(9*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(7*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(2*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(9*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(5*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(14*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(4*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(12*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(10*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(24*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(18*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(13*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(0*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(12*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(13*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(23*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(25*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(20*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(13*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(1*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(13*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(11*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(25*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(4*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(11*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(15*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(3*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(13*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(15*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(3*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(6*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(1*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(20*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(8*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(5*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(3*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(8*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(3*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"((((((((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(1*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(3*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(3*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(7*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(1*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(4*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(0*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(2*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(7*((1-abs((t-9)))+abs((abs((t-9))-1)))))\n((((((((((4*((1-abs((t-0)))+abs((abs((t-0))-1))))+(5*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(3*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(6*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(7*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(6*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(0*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(6*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(5*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(4*((1-abs((t-9)))+abs((abs((t-9))-1)))))\n",
"(((((((6*((1-abs((t-0)))+abs((abs((t-0))-1))))+(1*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(6*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(4*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(5*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(4*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(5*((1-abs((t-6)))+abs((abs((t-6))-1)))))\n(((((((7*((1-abs((t-0)))+abs((abs((t-0))-1))))+(5*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(6*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(6*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(1*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(3*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(5*((1-abs((t-6)))+abs((abs((t-6))-1)))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(0*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(0*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(0*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(0*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(0*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(0*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(0*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(0*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(0*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(0*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(0*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(0*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(0*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(0*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(0*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(0*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(0*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(0*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(0*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(0*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(0*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(0*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(0*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(0*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(0*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(0*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(0*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(0*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(0*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(0*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(0*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(0*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(0*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(0*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(0*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(0*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(0*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(0*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(0*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(0*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(0*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(0*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(0*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(0*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(0*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(0*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(0*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(0*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(0*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(0*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(0*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(0*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(0*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(0*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(0*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(0*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(0*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(0*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(0*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(0*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(0*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(0*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(0*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(0*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(0*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(0*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(0*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(0*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(0*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(0*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(0*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(0*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(0*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(0*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(0*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(0*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(0*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(0*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(0*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(0*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(0*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(0*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(0*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(0*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(0*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(0*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(0*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(0*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(0*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(0*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(0*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(0*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(0*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(0*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(0*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"(((((((((((((((((((((((((((((((((((((((((((((((((11*((1-abs((t-0)))+abs((abs((t-0))-1))))+(18*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(8*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(25*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(13*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(23*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(4*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(14*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(17*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(10*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(8*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(3*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(19*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(19*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(4*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(19*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(6*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(14*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(18*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(20*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(10*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(3*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(24*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(9*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(5*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(13*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(12*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(21*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(0*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(24*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(22*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(8*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(1*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(4*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(10*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(19*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(6*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(21*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(3*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(8*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(7*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(19*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(12*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(6*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(24*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(20*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(8*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(19*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(25*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n(((((((((((((((((((((((((((((((((((((((((((((((((14*((1-abs((t-0)))+abs((abs((t-0))-1))))+(4*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(18*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(15*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(19*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(18*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(16*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(7*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(21*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(17*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(5*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(14*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(17*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(2*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(18*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(10*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(14*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(13*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(14*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(8*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(0*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(7*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(21*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(6*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(13*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(22*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(7*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(4*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(15*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(5*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(9*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(17*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(4*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(0*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(21*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(15*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(18*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(25*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(4*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(21*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(2*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(12*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(14*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(23*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(20*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(6*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(23*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(13*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(12*((1-abs((t-48)))+abs((abs((t-48))-1)))))\n",
"(0*((1-abs((t-0)))+abs((abs((t-0))-1))))\n(0*((1-abs((t-0)))+abs((abs((t-0))-1))))\n",
"((((((((((((((((((((((((((((((((((((((((((((((((((10*((1-abs((t-0)))+abs((abs((t-0))-1))))+(2*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(9*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(18*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(15*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(19*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(16*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(3*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(4*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(18*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(7*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(20*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(9*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(14*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(16*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(17*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(22*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(9*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(6*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(16*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(10*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(22*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(6*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(3*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(9*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(25*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(15*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(18*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(15*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(3*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(9*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(4*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(1*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(8*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(6*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(20*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(16*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(8*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(3*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(15*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(1*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(8*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(5*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(6*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(22*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(3*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(22*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(9*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(17*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(4*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n((((((((((((((((((((((((((((((((((((((((((((((((((11*((1-abs((t-0)))+abs((abs((t-0))-1))))+(8*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(14*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(3*((1-abs((t-3)))+abs((abs((t-3))-1)))))+(23*((1-abs((t-4)))+abs((abs((t-4))-1)))))+(7*((1-abs((t-5)))+abs((abs((t-5))-1)))))+(12*((1-abs((t-6)))+abs((abs((t-6))-1)))))+(9*((1-abs((t-7)))+abs((abs((t-7))-1)))))+(3*((1-abs((t-8)))+abs((abs((t-8))-1)))))+(24*((1-abs((t-9)))+abs((abs((t-9))-1)))))+(13*((1-abs((t-10)))+abs((abs((t-10))-1)))))+(6*((1-abs((t-11)))+abs((abs((t-11))-1)))))+(5*((1-abs((t-12)))+abs((abs((t-12))-1)))))+(21*((1-abs((t-13)))+abs((abs((t-13))-1)))))+(13*((1-abs((t-14)))+abs((abs((t-14))-1)))))+(1*((1-abs((t-15)))+abs((abs((t-15))-1)))))+(16*((1-abs((t-16)))+abs((abs((t-16))-1)))))+(24*((1-abs((t-17)))+abs((abs((t-17))-1)))))+(19*((1-abs((t-18)))+abs((abs((t-18))-1)))))+(5*((1-abs((t-19)))+abs((abs((t-19))-1)))))+(4*((1-abs((t-20)))+abs((abs((t-20))-1)))))+(4*((1-abs((t-21)))+abs((abs((t-21))-1)))))+(0*((1-abs((t-22)))+abs((abs((t-22))-1)))))+(8*((1-abs((t-23)))+abs((abs((t-23))-1)))))+(7*((1-abs((t-24)))+abs((abs((t-24))-1)))))+(0*((1-abs((t-25)))+abs((abs((t-25))-1)))))+(15*((1-abs((t-26)))+abs((abs((t-26))-1)))))+(21*((1-abs((t-27)))+abs((abs((t-27))-1)))))+(1*((1-abs((t-28)))+abs((abs((t-28))-1)))))+(16*((1-abs((t-29)))+abs((abs((t-29))-1)))))+(11*((1-abs((t-30)))+abs((abs((t-30))-1)))))+(3*((1-abs((t-31)))+abs((abs((t-31))-1)))))+(12*((1-abs((t-32)))+abs((abs((t-32))-1)))))+(9*((1-abs((t-33)))+abs((abs((t-33))-1)))))+(5*((1-abs((t-34)))+abs((abs((t-34))-1)))))+(20*((1-abs((t-35)))+abs((abs((t-35))-1)))))+(22*((1-abs((t-36)))+abs((abs((t-36))-1)))))+(20*((1-abs((t-37)))+abs((abs((t-37))-1)))))+(5*((1-abs((t-38)))+abs((abs((t-38))-1)))))+(25*((1-abs((t-39)))+abs((abs((t-39))-1)))))+(20*((1-abs((t-40)))+abs((abs((t-40))-1)))))+(15*((1-abs((t-41)))+abs((abs((t-41))-1)))))+(2*((1-abs((t-42)))+abs((abs((t-42))-1)))))+(15*((1-abs((t-43)))+abs((abs((t-43))-1)))))+(16*((1-abs((t-44)))+abs((abs((t-44))-1)))))+(25*((1-abs((t-45)))+abs((abs((t-45))-1)))))+(24*((1-abs((t-46)))+abs((abs((t-46))-1)))))+(4*((1-abs((t-47)))+abs((abs((t-47))-1)))))+(23*((1-abs((t-48)))+abs((abs((t-48))-1)))))+(25*((1-abs((t-49)))+abs((abs((t-49))-1)))))\n",
"((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(25*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(25*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(0*((1-abs((t-3)))+abs((abs((t-3))-1)))))\n((((0*((1-abs((t-0)))+abs((abs((t-0))-1))))+(25*((1-abs((t-1)))+abs((abs((t-1))-1)))))+(0*((1-abs((t-2)))+abs((abs((t-2))-1)))))+(25*((1-abs((t-3)))+abs((abs((t-3))-1)))))\n"
]
} | 2,200 | 3,000 |
2 | 7 | 615_A. Bulbs | Vasya wants to turn on Christmas lights consisting of m bulbs. Initially, all bulbs are turned off. There are n buttons, each of them is connected to some set of bulbs. Vasya can press any of these buttons. When the button is pressed, it turns on all the bulbs it's connected to. Can Vasya light up all the bulbs?
If Vasya presses the button such that some bulbs connected to it are already turned on, they do not change their state, i.e. remain turned on.
Input
The first line of the input contains integers n and m (1 ≤ n, m ≤ 100) — the number of buttons and the number of bulbs respectively.
Each of the next n lines contains xi (0 ≤ xi ≤ m) — the number of bulbs that are turned on by the i-th button, and then xi numbers yij (1 ≤ yij ≤ m) — the numbers of these bulbs.
Output
If it's possible to turn on all m bulbs print "YES", otherwise print "NO".
Examples
Input
3 4
2 1 4
3 1 3 1
1 2
Output
YES
Input
3 3
1 1
1 2
1 1
Output
NO
Note
In the first sample you can press each button once and turn on all the bulbs. In the 2 sample it is impossible to turn on the 3-rd lamp. | {
"input": [
"3 4\n2 1 4\n3 1 3 1\n1 2\n",
"3 3\n1 1\n1 2\n1 1\n"
],
"output": [
"YES\n",
"NO\n"
]
} | {
"input": [
"3 4\n1 1\n1 2\n1 3\n",
"1 100\n99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99\n",
"2 5\n4 3 1 4 2\n4 2 3 4 5\n",
"1 1\n0\n",
"5 6\n3 1 2 6\n3 1 2 6\n1 1\n2 3 4\n3 1 5 6\n",
"2 4\n3 2 3 4\n1 1\n",
"1 100\n100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100\n",
"1 5\n5 1 1 1 1 5\n",
"1 5\n5 4 4 1 2 3\n",
"1 10\n10 1 2 3 4 5 6 7 8 9 10\n",
"1 4\n3 2 3 4\n",
"5 1\n0\n0\n0\n0\n0\n",
"2 4\n3 1 2 3\n1 4\n",
"5 7\n2 6 7\n5 1 1 1 1 1\n3 6 5 4\n0\n4 4 3 2 1\n",
"1 3\n3 1 2 1\n",
"5 2\n1 1\n1 1\n1 1\n1 1\n1 1\n",
"100 100\n0\n0\n0\n1 53\n0\n0\n1 34\n1 54\n0\n1 14\n0\n1 33\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 82\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 34\n0\n0\n1 26\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 34\n0\n0\n0\n0\n0\n1 3\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n1 40\n0\n0\n0\n1 26\n0\n0\n0\n0\n0\n1 97\n0\n1 5\n0\n0\n0\n0\n0\n",
"1 4\n3 1 2 3\n",
"1 1\n1 1\n",
"100 100\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n0\n",
"1 5\n5 1 2 3 4 5\n"
],
"output": [
"NO\n",
"NO\n",
"YES\n",
"NO\n",
"YES\n",
"YES\n",
"YES\n",
"NO\n",
"NO\n",
"YES\n",
"NO\n",
"NO\n",
"YES\n",
"YES\n",
"NO\n",
"NO\n",
"NO\n",
"NO\n",
"YES\n",
"NO\n",
"YES\n"
]
} | 800 | 500 |
2 | 9 | 634_C. Factory Repairs | A factory produces thimbles in bulk. Typically, it can produce up to a thimbles a day. However, some of the machinery is defective, so it can currently only produce b thimbles each day. The factory intends to choose a k-day period to do maintenance and construction; it cannot produce any thimbles during this time, but will be restored to its full production of a thimbles per day after the k days are complete.
Initially, no orders are pending. The factory receives updates of the form di, ai, indicating that ai new orders have been placed for the di-th day. Each order requires a single thimble to be produced on precisely the specified day. The factory may opt to fill as many or as few of the orders in a single batch as it likes.
As orders come in, the factory owner would like to know the maximum number of orders he will be able to fill if he starts repairs on a given day pi. Help the owner answer his questions.
Input
The first line contains five integers n, k, a, b, and q (1 ≤ k ≤ n ≤ 200 000, 1 ≤ b < a ≤ 10 000, 1 ≤ q ≤ 200 000) — the number of days, the length of the repair time, the production rates of the factory, and the number of updates, respectively.
The next q lines contain the descriptions of the queries. Each query is of one of the following two forms:
* 1 di ai (1 ≤ di ≤ n, 1 ≤ ai ≤ 10 000), representing an update of ai orders on day di, or
* 2 pi (1 ≤ pi ≤ n - k + 1), representing a question: at the moment, how many orders could be filled if the factory decided to commence repairs on day pi?
It's guaranteed that the input will contain at least one query of the second type.
Output
For each query of the second type, print a line containing a single integer — the maximum number of orders that the factory can fill over all n days.
Examples
Input
5 2 2 1 8
1 1 2
1 5 3
1 2 1
2 2
1 4 2
1 3 2
2 1
2 3
Output
3
6
4
Input
5 4 10 1 6
1 1 5
1 5 5
1 3 2
1 5 2
2 1
2 2
Output
7
1
Note
Consider the first sample.
We produce up to 1 thimble a day currently and will produce up to 2 thimbles a day after repairs. Repairs take 2 days.
For the first question, we are able to fill 1 order on day 1, no orders on days 2 and 3 since we are repairing, no orders on day 4 since no thimbles have been ordered for that day, and 2 orders for day 5 since we are limited to our production capacity, for a total of 3 orders filled.
For the third question, we are able to fill 1 order on day 1, 1 order on day 2, and 2 orders on day 5, for a total of 4 orders. | {
"input": [
"5 4 10 1 6\n1 1 5\n1 5 5\n1 3 2\n1 5 2\n2 1\n2 2\n",
"5 2 2 1 8\n1 1 2\n1 5 3\n1 2 1\n2 2\n1 4 2\n1 3 2\n2 1\n2 3\n"
],
"output": [
"7\n1\n",
"3\n6\n4\n"
]
} | {
"input": [
"1 1 2 1 1\n2 1\n"
],
"output": [
"0\n"
]
} | 1,700 | 1,000 |
2 | 7 | 663_A. Rebus | You are given a rebus of form ? + ? - ? + ? = n, consisting of only question marks, separated by arithmetic operation '+' and '-', equality and positive integer n. The goal is to replace each question mark with some positive integer from 1 to n, such that equality holds.
Input
The only line of the input contains a rebus. It's guaranteed that it contains no more than 100 question marks, integer n is positive and doesn't exceed 1 000 000, all letters and integers are separated by spaces, arithmetic operations are located only between question marks.
Output
The first line of the output should contain "Possible" (without quotes) if rebus has a solution and "Impossible" (without quotes) otherwise.
If the answer exists, the second line should contain any valid rebus with question marks replaced by integers from 1 to n. Follow the format given in the samples.
Examples
Input
? + ? - ? + ? + ? = 42
Output
Possible
9 + 13 - 39 + 28 + 31 = 42
Input
? - ? = 1
Output
Impossible
Input
? = 1000000
Output
Possible
1000000 = 1000000 | {
"input": [
"? - ? = 1\n",
"? + ? - ? + ? + ? = 42\n",
"? = 1000000\n"
],
"output": [
"Impossible\n",
"Possible\n40 + 1 - 1 + 1 + 1 = 42\n",
"Possible\n1000000 = 1000000\n"
]
} | {
"input": [
"? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? = 33\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? = 999999\n",
"? - ? + ? - ? + ? + ? + ? + ? = 2\n",
"? - ? + ? + ? + ? + ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? + ? + ? + ? - ? + ? + ? + ? - ? + ? + ? - ? + ? - ? + ? - ? - ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? + ? - ? + ? + ? - ? - ? - ? - ? + ? - ? - ? + ? + ? - ? + ? + ? - ? - ? - ? + ? + ? - ? - ? + ? - ? - ? + ? - ? + ? - ? - ? - ? - ? + ? - ? + ? - ? + ? + ? + ? - ? + ? + ? - ? - ? + ? = 123456\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 19\n",
"? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? = 100\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 93\n",
"? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? - ? + ? + ? + ? + ? + ? - ? - ? + ? + ? - ? + ? - ? - ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? - ? - ? + ? + ? + ? + ? - ? + ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? = 3\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 43386\n",
"? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 57\n",
"? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? = 5\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 32\n",
"? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? = 9\n",
"? + ? - ? - ? - ? + ? + ? - ? + ? + ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? + ? - ? + ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? = 5\n",
"? - ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? - ? + ? + ? - ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? - ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? - ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? - ? + ? - ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? - ? - ? + ? - ? + ? + ? + ? + ? - ? - ? + ? + ? - ? - ? + ? = 1000000\n",
"? + ? - ? + ? + ? = 42\n",
"? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? = 15\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 37\n",
"? + ? + ? - ? + ? - ? - ? - ? - ? - ? + ? - ? + ? + ? - ? + ? - ? + ? + ? - ? + ? - ? + ? + ? + ? - ? - ? - ? + ? - ? - ? + ? - ? - ? + ? - ? + ? + ? - ? + ? - ? - ? + ? + ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? + ? - ? - ? + ? - ? - ? - ? - ? + ? + ? - ? + ? + ? - ? + ? - ? + ? - ? + ? - ? - ? - ? - ? - ? + ? - ? = 837454\n",
"? + ? + ? + ? + ? - ? = 3\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? + ? + ? - ? - ? - ? + ? - ? + ? - ? - ? - ? - ? - ? + ? - ? + ? - ? - ? - ? - ? - ? - ? + ? - ? + ? - ? + ? - ? - ? + ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? + ? - ? - ? = 4\n",
"? + ? - ? + ? + ? - ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? - ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? - ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? - ? + ? - ? - ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? + ? - ? + ? + ? - ? - ? + ? + ? = 4\n",
"? + ? + ? + ? - ? = 2\n",
"? + ? + ? + ? + ? - ? - ? = 2\n",
"? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? + ? - ? - ? - ? + ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? - ? = 31\n",
"? + ? + ? + ? + ? + ? + ? + ? - ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? - ? - ? + ? + ? - ? - ? + ? + ? + ? - ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? - ? - ? + ? + ? + ? - ? + ? + ? - ? - ? + ? - ? + ? + ? + ? = 4\n",
"? - ? + ? - ? + ? + ? - ? + ? - ? + ? + ? - ? + ? - ? - ? + ? - ? - ? + ? - ? + ? - ? - ? - ? - ? - ? + ? - ? + ? + ? + ? + ? + ? + ? + ? + ? - ? - ? + ? - ? + ? + ? - ? + ? - ? + ? - ? - ? + ? - ? - ? + ? - ? - ? - ? + ? - ? - ? + ? - ? + ? + ? - ? - ? + ? - ? - ? + ? + ? - ? + ? - ? + ? + ? + ? + ? + ? - ? - ? + ? - ? - ? - ? + ? = 254253\n",
"? + ? - ? = 1\n",
"? + ? - ? + ? + ? = 2\n"
],
"output": [
"Possible\n1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 33 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 33\n",
"Possible\n999999 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 98 - 1 - 1 = 999999\n",
"Possible\n1 - 2 + 1 - 2 + 1 + 1 + 1 + 1 = 2\n",
"Possible\n123456 - 1 + 2 + 1 + 1 + 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 + 1 - 1 + 1 + 1 + 1 - 1 + 1 + 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 - 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 + 1 + 1 + 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 + 1 + 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 + 1 + 1 - 1 + 1 + 1 - 1 - 1 - 1 + 1 + 1 - 1 - 1 + 1 - 1 - 1 + 1 - 1 + 1 - 1 - 1 - 1 - 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 - 1 + 1 + 1 - 1 - 1 + 1 = 123456\n",
"Possible\n19 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 19 - 1 - 1 - 1 - 1 - 1 - 1 + 19 - 1 - 1 - 1 - 1 - 1 - 1 + 19 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 19 - 1 - 1 - 1 - 1 + 11 - 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 = 19\n",
"Possible\n1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 100\n",
"Impossible\n",
"Impossible\n",
"Impossible\n",
"Possible\n57 - 1 + 18 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 = 57\n",
"Possible\n1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 5 = 5\n",
"Possible\n32 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 32 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 32 - 1 - 1 - 1 - 1 + 32 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 = 32\n",
"Impossible\n",
"Possible\n5 + 5 - 1 - 1 - 1 + 5 + 5 - 1 + 5 + 5 - 1 - 1 - 1 - 1 - 1 - 1 + 5 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 5 - 1 - 1 - 1 - 1 + 5 - 1 - 1 - 1 + 5 - 1 - 1 - 1 + 5 - 1 - 1 - 1 - 1 - 1 + 5 - 1 - 1 - 1 + 5 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 5 - 1 - 1 - 1 + 5 - 1 - 1 - 1 + 5 - 1 - 1 + 2 - 1 + 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 = 5\n",
"Possible\n999963 - 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 + 1 - 1 + 1 + 1 - 1 + 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 - 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 - 1 - 1 + 1 + 1 - 1 - 1 + 1 = 1000000\n",
"Possible\n40 + 1 - 1 + 1 + 1 = 42\n",
"Possible\n1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 15 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 15 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 15 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 15 + 1 + 1 - 14 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 15\n",
"Possible\n37 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 37 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 37 - 1 - 1 - 1 + 20 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 = 37\n",
"Possible\n837454 + 28 + 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 - 1 - 1 - 1 + 1 - 1 - 1 + 1 - 1 - 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 - 1 + 1 + 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 + 1 - 1 - 1 + 1 - 1 - 1 - 1 - 1 + 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 = 837454\n",
"Possible\n1 + 1 + 1 + 1 + 1 - 2 = 3\n",
"Impossible\n",
"Possible\n1 + 1 - 4 + 1 + 1 - 4 + 1 + 1 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 - 4 + 1 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 + 1 + 1 - 4 + 1 - 4 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 - 4 - 4 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 - 3 - 1 + 1 + 1 = 4\n",
"Possible\n1 + 1 + 1 + 1 - 2 = 2\n",
"Possible\n1 + 1 + 1 + 1 + 1 - 2 - 1 = 2\n",
"Impossible\n",
"Possible\n1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 - 4 - 4 + 1 + 1 - 4 - 4 + 1 + 1 + 1 - 4 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 - 4 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 4 - 4 + 1 + 1 + 1 - 4 + 1 + 1 - 4 - 4 + 1 - 4 + 1 + 1 + 1 = 4\n",
"Possible\n254253 - 1 + 2 - 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 - 1 + 1 - 1 - 1 + 1 - 1 + 1 - 1 - 1 - 1 - 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 - 1 - 1 + 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 - 1 - 1 + 1 - 1 - 1 + 1 - 1 - 1 - 1 + 1 - 1 - 1 + 1 - 1 + 1 + 1 - 1 - 1 + 1 - 1 - 1 + 1 + 1 - 1 + 1 - 1 + 1 + 1 + 1 + 1 + 1 - 1 - 1 + 1 - 1 - 1 - 1 + 1 = 254253\n",
"Possible\n1 + 1 - 1 = 1\n",
"Possible\n1 + 1 - 2 + 1 + 1 = 2\n"
]
} | 1,800 | 500 |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 62