Language: C++


/*Author: Qaseem Hasan alias Mikepayne14(Codeforces,SPOJ) 
                           qaseem_hasan_ (HackerEarth,Codechef,HackerRank)
*/


//---------------------------------------------------------
//#pragma GCC optimize "trapv"

#include<bits/stdc++.h>
using namespace std;
//---------------------------------------------------------
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; } //x=min,y=item
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

template<typename ForwardIterator,typename T>
T first_val(ForwardIterator first,ForwardIterator last,T value)
{
    auto it = std::lower_bound(first,last,value);
    return (it!=last)?(it - first) : -1;
}

template<typename ForwardIterator,typename T>
T last_val(ForwardIterator first,ForwardIterator last,T value)
{
    auto it = std::upper_bound(first,last,value);
    return ((it!=last)?(it - first) : -1) - 1;
}
//--------------------------------------------------------
#define acc accumulate
#define eb emplace_back
#define ll long long int
#define lld long long double
#define mii map <int,int>
#define vi vector <int>
#define vll vector <ll>
#define vvi vector <vi>
#define pii pair <int,int>
#define vpii vector <pii>
#define seti set <int>
#define F first
#define S second
#define fil(v,x) fill(all(v),x)
#define filcon(v,x) iota(all(v),x)
#define rep(n) for(int i=0;i<n;++i)
#define repr(n) for(int i=n-1;i>=0;--i)
#define erase(v,e) v.erase(std::remove(v.begin(), v.end(), e), v.end())
#define sqr(x) ((x)*(x))
#define MEM(a, b) memset(a, b, sizeof(a))
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define inrange(i,a,b) ((i>=min(a,b)) && (i<=max(a,b))) 
#define FLSH fflush(stdout)
// #define min_all(a,b,c,d,...) min({a,b,c,d,...})
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define make_unique(v) sort(all(v)); v.erase(unique(all(v)), v.end());
#define INF (int)1e9
#define EPS 1e-8
#define MOD 1e9 + 7
#define tr(x) cout<<#x<<" = { "<<x<<" }\n";
#define khatam '\n'
#define PI acos(-1);

//--------------------------------------------------------

//int ar[40001][40001];

//ll ar[10001];

//--------------------------------------------------------
/*bool compare(const pair<int, int>&i, const pair<int, int>&j)
{
    return i.F < j.F;
}*/

void solve()
{
    ll n;
    cin >> n;
    ll sum = n/500;/
    ll happy = sum * 1000;
    ll res = (n - sum*500)/5;
    happy += sum;
    cout << happy << khatam;
}

int main()
{
    FAST_IO;
    /*#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif*/
//--------------------------------------------------------
solve();
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:82:20: error: expected primary-expression before '/' token
   82 |     ll sum = n/500;/
      |                    ^
a.cc:32:12: error: expected primary-expression before 'long'
   32 | #define ll long long int
      |            ^~~~
a.cc:83:5: note: in expansion of macro 'll'
   83 |     ll happy = sum * 1000;
      |     ^~
a.cc:85:5: error: 'happy' was not declared in this scope
   85 |     happy += sum;
      |     ^~~~~