Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){

  ll l,a,b,m;
  cin>>l>>a>>b>>m;
  ll modM[19];
  REP(i,19){
    ll t = modpow(10,i);
    modM[i] = t;
  }
  ll keta[19];
  int maxKeta = 18;
  keta[0] = -1;
  for(int i=1;i<19;i++){
    keta[i] = (modpow(10,i)-1 - a) / b;
    keta[i] = max((ll)-1,keta[i]);
    if(keta[i]>=l){
      keta[i] = l;
      maxKeta = i;
    }
  }

  ll ans = 0;
  //Aの方を処理
  for(int i=1;i<=maxKeta;i++){
    if(keta[i]<0)break;
    int len = keta[i] - keta[i-1];
    ll r = modpow(10,i);
    ans += (a * modpow(r,len)-1) * (modinv(r-1));
    ans %= MOD;
    if(i!=maxKeta)ans *= r;
    ans %= MOD;
  }

  ll ans2 = 0;
  //Bどうするの？？？？？
  for(int i=1;<maxKeta;i++){
    if(keta[i]<0)break;
    int len = keta[i] = keta[i-1];
    ll r = modpow(10,i);
    ll x;
    ll p,q;
    p = keta[i-1]+1;
    q = keta[i];
    ll invR = modinv(r,MOD);
    x = b*(p-1) *  modpow(10,i*(len-1)) - b*q * invR + (b * modpow(r,len)-1 * (modinv(r-1)));
    x = x * modinv(1 - invR);
    ans += x;
    ans %= MOD;
    if(i!=maxKeta)ans *= r;
    ans %= MOD;
  }




 

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:43: error: too few arguments to function 'long long int modinv(long long int, long long int)'
   76 |     ans += (a * modpow(r,len)-1) * (modinv(r-1));
      |                                     ~~~~~~^~~~~
a.cc:37:11: note: declared here
   37 | long long modinv(long long a, long long m) {
      |           ^~~~~~
a.cc:84:15: error: expected primary-expression before '<' token
   84 |   for(int i=1;<maxKeta;i++){
      |               ^
a.cc:93:86: error: too few arguments to function 'long long int modinv(long long int, long long int)'
   93 |     x = b*(p-1) *  modpow(10,i*(len-1)) - b*q * invR + (b * modpow(r,len)-1 * (modinv(r-1)));
      |                                                                                ~~~~~~^~~~~
a.cc:37:11: note: declared here
   37 | long long modinv(long long a, long long m) {
      |           ^~~~~~
a.cc:94:19: error: too few arguments to function 'long long int modinv(long long int, long long int)'
   94 |     x = x * modinv(1 - invR);
      |             ~~~~~~^~~~~~~~~~
a.cc:37:11: note: declared here
   37 | long long modinv(long long a, long long m) {
      |           ^~~~~~