#PCBTAM0000028. Số nguyên có dấu và đệm 0 (Signed Zero-Padded Integer)
Số nguyên có dấu và đệm 0 (Signed Zero-Padded Integer)
Signed Zero-Padded Integer
Version: Phuoc Hung OJ Extended
Problem Statement
Given integer , output its decimal representation in a field of minimum width , under these rules:
- Always include
+for a nonnegative number or-for a negative number. - Insert padding zero digits immediately after the sign and before the absolute value.
- The total width includes the sign. Preserve all characters if the representation is already longer than .
For example, is formatted as +0000012.
Input
One line contains integer .
Output
Print the signed, zero-padded decimal representation of on one line without spaces.
Subtasks
- Subtask 1 (100 points): .
Examples
Example 1
Input
12
Output
+0000012
Explanation. 12 uses two digits, plus its sign: three characters. Add five zeros after +.
Example 2
Input
-5
Output
-0000005
Explanation. -5 uses sign and one digit; insert six zeros between them.
Example 3
Input
12345678
Output
+12345678
Explanation. +12345678 has nine characters, exceeding minimum width eight, so it is unchanged.