All submissions for this problem are available.
Randika is learning Soft wear design in University of Slip. She is playing a game as per below steps.
She has N cards There is a number in both sides of a card (when they are in table only one side is visible). Each turn She can turn any cards at a time or do nothing. Once a round completes she sums all visible numbers and record it.
From those records she will find the largest number M
Finally she will decide how many cards she need to turn or not turn. She creates an array A using those turning or not turning state of cards.
First line is N Next space seperated values of visible side of each card Final line gives space seperated values of invisible side of each card
Display all possible turns she can do. Display the value of M and A using format as per below example
29 ['No Turn', 'Turn', 'Turn', 'Turn']
M is 29 to get 29 she needs to do nothing for first card and turn all other cards to get other side
Input: 4 11 2 3 4 4 5 6 7 Output: 20 23 23 26 23 26 26 29 13 16 16 19 16 19 19 22 29 ['No Turn', 'Turn', 'Turn', 'Turn']
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions