Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define ld double 
#define rep(i,a,b) for(ll i=a; i<b; ++i)
#define BOOST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define all(v) v.begin(),v.end()
#define sl(a) a.size()
#define mod 1000000007 
#define lcm(a,b) (a*b)/__gcd(a,b)
#define MAX 100006
#define f first
#define s second
ll x,y,d;
void Extended_Euclid(ll A, ll B)
{
    if(B==0)
    {
        d=A;
        x=1;
        y=0;
    }
    else
    {
        Extended_Euclid(B,A%B);
        int temp=x;
        x=y;
        y=temp-(A/B)*y;
    }
}
ll Modular_Inverse(ll A, ll M)
{
    Extended_Euclid(A,M);
    return (x%M+M)%M;
}
ll Modular_Exponentiation(ll x, ll n, ll M)
{
    if(n==0) return 1;
    if(n%2) return (x*Modular_Exponentiation((x*x)%M,n/2,M))%M;
    else return (Modular_Exponentiation((x*x)%M,n/2,M))%M;
}
void solve()
{
    ll k;   cin>>k;
    if(!(k&1)) {  cout<<"-1";  return;  }
    rep(i,1,ll(1e8+9))
    {
        if(((7%k)*(Modular_Exponentiation(10,i,k)%k+k-1)%k*(Modular_Inverse(9,k)))%k==0) 
        {
            cout<<i;
            return; 
        }
    }cout<<"-1";
}
int main()
{
    BOOST
    int T=1;  //cin>>T;
    while(T--) solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:6:34: note: in definition of macro 'rep'
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                                  ^
a.cc:48:13: note: in expansion of macro 'll'
   48 |     rep(i,1,ll(1e8+9))
      |             ^~
a.cc:4:12: error: expected ';' before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:6:34: note: in definition of macro 'rep'
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                                  ^
a.cc:48:13: note: in expansion of macro 'll'
   48 |     rep(i,1,ll(1e8+9))
      |             ^~
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:6:34: note: in definition of macro 'rep'
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                                  ^
a.cc:48:13: note: in expansion of macro 'll'
   48 |     rep(i,1,ll(1e8+9))
      |             ^~
a.cc:4:12: error: expected ')' before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:6:34: note: in definition of macro 'rep'
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                                  ^
a.cc:48:13: note: in expansion of macro 'll'
   48 |     rep(i,1,ll(1e8+9))
      |             ^~
a.cc:6:23: note: to match this '('
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                       ^
a.cc:48:5: note: in expansion of macro 'rep'
   48 |     rep(i,1,ll(1e8+9))
      |     ^~~
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:6:34: note: in definition of macro 'rep'
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                                  ^
a.cc:48:13: note: in expansion of macro 'll'
   48 |     rep(i,1,ll(1e8+9))
      |             ^~
a.cc:48:9: error: 'i' was not declared in this scope
   48 |     rep(i,1,ll(1e8+9))
      |         ^
a.cc:6:39: note: in definition of macro 'rep'
    6 | #define rep(i,a,b) for(ll i=a; i<b; ++i)
      |                                       ^