Problem Description

Read n tokens and integer k. Consider only tokens that are valid integers. If there are less than k valid integers, output ERROR. Else output sum of k largest valid integers.

Input Format

First line n k. Second line n tokens.

Output Format

One integer sum or ERROR.

Sample Test Case

Input:
8 3 5 x 10 -2 7 bad 9 1
Output:
26

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next