## COCI '09 Contest 3 #2 Slatkisi

View as PDF

Points: 5
Time limit: 1.0s
Memory limit: 32M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Mirko buys a lot of candy in the candy shop. He cannot always pay the exact amount so the shopkeeper and he have an agreement. He tells the shopkeeper the smallest bill he has, and she rounds his amount to the nearest number he can pay. For example, if the smallest bill Mirko has is a hundred bill, and he wants to buy Kunas of candy, the shopkeeper rounds his amount to Kunas. If he wants to buy Kunas of candy, the shopkeeper rounds his amount to Kunas.

Lately, Mirko suspects the shopkeeper is trying to cheat him. He asked you to help him. Write a program that will help him.

His mother only gives Mirko Kuna bills. He never has bills that are not powers of . The bills he does have, he has in large amounts.

#### Input Specification

The first and only line of input contains two integers, , the price of candy Mirko is going to buy, and , number of zeros on the smallest bill Mirko has.

#### Output Specification

The first and only line of output should contain one integer, rounded to the nearest amount Mirko can pay.

#### Sample Input 1

184 1

#### Sample Output 1

180

#### Sample Input 2

123450995 1

#### Sample Output 2

123451000

#### Sample Input 3

182 2

#### Sample Output 3

200