Woburn Challenge 2017-18 Round 3 - Junior Division

Problem 1: Like, Comment, and Subscribe!

At last, your YouTube channel is really taking off in popularity! You currently have S (1 ≤ S ≤ 100) subscribers (you created an alternate account to give your channel at least 1 subscription).

To reward your dedicated viewers and encourage more subscriptions, you'd like to put out a special video when your subscriber count reaches the next "milestone" quantity larger than its current value. A milestone is a power of 10 (e.g. 10, 100, 1000, 10,000, etc.). If S is already exactly equal to a power of 10, then you're interested in the next larger one.

Your subscriber count is quickly growing, and you'd like to estimate how much time you'll have to prepare your special video. As such, you'd like to determine the number of additional subscribers required to hit the next milestone count!

Input Format

The first and only line of input consists of a single integer, S.

Output Format

Output a single integer, the number of additional subscribers required to hit the next milestone.

Sample Input 1

6

Sample Output 1

4

Sample Input 2

10

Sample Output 2

90

Sample Explanation 2

In the first case, the next milestone is 10 subscribers, which you'll hit after gaining another 4 subscribers.
In the second case, the next milestone is 100 subscribers.

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Mar 23, 2018
Author: SourSpinach

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

It's quiet in here...