func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   int dx[] = {0, 0, -1, 1};   int dy[] = {1, -1, 0, 0};   char s[100002];   void Print(long long x) {     printf( %lld n , x);     exit(0);   }   bool ok(long long x1, long long y1, long long x2, long long y2, long long day) {     return (abs(x2 - x1) + abs(y2 - y1) <= day);   }   long long bs(long long addX, long long addY, int n, long long x1, long long y1,                long long x2, long long y2) {     long long i = 0, p = 1LL << 31;     while (p) {       if (i + p &&           !ok(x1 + addX * (i + p), y1 + addY * (i + p), x2, y2, (i + p) * n))         i += p;       p >>= 1;     }     return i;   }   int main() {     long long x1, y1, x2, y2;     int n;     scanf( %lld%lld%lld%lld%d n%s , &x1, &y1, &x2, &y2, &n, &s);     long long addX = 0, addY = 0;     for (int i = 0; i < n; ++i) {       int d;       if (s[i] ==  U )         d = 0;       else if (s[i] ==  D )         d = 1;       else if (s[i] ==  L )         d = 2;       else if (s[i] ==  R )         d = 3;       addX += dx[d];       addY += dy[d];       if (abs(x2 - x1 - addX) + abs(y2 - y1 - addY) <= (i + 1)) Print(i + 1);     }     long long cnt = bs(addX, addY, n, x1, y1, x2, y2);     if (cnt > 1) --cnt;     x1 += cnt * addX;     y1 += cnt * addY;     long long day = cnt * n;     for (int t = 0; t < 20; ++t) {       for (int i = 0; i < n; ++i) {         int d;         ++day;         if (s[i] ==  U )           d = 0;         else if (s[i] ==  D )           d = 1;         else if (s[i] ==  L )           d = 2;         else if (s[i] ==  R )           d = 3;         x1 += dx[d];         y1 += dy[d];         if (abs(x2 - x1) + abs(y2 - y1) <= day) Print(day);       }     }     printf( -1 n );     return 0;   }   