Nộp bài | Các bài nộp | Làm tốt nhất | Về danh sách bài |
KDEL - Removing digits |
English | Vietnamese |
Bom loves arithmetic very much. He is currently examining the numbers formed by writing the prime numbers successively. Accordingly, the nth number of this kind is formed by writing the first, second, ..., and up to nth prime number successively. The first few ones are:
2, 23, 235, 2357, 235711, ...
Bom denotes the nth number in the above sequence by an.
Write a program that helps Bom delete k digits from an so that the number formed by the remaining digits is maximized.
Input
A single line containing two integers n and k (1 ≤ n ≤ 50000, k ≥ 0 and k is smaller than the number of digits of an).
Output
Print in a single line the maximum number obtained by deleting exactly k digits from an.
Example
Input 5 4 Output 71
Được gửi lên bởi: | Jimmy |
Ngày: | 2008-07-04 |
Thời gian chạy: | 0.5s |
Giới hạn mã nguồn: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Ngôn ngữ cho phép: | ADA95 ASM32 BASH BF C CSHARP CPP C99 CLPS LISP sbcl LISP clisp D FORTRAN HASK ICON ICK JAVA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON RUBY SCM guile SCM qobi ST TEXT WHITESPACE |
Nguồn bài: | VNOI Marathon '08 - Round 5/DivB Problem Setter: Ngô Minh Đức |