# DCP-139: Game Show Back to All Problems

Medium Divide and Conquer > Greedy

Galib is participating in a Tv game show “kam nai tai show kori” । Where as a winner of every show participate can take money as many as they want but there is a simple restriction to do so . In the end part of the show , the presenter writes a number of N digits in a board. The participant must then erase exactly M digits from the number in the board; the number formed by the remaining digits is the value of the money prize for the participant. As a very good programmer Galib is obvious going to take the highest value from it . Can you tell the highest value of prize Galib is going to take . Input: ------ The first line contains an integer T i.e. the number of Test cases. T test cases follow. Each test case has 2 lines. The first line contains N( number of digits the presenter writes in the black board ) and M (the number of digits that must be erased.).The second line contains n digits of number and the number doesn’t start with zero . Output: ------- For each test case, print a line “Case x: y” where x is replaced by the test case number and y is the highest prize Galib can win. Constraints: ------- 1<= T <= 100 2 <=N <=1000 1<= M <= N – 1 Sample Input ------------ 2 3 1 591 6 3 123123 Sample Output ------------- Case 1: 91 Case 2: 323

### Problem Limits

 Language Time Limit (seconds) C 1.00 C++ 1.00 C++14 1.00 C# 2.00 Go 2.00 Java 2.00 JavaScript 2.00 Objective-C 2.00 Perl 2.00 PHP 3.00 Python 2.00 Python3 2.00 Ruby 2.00 VB.Net 2.00

# 68/192

Solve/Submission

### Ranking

# User Language Timing
01 skmonir Cpp 0.00s
02 prodipdatta7 Cpp14 0.00s
03 Jisancse C 0.00s
04 Morass Cpp14 0.00s
05 emrul Cpp14 0.00s
06 Islam_Rafat Cpp14 0.01s
07 tariqiitju Cpp 0.01s
08 CLown1331 Cpp 0.01s
09 ehsan_sshuvo Cpp 0.01s
10 rayhan50001 Cpp 0.01s
11 robin_aust Cpp 0.01s
12 feodorv C 0.01s
13 _dipu Cpp14 0.02s
14 Robbinb1993 Cpp14 0.02s
15 Sarwar05 Cpp14 0.02s
16 seyedssz Cpp14 0.02s
17 clcrr Cpp14 0.23s
18 mamun4122 Cpp14 0.30s
19 Zeronfinity Cpp14 0.32s
20 kazinayeem Cpp14 0.33s
21 ih_hira Cpp14 0.33s
23 mahbubcseju Cpp14 0.40s
24 jayanto Cpp14 0.40s
25 showmic Cpp14 0.40s
26 Mehedimuaz Cpp14 0.41s
27 anowar1112 Cpp14 0.41s
28 underSpirit Cpp14 0.42s
29 shapnil092 Cpp14 0.43s
30 dip_BRUR Cpp14 0.44s
32 kitorp Cpp14 0.47s
33 habib_rahman Cpp14 0.47s
34 abid1 Cpp14 0.48s
35 ksohan Cpp14 0.48s
36 evan Cpp14 0.48s
37 sahedsohel Cpp14 0.48s
38 eltonrawn Cpp14 0.48s
39 partha_mbstu Cpp14 0.48s
40 Skyfall009 Cpp14 0.49s
41 Mahmudul_Tushar Cpp14 0.50s