1497. Faulty OdometerⅡ

单点时限: 2.0 sec

内存限制: 256 MB

You are given a car odometer which displays the miles traveled as an integer. The odometer has some defect, but it skip some numbers.

输入格式

Each test case contains two lines:

The first line contains two numbers n and m,n is a positive integer in the range 1..999999999 which represents an odometer reading,m is the number of numbers to be skip.

The second line are the m numbers to be skip.

Process to the end of file.

You may assume that no odometer reading will contain the digit to be skip and 0<=m<=8.

输出格式

Each line of input will produce exactly one line of output, which will contain: the odometer reading from the input, a colon, one blank space, and the actual number of miles traveled by the car.

样例

Input
13 1
4
13 2
2 4
1 3
2 3 4
Output
13: 12
13: 10
1: 1

6 人解决,10 人已尝试。

6 份提交通过,共有 28 份提交。

7.4 EMB 奖励。

创建: 16 年,11 月前.

修改: 6 年,9 月前.

最后提交: 1 年前.

来源: N/A

题目标签