PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000290. Khôi phục số sau khi bỏ chữ số cuối (Rare Easy Problem)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Khôi phục số sau khi bỏ chữ số cuối (Rare Easy Problem)
Rare Easy Problem
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Consider a positive integer containing at least two decimal digits. Remove its last digit to obtain , then compute .
You are given only . Find every integer with at least two digits producing exactly this difference. Print these distinct integers in increasing order.
Input
One line containing an integer , the difference obtained by removing the last digit and subtracting.
Output
Print all valid integers in increasing order on one line, separated by single spaces.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
18
Output
19 20
Explanation
For , removing the last digit gives , and . For , it gives , and . These are the only two valid values, so the output is 19 20.