SOLVE

LATER

Bishu and Soldiers

Problem

Editorial

Analytics

Bishu went to fight for Coding Club. There were N soldiers with various powers. There will be Q rounds to fight and in each round Bishu's power will be varied. With power M, Bishu can kill all the soldiers whose power is less than or equal to M(<=M). After each round, All the soldiers who are dead in previous round will reborn.Such that in each round there will be N soldiers to fight. As Bishu is weak in mathematics, help him to count the number of soldiers that he can kill in each round and total sum of their powers.

1<=N<=10000

1<=power of each soldier<=100

1<=Q<=10000

1<=power of bishu<=100

Explanation

In first round bhishu power is 3

So there are 3 soldiers whose power is <=3 and the sum of their power is 1+2+3=6

therefore ans= 3 6

same for the next round

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Kotlin,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic

Initializing Code Editor...

{"591c3cc": "/pagelets/problem-author-tester/algorithm/bishu-and-soldiers/", "355c588": "/pagelets/problems-hint/algorithm/bishu-and-soldiers/", "d8bbe4d": "/pagelets/recommended-problems/algorithm/bishu-and-soldiers/", "aa0fc6c": "/pagelets/show-submission/algorithm/bishu-and-soldiers/", "85b50e7": "/pagelets/suggested-problems/algorithm/bishu-and-soldiers/"}

realtime.hackerearth.com

80

19352ce5494c61a1342a7e4c4b5e1603e12ee434

58a29e5cae2309f04b28

/realtime/pusher/auth/