Spiderman vs Electro
All submissions for this problem are available.
Spiderman and Electro are fighting a Death Match in a Power Plant. There are N Electric Poles in a row with each pole having a specific value of power supply Ai. Electro can absorb electricity from these N Poles The total power of electro will be the product of Electro's previously absorbed power and power absorbed from the current pole.
Spiderman can prevent Electro from absorbing power from one of the poles only by covering it with his web.
Your task is to find out the position of the pole that he should web to make Electro absorb least power.
Pillar where Spiderman should fight Electro.
First line of input contains number of test cases 'T'. Each test case contains two lines. First line contains 'N'. Second line contains 'N' space separated values.
For each test case print the position of the pole which should be webbed
- 1 ≤ T ≤ 1000
- 1 ≤ N ≤ 100
- 1 ≤ Ai ≤ 100000
Input: 3 3 1 4 5 5 5 4 1 2 3 2 1 5 Output: 3 1 2
In first test case if Spiderman chooses to web the third pole then Electro would get the minimum power i.e., 4X1=4.
|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