#include #include #include #include #include #include using namespace std; typedef long long LL; typedef vector VI; #define REP(i,n) for(int i=0, i##_len=(n); i inline void amin(T &x, const T &y) { if (y inline void amax(T &x, const T &y) { if (x '9') { p = 1; S[i] -= 10; } else { p = 0; } } if (S[m] == '0') S[m] = 0; else m++; reverse(S, S+m); puts(S); } } } return 0; }