Very Simple Question- The Quadruple
All submissions for this problem are available.
After a long time of training chef goes to his master and ask him to Increase the difficulty level of Questions. Chef's master will Increase the difficulty level of Questions if and only if he will solve one more very simple question.
Description of question :
Given an array of N numbers and chef has to find the Largest sum of contiguous subarray.
Since this task is too easy ,therefore he add quadruple rule to them. Rule says master will give four numbers Q1 ,Q2 ,Q3 and Q4 ,
Any of these are not to be included in the contiguous subarray.
First line contains T i.e. the number of test cases.
Second line contains five Integers N and Q1, Q2, Q3 and Q4.
Third line contains the N space separated integers.
For each testcase output a single integer consist of Largest sum.
- 1 ≤ T ≤ 10
- 1 ≤ N, Q1, Q2 ,Q3 ,Q4 ≤ 105
- -109 ≤ Numbers in Array ≤ 109
Subtask #1 : (25 points)
Subtask #2 : (75 points)
5 5 6 7 1
1 7 -10 6 2
|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, SCALA, 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, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions