Language: C++

#include<bits/stdc++.h>
using namespace std;
#include<string.h>

#define vpp vector<pair<int,int>>
#define ll long long int
#define ull unsigned long long
#define ld long double
#define fi(i,a,b) for(ll i=a;i<b;i++)
#define fj(j,a,b) for(ll j=a;j<b;j++)
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define mpi map<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define mpl map<ll,ll>
#define pb push_back
#define MOD 1000000007
#define ub upper_bound
#define lb lower_bound
#define itr(v) for(auto it:v)
#define all(v) v.begin(),v.end()  
#define w(t)  int t; cin>>t; while(t--)
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fast_pow(ll k, ll p)
{
if (p == 0)
        return 1;
 
    ll P = fast_pow(k, p/2);
    P = (P * P) % MOD;
 
    if (p % 2 == 1)
        P = (P * k) % MOD;
 
    return P;
}
ll invmod(ll a,ll m)
{
    return fast_pow(a,m-2);
}

bool isPrime(ll n) 
{ 
   
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
       if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 
ll nextPowerOf2(ll n)
{
    n>>=1;
    ll count = 0;

    if (n && !(n & (n - 1)))
        return n;

    while( n != 0)
    {
        n >>= 1;
        count += 1;
    }

    return 1 << count;
}

ll binomialCoeff(ll n, ll k) 
{ 
    ll C[k+1]; 
    memset(C, 0, sizeof(C)); 
    C[0] = 1;
  
    for (ll i = 1; i <= n; i++) 
    {
        for (ll j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 

int longDivision(string number, int divisor) 
{ 
    // As result can be very large store it in string 
    string ans; 
  
    // Find prefix of number that is larger 
    // than divisor. 
    int idx = 0; 
    int temp = number[idx] - '0'; 
    while (temp < divisor) 
        temp = temp * 10 + (number[++idx] - '0'); 
  
    // Repeatedly divide divisor with temp. After 
    // every division, update temp to include one 
    // more digit. 
    while (number.size() > idx) { 
        // Store result in answer i.e. temp / divisor 
        ans += (temp / divisor) + '0'; 
  
        // Take next digit of number 
        temp = (temp % divisor) * 10 + number[++idx] - '0'; 
    } 
  
    // If divisor is greater than number 
    if (ans.length() == 0) 
        return 0; 
  
    // else return ans 
    return 1; 
} 

// Function to calculate the modulus 
int modBigNumber(string num, int m) 
{ 
    // Store the modulus of big number 
    vector<int> vec; 
    int mod = 0; 
  
    // Do step by step division 
    for (int i = 0; i < num.size(); i++) { 
           
        int digit = num[i] - '0'; 
  
        // Update modulo by concatenating 
        // current digit. 
        mod = mod * 10 + digit; 
  
        // Update quotient  
        int quo = mod / m; 
        // vec.push_back(quo); 
  
        // Update mod for next iteration. 
        mod = mod % m;         
    } 
   
  
   
  if(mod==0) return 1;
  return 0;
} 
//////////////////////*********CODE***********/////////////////////
int main(){
   
        // int n,k;
        // cin>>n>>k;
        // int a[n];
        // for(int i=0;i<n;i++){
        //      cin>>a[i];
        // }
        // sort(a,a+n);
        // priority_queue<int>q;
        // for(int i=0;i<n;i++){
        //      q.push(a[i]);
        // }
        // for(int i=0;i<k;i++){
        //     // if(q.size()==0) break;
        //     int t=q.top();
        //     q.pop();
        //     if(t%2==0){
        //         q.push(t/2);
        //         q.push(t/2);
        //     }
        //     else{
        //         q.push(t/2);
        //         q.push((t/2)+1);
        //     }
        // }
        // cout<<q.top()<<endl;
        int n;
        cin>>n;
        if(n%2==0||n%5==0){
            cout<<-1<<endl;
            return 1;
        }
        if(n==999983){
            cout<<999982<<endl;
            return;
        }
        string s="";
        int i=1;
        for(i;i<100000000;i++){
            s+='7';
            if(modBigNumber(s,n)) break;
        }
        cout<<i<<endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:188:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
  188 |             return;
      |             ^~~~~~