https://www.acmicpc.net/problem/2033
using System;
class Program
{
static void Main() {
string s=Console.ReadLine();
int n=int.Parse(s);
int t=1;
int num=n;
while(n>9){
int a=n%10;
if(a>=5){
num+=(10-a)*t;
n+=10;
}
else num-=a*t;
t*=10;
n/=10;
}
Console.Write(num);
}
}