Language: C++

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <iomanip>
#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007
 
 
 
int main()
{
    int N;
    cin >> N;
    ll A[N], B[N];
 
    priority_queue<pair<ll, int> > p;
    REP(i,0,N){
        cin >> A[i];
    }
    REP(i,0,N){
        cin >> B[i];
    }
    REP(i, 0, N)
    {
        if(A[i]>B[i]){
            cout << -1 << endl;
            return 0;
        }else if(B[i]>A[i]){
            p.push(make_pair(B[i], i));
        }
    }
    ll ans = 0;
 
 
    while(!p.empty()){
        pair<ll, int> t = p.top();
        p.pop();
        int idx = t.second;
        ll a, b, c;
        if (idx == 0)
        {
            a = B[N - 1];
            b = B[0];
            c = B[1];
        }else if(idx==N-1){
            a = B[N - 2];
            b = B[N-1];
            c = B[0];
        }else{
            a = B[idx - 1];
            b = B[idx];
            c = B[idx+1];
        }
 
        t = p.top();
        ll base = t.first;
        ll s = (B[idx] - A[idx]) / (a + c);
        if(s==0){
            s = 1;
        }
        B[idx] = B[idx] - s*a - s*c;
        ans += s;
        if (B[idx] > A[idx])
        {
            p.push(make_pair(B[idx], idx));
        }else if(B[idx]<A[idx]){
            cout << -1 << endl;
            return 0;
        }
        //ans++;
    }
    cout << ans << endl;
 
    return 0;
}#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <iomanip>
#include<queue>
using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1844674407370955161
typedef long long int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
#define MOD 1000000007
 
 
 
int main()
{
    int N;
    cin >> N;
    ll A[N], B[N];
 
    priority_queue<pair<ll, int> > p;
    REP(i,0,N){
        cin >> A[i];
    }
    REP(i,0,N){
        cin >> B[i];
    }
    REP(i, 0, N)
    {
        if(A[i]>B[i]){
            cout << -1 << endl;
            return 0;
        }else if(B[i]>A[i]){
            p.push(make_pair(B[i], i));
        }
    }
    ll ans = 0;
 
 
    while(!p.empty()){
        pair<ll, int> t = p.top();
        p.pop();
        int idx = t.second;
        ll a, b, c;
        if (idx == 0)
        {
            a = B[N - 1];
            b = B[0];
            c = B[1];
        }else if(idx==N-1){
            a = B[N - 2];
            b = B[N-1];
            c = B[0];
        }else{
            a = B[idx - 1];
            b = B[idx];
            c = B[idx+1];
        }
 
        t = p.top();
        ll base = t.first;
        ll s = (B[idx] - A[idx]) / (a + c);
        if(s==0){
            s = 1;
        }
        B[idx] = B[idx] - s*a - s*c;
        ans += s;
        if (B[idx] > A[idx])
        {
            p.push(make_pair(B[idx], idx));
        }else if(B[idx]<A[idx]){
            cout << -1 << endl;
            return 0;
        }
        //ans++;
    }
    cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc:86:2: error: stray '#' in program
   86 | }#include <iostream>
      |  ^
a.cc:86:3: error: 'include' does not name a type
   86 | }#include <iostream>
      |   ^~~~~~~
a.cc:106:5: error: redefinition of 'int main()'
  106 | int main()
      |     ^~~~
a.cc:21:5: note: 'int main()' previously defined here
   21 | int main()
      |     ^~~~