Language: C++

#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()
#define MOD 1000000007
template<int MOD = 1000000007>
struct mint
{
	int v;
	mint():v(0){}
	mint(int v):v((v%+MOD)%MOD){}
	mint operator-() const { return mint(0) - *this;}
	mint& operator+=(const mint& a){ if((v+=a.v)>=MOD) v-=MOD; return *this;}
	mint& operator-=(const mint& a){ if((v+=MOD-a.v)>=MOD) v-=MOD; return *this;}
	mint& operator*=(const mint& a){ (v*=a.v)%=MOD; return *this;}
	mint operator+(const mint& a)const{ return mint(*this) += a;}
	mint operator-(const mint& a)const{ return mint(*this) -= a;}
	mint operator*(const mint& a)const{ return mint(*this) *= a;}
	bool operator<(const mint& a)const{ return v < a.v;}
	bool operator==(const mint& a)const{ return v == a.v;}
	mint pow(int k){mint r(1),t(v);while(k){if(k&1)r*=t;t*=t;k>>=1;} return r;}
	mint inv(){return pow(MOD-2);}
};
istream& operator>>(istream&i,mint&a){i>>a.v;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.v;return o;}


signed main() {
	int n,k;
	std::cin >> n >> k;
	mint a(n);
	mint b(0);
	for(int i=1;i<=n;i++) b += mint(1)/mint(i);
	print((a*b.pow(k-1)).v);
	return 0;
}


Compiler output:
a.cc:23:13: error: expected '>' before numeric constant
   23 | #define MOD 1000000007
      |             ^~~~~~~~~~
a.cc:24:14: note: in expansion of macro 'MOD'
   24 | template<int MOD = 1000000007>
      |              ^~~
a.cc:42:1: error: 'istream' does not name a type
   42 | istream& operator>>(istream&i,mint&a){i>>a.v;return i;}
      | ^~~~~~~
a.cc:43:1: error: 'ostream' does not name a type
   43 | ostream& operator<<(ostream&o,const mint&a){o<<a.v;return o;}
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:49:17: error: class template argument deduction failed:
   49 |         mint a(n);
      |                 ^
a.cc:49:17: error: no matching function for call to 'mint(long long int&)'
a.cc:29:9: note: candidate: 'template<long long int <anonymous> > mint(long long int)-> mint<<anonymous> >'
   29 |         mint(int v):v((v%+MOD)%MOD){}
      |         ^~~~
a.cc:29:9: note:   template argument deduction/substitution failed:
a.cc:49:17: note:   couldn't deduce template parameter '<anonymous>'
   49 |         mint a(n);
      |                 ^
a.cc:28:9: note: candidate: 'template<long long int <anonymous> > mint()-> mint<<anonymous> >'
   28 |         mint():v(0){}
      |         ^~~~
a.cc:28:9: note:   candidate expects 0 arguments, 1 provided
a.cc:25:8: note: candidate: 'template<long long int <anonymous> > mint(mint<<anonymous> >)-> mint<<anonymous> >'
   25 | struct mint
      |        ^~~~
a.cc:25:8: note:   template argument deduction/substitution failed:
a.cc:49:17: note:   mismatched types 'mint<<anonymous> >' and 'long long int'
   49 |         mint a(n);
      |                 ^
a.cc:50:17: error: class template argument deduction failed:
   50 |         mint b(0);
      |                 ^
a.cc:50:17: error: no matching function for call to 'mint(int)'
a.cc:29:9: note: candidate: 'template<long long int <anonymous> > mint(long long int)-> mint<<anonymous> >'
   29 |         mint(int v):v((v%+MOD)%MOD){}
      |         ^~~~
a.cc:29:9: note:   template argument deduction/substitution failed:
a.cc:50:17: note:   couldn't deduce template parameter '<anonymous>'
   50 |         mint b(0);
      |                 ^
a.cc:28:9: note: candidate: 'template<long long int <anonymous> > mint()-> mint<<anonymous> >'
   28 |         mint():v(0){}
      |         ^~~~
a.cc:28:9: note:   candidate expects 0 arguments, 1 provided
a.cc:25:8: note: candidate: 'template<long long int <anonymous> > mint(mint<<anonymous> >)-> mint<<anonymous> >'
   25 | struct mint
      |        ^~~~
a.cc:25:8: note:   template argument deduction/substitution failed:
a.cc:50:17: note:   mismatched types 'mint<<anonymous> >' and 'int'
   50 |         mint b(0);
      |                 ^
a.cc:51:42: error: class template argument deduction failed:
   51 |         for(int i=1;i<=n;i++) b += mint(1)/mint(i);
      |                                          ^
a.cc:51:42: error: no matching function for call to 'mint(int)'
a.cc:29:9: note: candidate: 'template<long long int <anonymous> > mint(long long int)-> mint<<anonymous> >'
   29 |         mint(int v):v((v%+MOD)%MOD){}
      |         ^~~~
a.cc:29:9: note:   template argument deduction/substitution failed:
a.cc:51:42: note:   couldn't deduce template parameter '<anonymous>'
   51 |         for(int i=1;i<=n;i++) b += mint(1)/mint(i);
      |                                          ^
a.cc:28:9: note: candidate: 'template<long long int <anonymous> > mint()-> mint<<anonymous> >'
   28 |         mint():v(0){}
      |         ^~~~
a.cc:28:9: note:   candidate expects 0 arguments, 1 provided
a.cc:25:8: note: candidate: 'template<long long int <anonymous> > mint(mint<<anonymous> >)-> mint<<anonymous> >'
   25 | struct mint
      |        ^~~~
a.cc:25:8: note:   template argument deduction/substitution failed:
a.cc:51:42: note:   mismatched types 'mint<<anonymous> >' and 'int'
   51 |         for(int i=1;i<=n;i++) b += mint(1)/mint(i);
      |                                          ^
a.cc:51:50: error: class template argument deduction failed:
   51 |         for(int i=1;i<=n;i++) b += mint(1)/mint(i);
      |                                                  ^
a.cc:51:50: error: no matching function for call to 'mint(long long int&)'
a.cc:29:9: note: candidate: 'template<long long int <anonymous> > mint(long long int)-> mint<<anonymous> >'
   29 |         mint(int v):v((v%+MOD)%MOD){}
      |         ^~~~
a.cc:29:9: note:   template argument deduction/substitution failed:
a.cc:51:50: note:   couldn't deduce template parameter '<anonymous>'
   51 |         for(int i=1;i<=n;i++) b += mint(1)/mint(i);
      |                                                  ^
a.cc:28:9: note: candidate: 'template<long long int <anonymous> > mint()-> mint<<anonymous> >'
   28 |         mint():v(0){}
      |         ^~~~
a.cc:28:9: note:   candidate expects 0 arguments, 1 provided
a.cc:25:8: note: candidate: 'template<long long int <anonymous> > mint(mint<<anonymous> >)-> mint<<anonymous> >'
   25 | struct mint
      |        ^~~~
a.cc:25:8: note:   template argument deduction/substitution failed:
a.cc:51:50: note:   mismatched types 'mint<<anonymous> >' and 'long long int'
   51 |         for(int i=1;i<=n;i++) b += mint(1)/mint(i);
      |                                                  ^