#include #include #include #include using namespace std; int sum = 0; int get_mal(vector x) { int y = 1; for(int i=0; i get_num(int x) { vector num_array; int X = x; int keta = 1; for(int i = 1; i<99999999; i++) { x /= pow(10, i); if(x > 0) { keta++; x = X; } else { x = X; break; } } for(int i = keta; i>0; i--) { int num = x / pow(10, i-1); if(x<10) { num_array.push_back(X%10); break; } num_array.push_back(num); x -= num * pow(10, i-1); } return num_array; } int main() { int N; cin >> N; vector P; int p; for (int i=0; i> p; P.push_back(p); } int mal = get_mal(P); vector num_array = get_num(mal); for(int i=0; i 10) { vector v = get_num(sum); sum = 0; for(int i =0; i