Language: C++

a#include<bits/stdc++.h>

using namespace std;
 
// Competetive Template:
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
typedef pair <lli,lli> pll;
typedef pair <lli,string> pls;
typedef pair <lli,lli> pll;

typedef vector <lli> vl;
typedef vector <pll> vll;
typedef vector <string> vs;
typedef vector <char> vc;

typedef set <lli> sl;

typedef map <lli, lli> mll;
typedef map <pll, lli> mpll;
typedef map <string, lli> msl;

typedef priority_queue <lli> max_heap ;
typedef priority_queue < lli, vector<lli> , greater<lli> > min_heap;

// Debugging :
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define pb push_back 
#define pf push_front
#define in insert 
#define popb pop_back
#define popf pop_front
#define ba  back
#define si size()
#define be begin()
#define en end()
#define le length()
#define lb lower_bound
#define mp make_pair 
#define mt make_tuple
#define fi first
#define se second
#define deb debug
#define all(v) v.be, v.en
#define INF LLONG_MAX
const ldb PI = acos(-1.0);

#define forz(i, n) for (int i = 0; i < n; i++)
#define rforz(i, n) for (int i = n - 1; i >= 0; i--)

#define fore(i, m, n) for (int i = m; i <= n; i++)
#define rfore(i, m, n) for (int i = n; i >= m; i--)

#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define mod 1000000007
#define mod2 998244353

// Printing Data :
#define pvec(v) forz(i,v.si) cout<<v[i]<<" "; cout<<endl;
#define parr(arr, n) forz(i,n) cout<<arr[i]<<" "; cout<<endl;

#define p1(i) cout<<i<<endl
#define p2(i, j) cout<<i<<" "<<j<<endl
#define p3(i, j, k) cout<<i<<" "<<j<<" "<<k<<endl
#define p4(i, j, k, l) cout<<i<<" "<<j<<" "<<k<<" "<<l<<endl

// Exponentiation in O(log y)
lli power(lli x,lli y){lli res=1; x=x;while(y>0){if(y&1) res=(res*x);y=y>>1;x=(x*x);}return res;} 

// Modular Exponentiation in O(log y)
lli power(lli x,lli y,lli p){lli res=1; x=x%p;while(y>0){if(y&1) res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;} 

// Euclidean gcd
lli gcd(lli a, lli b) { if (a==0) return b; return gcd(b % a, a);}

// Primality Test
bool isPrime(lli n)
{
    if(n==2) return true;
    if(n%2==0) return false;
    for(lli i=3; i<=sqrt(n); i+=2)
    if(n%i==0) return false;
    return true;
}

lli lowerIndex(vector <lli> &arr, lli x) 
{ 
    lli n = arr.si;
    lli l = 0, h = n - 1; 
    while (l <= h) { 
        lli mid = (l + h) / 2; 
        if (arr[mid] >= x) 
            h = mid - 1; 
        else
            l = mid + 1; 
    } 
    return l; 
} 
  
lli upperIndex(vector <lli> &arr, lli y) 
{ 
    lli n = arr.si;
    lli l = 0, h = n - 1; 
    while (l <= h) { 
        lli mid = (l + h) / 2; 
        if (arr[mid] <= y) 
            l = mid + 1; 
        else
            h = mid - 1; 
    } 
    return h; 
} 
  
lli countInRange(vector <lli> &arr, lli x, lli y) 
{ 
    lli n = arr.si;
    lli count = 0; 
    count = upperIndex(arr, y) - lowerIndex(arr, x) +1; 
    return count; 
}

bool isPalindrome(string str) 
{ 
    lli l = 0, h = str.le - 1; 
    while (h > l) if (str[l++] != str[h--]) return false; 
    return true;
} 

// Returns true if s1 is substring of s2 
bool isSubstring(string s1, string s2) 
{ 
    int M = s1.length(); 
    int N = s2.length(); 
  
    /* A loop to slide pat[] one by one */
    for (int i = 0; i <= N - M; i++) { 
        int j; 
  
        /* For current index i, check for pattern match */
        for (j = 0; j < M; j++) 
            if (s2[i + j] != s1[j]) 
                break; 
  
        if (j == M) 
            return true; 
    } 
  
    return false; 
}

// Returns a vector consisiting of all divisors of n.
vector <lli>  getDivisors(lli n) 
{ 
    vector<lli> v; 
    for (lli i=1; i<=sqrt(n); i++) 
    { 
        if (n%i==0) 
        { 
            if (n/i == i) 
                v.pb(i);
            else
            { 
                v.pb(i);
                v.push_back(n/i); 
            } 
        } 
    } 

    sort(v.be, v.en);
    return v;
}

// Returns a vector consisting of all prime factors of n.
vector <lli> primeFactors(lli n)  
{  
    vector <lli> v;
    while (n % 2 == 0)  
    {  
        v.pb(2);
        n = n/2;  
    }  
  
    for (lli i = 3; i <= sqrt(n); i = i + 2)  
    {  
        while (n % i == 0)  
        {  
            v.pb(i);
            n = n/i;  
        }  
    }  
  
    if (n > 2)  
        v.pb(n);

    return v;
} 


// update(l, r, x) : Adds x to all values from A[l] to A[r] (both inclusive).
// printArray() : Prints the current modified array.
vl initializeDiffArray(vl & A) 
{ 
    lli n = A.size(); 
  
    vl D(n + 1); 
  
    D[0] = A[0], D[n] = 0; 
    for (int i = 1; i < n; i++) 
        D[i] = A[i] - A[i - 1]; 
    return D; 
} 
  
// Does range update 
// Updates all i in the range (l, r) : a[i] += x.
void update(vl & D, lli l, lli r, lli x) 
{ 
    D[l] += x; 
    D[r + 1] -= x; 
} 
  
// Prints updated Array 
void getArray(vl & A, vl & D) 
{ 
    for (int i = 0; i < A.size(); i++) { 
        if (i == 0) 
            A[i] = D[i]; 
  
        else
            A[i] = D[i] + A[i - 1]; 
    }  
} 


// CODE BEGINS :
int main()
{
	ios::sync_with_stdio(0), cin.tie(0),cout.tie(0);

    lli n; cin>>n;
    if(n%1000!=0)
    p1(1000-n%1000);

    else
    p1(0);
    
    return 0;
}
























































Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | a#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'a' does not name a type; did you mean 'ba'?
    1 | a#include<bits/stdc++.h>
      | ^
      | ba
a.cc:9:9: error: 'pair' does not name a type; did you mean 'parr'?
    9 | typedef pair <lli,lli> pll;
      |         ^~~~
      |         parr
a.cc:10:9: error: 'pair' does not name a type; did you mean 'parr'?
   10 | typedef pair <lli,string> pls;
      |         ^~~~
      |         parr
a.cc:11:9: error: 'pair' does not name a type; did you mean 'parr'?
   11 | typedef pair <lli,lli> pll;
      |         ^~~~
      |         parr
a.cc:13:9: error: 'vector' does not name a type
   13 | typedef vector <lli> vl;
      |         ^~~~~~
a.cc:14:9: error: 'vector' does not name a type
   14 | typedef vector <pll> vll;
      |         ^~~~~~
a.cc:15:9: error: 'vector' does not name a type
   15 | typedef vector <string> vs;
      |         ^~~~~~
a.cc:16:9: error: 'vector' does not name a type
   16 | typedef vector <char> vc;
      |         ^~~~~~
a.cc:18:9: error: 'set' does not name a type; did you mean 'se'?
   18 | typedef set <lli> sl;
      |         ^~~
      |         se
a.cc:20:9: error: 'map' does not name a type; did you mean 'mp'?
   20 | typedef map <lli, lli> mll;
      |         ^~~
      |         mp
a.cc:21:9: error: 'map' does not name a type; did you mean 'mp'?
   21 | typedef map <pll, lli> mpll;
      |         ^~~
      |         mp
a.cc:22:9: error: 'map' does not name a type; did you mean 'mp'?
   22 | typedef map <string, lli> msl;
      |         ^~~
      |         mp
a.cc:24:9: error: 'priority_queue' does not name a type
   24 | typedef priority_queue <lli> max_heap ;
      |         ^~~~~~~~~~~~~~
a.cc:25:9: error: 'priority_queue' does not name a type
   25 | typedef priority_queue < lli, vector<lli> , greater<lli> > min_heap;
      |         ^~~~~~~~~~~~~~
a.cc: In function 'void __print(int)':
a.cc:28:22: error: 'cerr' was not declared in this scope
   28 | void __print(int x) {cerr << x;}
      |                      ^~~~
a.cc: In function 'void __print(long int)':
a.cc:29:23: error: 'cerr' was not declared in this scope
   29 | void __print(long x) {cerr << x;}
      |                       ^~~~
a.cc: In function 'void __print(long long int)':
a.cc:30:28: error: 'cerr' was not declared in this scope
   30 | void __print(long long x) {cerr << x;}
      |                            ^~~~
a.cc: In function 'void __print(unsigned int)':
a.cc:31:27: error: 'cerr' was not declared in this scope
   31 | void __print(unsigned x) {cerr << x;}
      |                           ^~~~
a.cc: In function 'void __print(long unsigned int)':
a.cc:32:32: error: 'cerr' was not declared in this scope
   32 | void __print(unsigned long x) {cerr << x;}
      |                                ^~~~
a.cc: In function 'void __print(long long unsigned int)':
a.cc:33:37: error: 'cerr' was not declared in this scope
   33 | void __print(unsigned long long x) {cerr << x;}
      |                                     ^~~~
a.cc: In function 'void __print(float)':
a.cc:34:24: error: 'cerr' was not declared in this scope
   34 | void __print(float x) {cerr << x;}
      |                        ^~~~
a.cc: In function 'void __print(double)':
a.cc:35:25: error: 'cerr' was not declared in this scope
   35 | void __print(double x) {cerr << x;}
      |                         ^~~~
a.cc: In function 'void __print(long double)':
a.cc:36:30: error: 'cerr' was not declared in this scope
   36 | void __print(long double x) {cerr << x;}
      |                              ^~~~
a.cc: In function 'void __print(char)':
a.cc:37:23: error: 'cerr' was not declared in this scope
   37 | void __print(char x) {cerr << '\'' << x << '\'';}
      |                       ^~~~
a.cc: In function 'void __print(const char*)':
a.cc:38:30: error: 'cerr' was not declared in this scope
   38 | void __print(const char *x) {cerr << '\"' << x << '\"';}
      |                              ^~~~
a.cc: At global scope:
a.cc:39:20: error: 'string' does not name a type
   39 | void __print(const string &x) {cerr << '\"' << x << '\"';}
      |                    ^~~~~~
a.cc: In function 'void __print(const int&)':
a.cc:39:32: error: 'cerr' was not declared in this scope
   39 | void __print(const string &x) {cerr << '\"' << x << '\"';}
      |                                ^~~~
a.cc: In function 'void __print(bool)':
a.cc:40:23: error: 'cerr' was not declared in this scope
   40 | void __print(bool x) {cerr << (x ? "true" : "false");}
      |                       ^~~~
a.cc: At global scope:
a.cc:43:20: error: 'pair' does not name a type; did you mean 'parr'?
   43 | void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
      |                    ^~~~
      |                    parr
a.cc:43:24: error: expected ',' or '...' before '<' token
   43 | void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
      |                        ^
a.cc: In function 'void __print(int)':
a.cc:43:36: error: 'cerr' was not declared in this scope
   43 | void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
      |                                    ^~~~
a.cc:43:57: error: 'x' was not declared in this scope
   43 | void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
      |                                                         ^
a.cc: In function 'void __print(const T&)':
a.cc:45:38: error: 'cerr' was not declared in this scope
   45 | void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
      |                                      ^~~~
a.cc: In function 'void _print()':
a.cc:46:16: error: 'cerr' was not declared in this scope
   46 | void _print() {cerr << "]\n";}
      |                ^~~~
a.cc: In function 'void _print(T, V ...)':
a.cc:48:57: error: 'cerr' was not declared in this scope
   48 | void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
      |                                                         ^~~~
a.cc: At global scope:
a.cc:73:16: error: 'acos' was not declared in this scope
   73 | const ldb PI = acos(-1.0);
      |                ^~~~
a.cc: In function 'bool isPrime(lli)':
a.cc:111:21: error: 'sqrt' was not declared in this scope
  111 |     for(lli i=3; i<=sqrt(n); i+=2)
      |                     ^~~~
a.cc: At global scope:
a.cc:116:16: error: 'vector' was not declared in this scope
  116 | lli lowerIndex(vector <lli> &arr, lli x)
      |                ^~~~~~
a.cc:116:27: error: expected primary-expression before '>' token
  116 | lli lowerIndex(vector <lli> &arr, lli x)
      |                           ^
a.cc:116:30: error: 'arr' was not declared in this scope; did you mean 'parr'?
  116 | lli lowerIndex(vector <lli> &arr, lli x)
      |                              ^~~
      |                              parr
a.cc:116:39: error: expected primary-expression before 'x'
  116 | lli lowerIndex(vector <lli> &arr, lli x)
      |                                       ^
a.cc:116:40: error: expression list treated as compound expression in initializer [-fpermissive]
  116 | lli lowerIndex(vector <lli> &arr, lli x)
      |                                        ^
a.cc:130:16: error: 'vector' was not declared in this scope
  130 | lli upperIndex(vector <lli> &arr, lli y)
      |                ^~~~~~
a.cc:130:27: error: expected primary-expression before '>' token
  130 | lli upperIndex(vector <lli> &arr, lli y)
      |                           ^
a.cc:130:30: error: 'arr' was not declared in this scope; did you mean 'parr'?
  130 | lli upperIndex(vector <lli> &arr, lli y)
      |                              ^~~
      |                              parr
a.cc:130:39: error: expected primary-expression before 'y'
  130 | lli upperIndex(vector <lli> &arr, lli y)
      |                                       ^
a.cc:130:40: error: expression list treated as compound expression in initializer [-fpermissive]
  130 | lli upperIndex(vector <lli> &arr, lli y)
      |                                        ^
a.cc:144:18: error: 'vector' was not declared in this scope
  144 | lli countInRange(vector <lli> &arr, lli x, lli y)
      |                  ^~~~~~
a.cc:144:29: error: expected primary-expression before '>' token
  144 | lli countInRange(vector <lli> &arr, lli x, lli y)
      |                             ^
a.cc:144:32: error: 'arr' was not declared in this scope; did you mean 'parr'?
  144 | lli countInRange(vector <lli> &arr, lli x, lli y)
      |                                ^~~
      |                                parr
a.cc:144:41: error: expected primary-expression before 'x'
  144 | lli countInRange(vector <lli> &arr, lli x, lli y)
      |                                         ^
a.cc:144:48: error: expected primary-expression before 'y'
  144 | lli countInRange(vector <lli> &arr, lli x, lli y)
      |                                                ^
a.cc:144:49: error: expression list treated as compound expression in initializer [-fpermissive]
  144 | lli countInRange(vector <lli> &arr, lli x, lli y)
      |                                                 ^
a.cc:152:19: error: 'string' was not declared in this scope
  152 | bool isPalindrome(string str)
      |                   ^~~~~~
a.cc:160:18: error: 'string' was not declared in this scope
  160 | bool isSubstring(string s1, string s2)
      |                  ^~~~~~
a.cc:160:29: error: 'string' was not declared in this scope
  160 | bool isSubstring(string s1, string s2)
      |                             ^~~~~~
a.cc:160:38: error: expression list treated as compound expression in initializer [-fpermissive]
  160 | bool isSubstring(string s1, string s2)
      |                                      ^
a.cc:182:1: error: 'vector' does not name a type
  182 | vector <lli>  getDivisors(lli n)
      | ^~~~~~
a.cc:204:1: error: 'vector' does not name a type
  204 | vector <lli> primeFactors(lli n)
      |