func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX = 510;   int n, k;   int a[MAX], b[MAX];   void init() {     cin >> n;     for (int i = 1; i <= n; i++) cin >> a[i];     cin >> k;     for (int i = 1; i <= k; i++) cin >> b[i];   }   bool valid(int i, int l, int r) {     int x = i, y = i, sum = a[i];     while (true) {       int old_x = x, old_y = y;       while (x - 1 >= l && sum > a[x - 1]) {         x--;         sum += a[x];       }       while (y + 1 <= r && sum > a[y + 1]) {         y++;         sum += a[y];       }       if (old_x == x && old_y == y) break;     }     return x == l && y == r;   }   void print(int i, int l, int r) {     int x = i, y = i, sum = a[i];     while (true) {       int old_x = x, old_y = y;       while (x - 1 >= l && sum > a[x - 1]) {         cout << x <<   L  <<   n ;         x--;         sum += a[x];       }       while (y + 1 <= r && sum > a[y + 1]) {         cout << x <<   R  <<   n ;         y++;         sum += a[y];       }       if (old_x == x && old_y == y) break;     }   }   void process() {     vector<pair<int, pair<int, int> > > p;     bool found = true;     int l, r = n, pb = k;     while (r >= 1 && pb >= 1) {       l = r;       int sum = a[r];       while (l - 1 >= 1 && a[l - 1] + sum <= b[pb]) {         l--;         sum += a[l];       }       if (sum == b[pb]) {         bool exist = false;         for (int i = l; i <= r; i++)           if (valid(i, l, r)) {             exist = true;             p.push_back(make_pair(i, make_pair(l, r)));             break;           }         if (exist) {           sum = 0;           pb--;         } else {           found = false;           break;         }       } else {         found = false;         break;       }       r = l - 1;     }     if (r != 0 || pb != 0) found = false;     if (!found)       cout <<  NO ;     else {       cout <<  YES  <<   n ;       for (int i = 0; i < (int)p.size(); i++)         print(p[i].first, p[i].second.first, p[i].second.second);     }   }   int main() {     ios_base::sync_with_stdio(false);     init();     process();   }   