func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( O3 )   #pragma GCC target( sse4 )   using namespace std;   const long long MAX = -1000000000000000000;   const long long MIN = 1000000000000000000;   const long long inf = 1000000000;   const long long KOK = 100000;   const long long LOG = 30;   const long long li = 500005;   const long long mod = 1000000007;   int n, m, b[li], a[li], k, flag, t, kuc[li], buy[li];   int cev;   string s;   vector<int> v;   int main(void) {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     for (int i = 0; i <= li - 5; i++) {       buy[i] = inf;       kuc[i] = inf;     }     cin >> n >> s;     int m = s.size();     if (m % n != 0) {       string ss{};       string sss{};       int at = 0;       ss +=  1 ;       for (int i = 1; i < n; i++) ss +=  0 ;       while (at < m) {         at += n;         sss += ss;       }       cout << sss << endl;       return 0;     }     int cev1 = 0;     for (int i = (int)s.size() - 1; i >= 0; i--) {       if (s[i] < s[i % n]) {         cev++;         kuc[i % n] = i;       }       if (s[i] > s[i % n]) {         buy[i % n] = i;       }       if (s[i] == s[i % n]) cev1++;     }     for (int i = 0; i < n; i++) {       if (buy[i] < kuc[i])         break;       else if (buy[i] > kuc[i]) {         string ss{};         string sss{};         for (int i = 0; i < n; i++) ss += s[i];         int at = 0;         while (at < m) {           at += n;           sss += ss;         }         cout << sss << endl;         return 0;       }     }     if (cev + cev1 == m && cev1 != m) {       string ss{};       string sss{};       for (int i = 0; i < n; i++) ss += s[i];       int at = 0;       while (at < m) {         at += n;         sss += ss;       }       cout << sss << endl;       return 0;     }     string ss{};     string sss{};     for (int i = 0; i < n - 1; i++) ss += s[i];     if (s[n - 1] -  0  + 1 >= 10) flag = 1;     ss += (s[n - 1] -  0  + 1) % 10 +  0 ;     int yer = n - 2;     while (flag == 1) {       flag = 0;       if (yer < 0) {         flag = 1;         break;       }       if (ss[yer] -  0  + 1 >= 10) flag = 1;       ss[yer] = (ss[yer] -  0  + 1) % 10 +  0 ;       yer--;     }     if (flag == 1) {       string ss{};       string sss{};       int at = 0;       ss +=  1 ;       for (int i = 1; i < n; i++) ss +=  0 ;       while (at <= (int)s.size()) {         at += n;         sss += ss;       }       cout << sss << endl;       return 0;     }     int at = 0;     while (at < m) {       at += n;       sss += ss;     }     cout << sss << endl;     return 0;     return 0;   }   