시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 128 MB 278 156 127 57.466%

문제

민승이는 N(1≤N≤1,000,000)명의 학생들에게 양의 정수로 된 라벨을 붙이려고 한다. 하지만 모든 학생들은 숫자 L(0≤L≤9)이 자신의 라벨 숫자에 포함되길 원치 않는다. 

문제는 학생들에게 숫자 L을 쓰지 않고 최소한 작은 N개의 양의 수 세트를 라벨링 할 때 학생들이 받는 라벨 중 가장 큰 수가 몇인지를 구하는 것이다.

입력

첫째 줄에 N과 L이 공백으로 구분되어 주어진다.

출력

첫째 줄에 민승이가 학생들에게 붙이는 라벨 중 가장 큰 수를 출력한다.

예제 입력 1

10 1

예제 출력 1

22

힌트

민승이는 가장 작은 10개의 수 2, 3, 4, 5, 6, 7, 8, 9, 20, 22를 사용하여 라벨을 붙일 수 있다.

W3sicHJvYmxlbV9pZCI6IjE2ODEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWM5MDQgXHVjMTM4XHVjNmIwXHVhZTMwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWJiZmNcdWMyYjlcdWM3NzRcdWIyOTQgTigxJmxlO04mbGU7MSwwMDAsMDAwKVx1YmE4NVx1Yzc1OCBcdWQ1NTlcdWMwZGRcdWI0ZTRcdWM1ZDBcdWFjOGMgXHVjNTkxXHVjNzU4IFx1YzgxNVx1YzIxOFx1Yjg1YyBcdWI0MWMgXHViNzdjXHViY2E4XHVjNzQ0IFx1YmQ5OVx1Yzc3NFx1YjgyNFx1YWNlMCBcdWQ1NWNcdWIyZTQuIFx1ZDU1OFx1YzljMFx1YjljYyBcdWJhYThcdWI0ZTAgXHVkNTU5XHVjMGRkXHViNGU0XHVjNzQwIFx1YzIyYlx1Yzc5MCBMKDAmbGU7TCZsZTs5KVx1Yzc3NCBcdWM3OTBcdWMyZTBcdWM3NTggXHViNzdjXHViY2E4IFx1YzIyYlx1Yzc5MFx1YzVkMCBcdWQzZWNcdWQ1NjhcdWI0MThcdWFlM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