All submissions for this problem are available.
Abhi Ram to avail his revenge from Krishna Murthy wants to bring in investors into his company KMC. He plans to conduct different rounds for the investors to participate . In each round N investors invest different capitals with a certain growth rate G. He also decides a minimum limit L for each round so that only the investors whose increase in investment after first round is greater than or equal to limit(L) reach the next round. In the next round a new set of investors add up to the qualified investors. In the new round the capital of the qualified investors will be their closing investment in the previous round, while the investments of the new investors follow the intial procedure. The rounds will continue till he chooses the limit L to be -1. After the completion of all the rounds, help Abhi to find the total investment T in his company.
For each round :
The first line contains an integer N which gives the number of investors in the round.
The second line consists N space separated integers (C1...CN) which denote the investments (Ci is the investment of i-th investor).
The third line two integers L and G which denote limit and growth rate..
Output consists of a single integer T which is the total investment after all rounds. .
The rounds will be carried out till the user input L=-1.
After each round if the investment returns a float value it should be rounded to the nearest integer.
Input: 7 37 78 16 21 35 53 93 15 4 7 47 31 93 77 11 36 22 13 7 3 90 47 72 18 -1 Output: 379 734
|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