akhauriyash/Code-Regression huggingface dataset:
/*
    _____
  .'|||||'.
 /  >   <  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
    |||||
*/

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<stack>
#include<cmath>
#include<queue>
using namespace std;
#define CL(x,v); memset(x,v,sizeof(x));
#define INF 0x3f3f3f3f
#define LL long long
#define REP(i,r,n) for(int i=r;i<=n;i++)
#define RREP(i,n,r) for(int i=n;i>=r;i--)
LL n,m;
int main()
{
scanf("%lld%lld",&n,&m);
if (n%3==0||m%3==0)
{
    printf("0\n");
    return(0);
}
LL ans=1000000000000;
if (n>=3)
{
  if (n%3==1)
  {
    LL x=n/3;
    LL y=n/3;
    LL z=n/3+1;
    ans=min(ans,max(x,max(y,z))*m-min(x,min(y,z))*m);
  } else
  if (n%3==2)
  {
    LL x=n/3;
    LL y=n/3+1;
    LL z=n/3+1;
    ans=min(ans,max(x,max(y,z))*m-min(x,min(y,z))*m);
  }
}
if (m>=3)
{
  if (m%3==1)
  {
    LL x=m/3;
    LL y=m/3;
    LL z=m/3+1;
    ans=min(ans,max(x,max(y,z))*n-min(x,min(y,z))*n);
  } else
  if (m%3==2)
  {
    LL x=m/3;
    LL y=m/3+1;
    LL z=m/3+1;
    ans=min(ans,max(x,max(y,z))*n-min(x,min(y,z))*n);
  }
}
for (LL i=1;i<=n-1;i++)
{
    LL x=i*m;
    LL y=(n-i)*(m/2);
    LL z=(n-i)*(m-m/2);
    ans=min(ans,max(x,max(y,z))-min(x,min(y,z)));
}
for (LL i=1;i<=m-1;i++)
{
    LL x=i*n;
    LL y=(m-i)*(n/2);
    LL z=(m-i)*(n-n/2);
    ans=min(ans,max(x,max(y,z))-min(x,min(y,z)));
}printf("%lld\n",ans);
    return(0);
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(long long x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl
#define M 1000000007
#define all(x) x.begin(),x.end()
typedef pair<long long,long long> P;
typedef pair<long long,P> PP;
long long c;
long long n,m;
long long cc[60];
long long ans;
long long sosu[100006];
vector<long long> list_mod_inverse(long long n, long long m)
{
    vector<long long> inv(n + 1);
    inv[1] = 1;
    for (long long i = 2; i <= n; ++i)
        inv[i] = inv[m % i] * (m - m / i) % m;
    return inv;
}
int main()
{
	ans=1;
	cin>>n>>m;
	vector<long long> hai=list_mod_inverse(60,M);
	rep2(i,2,100006)
	{
		sosu[i]=1;
	}
	cc[0]=1;
	rep2(i,1,60)
	{
		cc[i]=cc[i-1]*(i+n-1);cc[i]%=M;
		cc[i]=cc[i]*hai[i];
		cc[i]%=M;
	}
	/*rep(i,10)
	{
		cout<<hai[i]<<"  "<<cc[i]<<endl;
	}*/
	//cout<<"a";
	rep2(i,2,100006)
	{
		if(sosu[i])
		{
			for(long long j=i*2;j<100006;j+=i)
			{
				sosu[j]=0;
			}
		}
	}
	//cout<<"b";
	rep2(i,2,100006)
	{
		c=0;
		if(sosu[i]==1)
		{
			while(m%i==0)
			{
				//cout<<"t"<<i<<endl;
				c++;
				m/=i;
			}
			//get c
			ans*=cc[c];
			ans%=M;
		}
	}
	if(m!=1)
	{
		ans*=n;
		ans%=M;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
using System;

namespace AOJ
{
  class Program
  {
    static void Main()
    {
      string[] data;
      int n, x, i, j, k, c;

      while (true)
      {
        data = Console.ReadLine().Split(' ');
        n = int.Parse(data[0]);
        x = int.Parse(data[1]);
        if (n == 0 && x == 0) break;

        int[] ary = new int[n];
        for (i = 0; i < n; i++) ary[i] = i + 1;

        c = 0;
        for (i = 0; i < n - 2; i++)
          for (j = i + 1; j < n - 1; j++)
            for (k = j + 1; k < n; k++)
              if (ary[i] + ary[j] + ary[k] == x) c++;

        Console.WriteLine(c);
      }
    }
  }
}

Measured memory_bytes: 9136
#include<bits/stdc++.h>
using namespace std;

int main(){
  int num[9];
  for(int i=0;i<9;i++){
    cin>>num[i];
    //cout<<A[i]<<endl;
  }
    
  bool A[9]={false};
  int N;
  cin>>N;
  
  int b;
  for(int i=0;i<N;i++){
    cin>>b;
    for(int j=0;j<9;j++){
      if(num[j]==b)A[j]=true;
    }
  }
  
  string ans="No";
  if(A[0] && A[1] && A[2])ans="Yes";
  if(A[3] && A[4] && A[5])ans="Yes";
  if(A[6] && A[7] && A[8])ans="Yes";
  if(A[0] && A[3] && A[6])ans="Yes";
  if(A[1] && A[4] && A[7])ans="Yes";
  if(A[2] && A[5] && A[8])ans="Yes";
  if(A[0] && A[4] && A[8])ans="Yes";
  if(A[2] && A[4] && A[6])ans="Yes";
  
  cout<<ans<<endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

const int PI = 3.141592653589793;
const int inf = 1000111222;
const int mod = 1000000007;
const int N = 200007;

void solve() {
        int n, m, x;
        cin >> n >> m >> x;
        int cost[n + 7], A[n + 7][m + 7];
        for (int i = 0; i < n; i++) {
                cin >> cost[i];
                for (int j = 0; j < m; j++)
                        cin >> A[i][j];
        }
        int spend = inf;
//        memset(ans, 0, sizeof ans);
        for (int mask = 0; mask < (1 << n); mask++) {
                int curr_spend = 0;
                int curr_ans[m + 7];
                memset(curr_ans, 0, sizeof curr_ans);
                for (int i = 0; i < 24; i++) {
                        if ((1 << i) & mask) {
                                curr_spend += cost[i];
                                for (int j = 0; j < m; j++) {
                                        curr_ans[j] += A[i][j];
                                }
                                int flag = 0;
                                for (int j = 0; j < m; j++) {
                                        if (curr_ans[j] < x)
                                                ++flag;
                                }
                                if (!flag) {
                                        spend = min(spend, curr_spend);
                                }
                        }
                }
        }
        if (spend == inf) cout << "-1\n";
        else cout << spend << endl;
}

int main(){

        ios_base::sync_with_stdio(0);
        cin.tie(0); cout.tie(0);

        solve();
        return 0;
}



Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define debug(x) cout << "debug: " << x << endl
#define MOD 1e9 + 7
#define INF 1e9

template <class T>
inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}
template <class T>
inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template <class T>
inline T GCD(T a, T b){if (b == 0) return a; else return GCD(b, a % b);}
template <class T>
inline T LCM(T a, T b) {return (a * b) / GCD(a, b);}

//const double pi = 3.1415926535; //10^-10までの円周率

bool is_prime(int n)
{
    if (n < 2)
        return false;
    else if (n == 2)
        return true;
    else if (n % 2 == 0)
        return false;
    else
    {
        double s = sqrt(n);
        for (int i = 3; i <= s; i++)
        {
            if (n % i == 0)
                return false;
        }
    }
    return true;
}

int main(){
    int n;
    cin >> n;
    int a;
    int count = 0;
    rep(i, n){
        cin >> a;
        if (is_prime(a)) count++;
    }
    cout << count << endl;
}


Measured memory_bytes: 3120
using System;
using System.Linq;

class Plogram
{
    static void Main()
    {

        int n = int.Parse(Console.ReadLine());
        var line = Console.ReadLine().Split();
        int T = int.Parse(line[0]);
        int A = int.Parse(line[1]);
        var H = Console.ReadLine().Split().Select(x => double.Parse(x)).ToArray();
        double min = int.MaxValue;
        int ans=0;

        for(int i = 0; i < n; i++)
        {
            if(min > Math.Abs(A - (T - H[i] * 0.006)))
            {
                min = Math.Abs(A - (T - H[i] * 0.006));
                ans = i+1;
            }
        }
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 13312
#include<bits/stdc++.h>
using namespace std;
template<typename T>inline T read(){
	T f=0,x=0;char c=getchar();
	while(!isdigit(c)) f=c=='-',c=getchar();
	while(isdigit(c)) x=x*10+c-48,c=getchar();
	return f?-x:x;
}
namespace run{
	typedef long long ll;
	const int N=509;
	ll ans;int n,maxn[2][N][N],minn[2][N][N],sum[N][N],pos[N][N];char s[N][N];
	int main(){
		n=read<int>();
		for(int i=1;i<=n;i++) scanf("%s",s[i]+1);

		int cur=0;
		for(int i=n;i;i--){
			int pre=cur;cur^=1;
			for(int j=n;j;j--) if(s[i][j]!='#'){
				sum[i][j]=sum[i][j+1]+sum[i+1][j]+s[i][j]-'0';
				pos[i][j]=max(max(pos[i][j+1],pos[i+1][j]),i);

				minn[cur][j][i]=j;
				for(int k=i+1;k<=pos[i+1][j];k++) minn[cur][j][k]=minn[pre][j][k];
				for(int k=max(pos[i+1][j],i)+1;k<=pos[i][j+1];k++) minn[cur][j][k]=minn[cur][j+1][k];
				
				maxn[cur][j][i]=j;
				for(int k=i;k<=pos[i][j+1];k++) maxn[cur][j][k]=maxn[cur][j+1][k];
				for(int k=max(pos[i][j+1],i)+1;k<=pos[i+1][j];k++) maxn[cur][j][k]=maxn[pre][j][k];

				int d=i+1,r=min(pos[i+1][j],pos[i][j+1]);
				while(d<=r){
					if(maxn[pre][j][d]>=minn[cur][j+1][d]){
						sum[i][j]-=sum[d][minn[cur][j+1][d]];
						d=pos[d][minn[cur][j+1][d]];
					}
					d++;
				}
				ans+=1LL*(s[i][j]-'0')*(sum[i][j]-s[i][j]+'0');
			}
		}
		printf("%lld\n",ans);
		return 0;
	}
}
int main(){
#ifdef my
	freopen(".in","r",stdin);
	freopen(".out","w",stdout);
#endif
	return run::main();
}

Measured memory_bytes: 10040
#include<bits/stdc++.h>
using namespace std;
#define debug 1

int main(int argc,char **argv) {
	int n;
	cin>>n;
	int h,h_last=0;
	for(int i=0;i<n;i++) {
		scanf("%d",&h);
		if(h>h_last) h--;
		else if(h==h_last) ;
		else if(h<h_last) {
			cout<<"No"<<endl;
			return 0;
		}
		h_last=h;
	}
	cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int cnt=0;

int GCD( int x , int y ){
  int tmp;

  if(!(x >= y )){
    tmp = x;
    x = y;
    y = tmp;
  }

  

  while(1){
    if( y == 0 ) break;
    x %= y;
    tmp = x;
    x = y;
    y = tmp;
    cnt++;
  }

  return x;
}

int main(void){
  int x,y,ans;
  
  while(1){
    cnt = 0;
    scanf("%d %d" ,&x ,&y);
    if( x == 0 && y == 0 ) break;
    
    ans = GCD(x,y);
    printf("%d %d\n" ,ans,cnt);
  }
  return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define double long double
using namespace std;
ll n, h; ll a[114514], b[114514];
signed main() {
	cin >> n >> h;
	rep(i, n)cin >> a[i] >> b[i];
	sort(a, a + n);
    sort(b,b+n);
	ll cnt = 0, memo = 0;
	for (int i = n-1; i >= 0; i--) {
		if (b[i] <= a[n - 1])continue;
        if (cnt >= h) break;
		cnt += b[i];
		memo++;
	}
	if (cnt >= h)cout << memo << endl;
	else cout << ((h - cnt) - 1) / a[n - 1] + 1 + memo << endl;
	getchar(); getchar(); return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
  if(tail == LEN){
    exit(2);
  }
  Q[tail] = x;
  if(tail + 1 == LEN){
    tail = 0;
  }
  else{
    tail++;
  }
}

P dequeue(){
  if(head == LEN){
    exit(3);
  }
  P x = Q[head];
  if(head + 1 == LEN){
    head = 0;
  }
  else{
    head++;
  }
    return x;

}

min(int a,int b){
  if(a < b)return a;
  else return b;
}

int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
    }
  head = 1;
  tail = n + 1;

  while(head != tail){
    u = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps += c;
    if(u.t > 0){
      enqueue(u);
    }
    else{
      printf("%s %d\n",u.name,elaps);
    }
    }

  
  return 0;
}



Measured memory_bytes: 11872
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
#define ALL(x)    (x).begin(),(x).end()
#define UNIQ(c)   (c).erase(unique(ALL((c))), end((c)))
#define mp        make_pair
#define eb        emplace_back
#define REP(i, a) for (int i = 0; i < (a); i++)
string s;
bool c, f;

int main() {
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'C')c = true;
		if (c&&s[i] == 'F')f = true;
	}
	cout << (c&&f ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;

int main(){
  int n, m;
  cin >> n >> m;
  scc_graph graph(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    graph.add_edge(a,b);
  }
  vector<vector<int>> scc = graph.scc();
  cout << scc.size() << endl;
  for(auto v : scc) {
    cout << v.size() << " ";
    for(int x : v) cout << x << " ";
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 40596
#include<iostream>
using namespace std;
#define MAX 500000
#define SENTINEL 2000000000

int L[MAX / 2 + 2], R[MAX / 2 + 2];
int cnt;

void merge(int A[], int n, int left, int mid, int right) {
    int n1 = mid - left;
    int n2 = right - mid;
    for (int i = 0; i < n1; i++) L[i] = A[left + i];
    for (int i = 0; i < n2; i++) R[i] = A[mid + i];
    L[n1] = R[n2] = SENTINEL;
    int i = 0, j = 0;
    for (int k = left; k < right; k++) {
        cnt++;
        if (L[i] <= R[j]) {
            A[k] = L[i++];
        } else {
            A[k] = R[j++];
        }
    }
}

void mergeSort(int A[], int n, int left, int right) {
    if (left + 1 < right) {
        int mid = (left + right) / 2;
        mergeSort(A, n, left, mid);
        mergeSort(A, n, mid, right);
        merge(A, n, left, mid, right);
    }
}

int main() {
    int A[MAX], n, i;
    cnt = 0;
    
    cin >> n;
    for (i = 0; i < n; i++) cin >> A[i];
    
    mergeSort(A, n, 0, n);
    
    for (i = 0; i < n; i++) {
        if (i) cout << " ";
        cout << A[i];
    }
    cout << endl;
    
    cout << cnt << endl;
    
    return 0;
}


Measured memory_bytes: 6912
/*
Written By mafailure
*/
//In the name of God
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less
using namespace std;
using namespace __gnu_pbds;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
//#define int long long 
// int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1};
// int dx[]={2,2,-2,-2,1,1,-1,-1}; int dy[]={1,-1,1,-1,2,-2,2,-2};
const long long mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> ii;
typedef vector< pair< int, int > > vii;
typedef map<int, int> mii;
typedef pair<int, ii> pip;
typedef pair<ii, int> ppi;
#define arrinp(arr,init,final,size,type) type* arr=new type[size];for(int i=init;i<final;i++)cin>>arr[i];
#define cr2d(arr,n,m,t) t**arr=new t*[n];for(int i=0;i<n;i++)arr[i]=new t[m];
#define w(t) int t;cin>>t; while(t--)
#define takeInp(n) int n;cin>>n;
#define fr(i,init,final) for(int i=init;i<final;i++)
#define frr(i,init,final) for(int i=init;i>=final;i--)
#define Fr(i,final) for(int i=0;i<final;i++)
#define Frr(i,first) for(int i=first;i>=0;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define debug(x) cerr<<">value ("<<#x<<") : "<<x<<endl;
#define setb __builtin_popcount
#define lsone(n) (n&(-n))
#define rlsone(n) (n&(n-1))

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>  ordered_set; 
vi init(string s)
{
	istringstream sin(s);
	int n;
	vi arr;
	while(sin>>n)arr.push_back(n);
	return arr;
}
int power(int x, int y)
{ 
	if(y==0)return 1;
	int u=power(x,y/2);
	u=(u*u)%mod;
	if(y%2)u=(x*u)%mod;
	return u;
    
}
int gcd(int a,int b)
{
	if(a<b)return gcd(b,a);
	return (b==0?a:(a%b?gcd(b,a%b):b));
}
int gcd_e(int a,int b,int &x,int &y)
{
	
	if(b==0){x=1; y=0; return a;}
	int x1,y1;
	int p=gcd_e(b,a%b,x1,y1);
	x=y1;
	y=x1-(a/b)*y1;
	return p;
}
signed main()
{
	IOS
	int n,b,c;
	cin>>n>>b>>c;
	cout<<((n/b)+(n%b?1:0))*c<<endl;
	
}



Measured memory_bytes: 3636
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<complex>
#include<functional>
#include<vector>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<set>

const int MOD = 1000000007;

using namespace std;

long long mod_inv(long long value) {
 
    long long b = MOD, u = 1, v = 0;
 
    while (b) {
        long long t = value / b;
        value -= t * b;
        swap(value, b);
        u -= t * v;
        swap(u, v);
    }
    u %= MOD;
    if (u < 0) u += MOD;
 
    return u;
}

int main(){

    long long i,j=0,m,l,r,min=2019;
    cin >> l >> r;

    if(r-l>2019){
        cout << "0" << endl;
        return 0;
    }

    for(i=l;i<r;i++){
        for(j=i+1;j<r+1;j++){
            m = i*j;
            m%=2019;
            if(min > m)min = m;
        }
    }

    cout << min << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

const int L = 1000;

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    int cnt[L+1] = {0};
    for (int i = 0; i < n; i++) {
        int l;
        cin >> l;
        cnt[l]++;
    }

    int ps[L+1];
    for (int i = 0; i <= L; i++) {
        ps[i] = i == 0 ? 0 : ps[i-1] + cnt[i];
    }

    int ans = 0;
    for (int i = 1; i <= L; i++) {
        ans += 1ll * cnt[i] * (cnt[i] - 1) * (cnt[i] - 2) / 6;
    }

    for (int i = 1; i <= L; i++) {
        ans += cnt[i] * (cnt[i] - 1) / 2 * (ps[min(2*i-1,L)] - cnt[i]);
    }

    for (int i = 1; i <= L; i++) {
        for (int j = i + 1; j <= L; j++) {
            ans += cnt[i] * cnt[j] * (ps[min(i+j-1,L)] - ps[j]);
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include <stdlib.h>
int main(void){
    int data[6];
    char *result;
    for (int i=0; i < 6;i++){
        scanf("%d", &data[i]);
    }
  	//result = "Yay!";
    for (int i = 0; i <4;i++){
        for (int j = i+1; j < 5;j++){
            if(abs(data[j]-data[i])>data[5]){
              //result = ":(";
              puts(":(");
              return 0;
            }
        }
    }
  	puts("Yay!");
    //printf("%s", result);
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  int a,b;
  cin >> a >> b;
  if(a <= b)cout << "unsafe" << endl;
  else cout << "safe" << endl;
  return 0;
}

Measured memory_bytes: 3104
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int a;
    int b;
    scanf("%d %d",&a,&b);
    if (a>b) {
        printf("a > b\n");
    }else if (a<b){
        printf("a < b\n");
    }else {
        printf("a == b\n");
    }
    return 0;
}

Measured memory_bytes: 580
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;
const int maxn=1e5+5;
ll a[5][5],n,val,f;

int main()
{
    for(int i=1;i<=3;i++)
        for(int j=1;j<=3;j++)
            cin>>a[i][j];
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>val;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++)
                if(a[i][j]==val) a[i][j]=0;
    }
    if(!a[1][1] && !a[1][2] && !a[1][3]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[2][1] && !a[2][2] && !a[2][3]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[3][1] && !a[3][2] && !a[3][3]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[1][1] && !a[2][1] && !a[3][1]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[1][2] && !a[2][2] && !a[3][2]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[1][3] && !a[2][3] && !a[3][3]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[1][1] && !a[2][2] && !a[3][3]){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(!a[1][3] && !a[2][2] && !a[3][1]){
        cout<<"Yes"<<endl;
        return 0;
    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
#include <string>
#define loop(i,n) for(int i=0;i<(int)n;i++)

using namespace std;


int main()
{

string w;
cin>>w;
int a=1;

for(int i=0;i<w.size();i++){
    int c=1;
    for(int j=0;j<w.size();j++){

    if(j==i)
        continue;

        if(w[j]==w[i])
            c++;
    }
   if(c%2!=0){
        a=0;
        break;
    }

}
if(a==1)
    cout<<"Yes";
else
    cout<<"No";


}




Measured memory_bytes: 3628
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace A
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var hw1 = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var hw2 = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            Console.WriteLine((hw1[0] - hw2[0]) * (hw1[1] - hw2[1]));
        }
    }
}


Measured memory_bytes: 13396
# coding: utf-8

def check(table,i,j,h,w):
    if i < h-1:
        if table[i+1][j] == "#":
            return 1
    if i > 0:
        if table[i-1][j] == "#":
            return 1
    if j < w -1:
        if table[i][j+1] == "#":
            return 1
    if j > 0:
        if table[i][j-1] == "#":
            return 1
    return 0

input_num = input().split(" ")
h = int(input_num[0])
w = int(input_num[1])
table = []
for i in range(h):
    s = input()
    table.append([])
    for j in range(w):
        table[i].append(s[j])

output = "Yes"
for i in range(h):
    for j in range(w):
        if table[i][j] == "#":
            if check(table,i,j,h,w) == 0:
                output = "No"

print(output)

Measured memory_bytes: 3064
from collections import defaultdict
while True:
    n=input()
    if n==0:break
    L,T=[],[]
    dic=defaultdict(int)
    for i in range(n):
        ID,U,A,P=map(int,raw_input().split())
        L.append((-A,P,ID,U))
    L.sort()

    for A,P,ID,U in L:
        if len(T)<10:
            if dic[U]<3:
                T.append(ID)
                dic[U]+=1
        elif len(T)<20:
            if dic[U]<2:
                T.append(ID)
                dic[U]+=1
        elif len(T)<26:
            if dic[U]<1:
                T.append(ID)
                dic[U]+=1
    print "\n".join(map(str,T))

Measured memory_bytes: 4656
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main()
{
    int N;
    priority_queue<int, vector<int>, greater<int> > P;
    int c;
    int res = 0;

    cin >> N;

    rep(i, N)
    {
        cin >> c;
        if (P.empty())
            res++;
        else if (c < P.top())
            res++;
        P.push(c);
        //cout << res << endl;
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 1400
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <numeric>
using namespace std;

int main(void){
    int n, q;
    cin >> n >> q;
    string s;
    cin >> s;
    int count[s.length()+1];
    count[0]=0;
    for(int i = 1; i < s.length(); i++){
        if(s[i]=='C'&&s[i-1]=='A')
            count[i]=count[i-1]+1;
        else
            count[i]=count[i-1];
    }
    count[s.length()]=count[s.length()-1];
    int l[q], r[q];
    int ans[q];
    for(int i = 0; i < q; i++)
        cin >> l[i] >> r[i]; 
    for(int i = 0; i < q; i++){
        ans[i]=count[r[i]-1]-count[l[i]-1];
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 2560
import itertools
num=input()
count = 0
for i in range(3, len(num) + 1):
  for j in itertools.product([3,5,7], repeat=i):
    sumj = 0
    for k in range(i):
      sumj += j[k] * (10 ** (i-k-1))
    
    if '3' in (str)(sumj) and '5' in (str)(sumj) and '7' in (str)(sumj):
      if sumj <= (int)(num):
        count += 1
        #print(sumj)
      else:
        break
print(count)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

template <typename T>
using lim = numeric_limits<T>;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin >> n;
	cout << n*(n+1)/2 << "\n";
}

Measured memory_bytes: 256
#include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int f(int a[],int b[],int p,int m,int n,int s){
  int i;
  int c[20];
  int mn=abs(2*s-m);
  if(s<=m){
    for(i=p;i<n;i++){
      if(b[i]==0){
	memcpy(c,b,sizeof(c));
	c[i]=1;
	int t=f(a,c,i+1,m,n,s+a[i]);
	if(mn==-1||mn>t)
	  mn=t;
      }
    }
  }
  return mn;
}
int main(){
  int i;
  int a[20],b[20],n;
  int sm;
  memset(b,0,sizeof(b));
  while(cin>>n&&n){
    sm=0;
    for(i=0;i<n;i++){
      cin>>a[i];
      sm+=a[i];
    }
    cout<<f(a,b,0,sm,n,0)<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    A = LIST()

    cnt = 0
    for i in range(N-1):
        if A[i] > A[i+1]:
            cnt += A[i] - A[i+1]
            A[i+1] = A[i]

    print(cnt)


if __name__ == '__main__':
    main()


Measured memory_bytes: 32884
// 深さ優先探索
#include <algorithm>
#include <iostream>
#include <set>
#include <vector>
#include <cmath>
#include <utility>
#include <numeric>

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (int i=0;(i)<(n);(i)++)
#define repi(i, n) for (int i=0;(i)<=(n);(i)++)
#define repr(i, n) for (int i=n;(i)>=0;(i)--)
#define print(x) (cout<<x<<endl)

int main() {
    int n; cin>>n;
    vi p(n); rep(i,n) cin>>p[i];
    rep(i,n) p[i]--;  // 0-origin

    int cnt=0;
    rep(i,n) {
        if (i==p[i]) {
            cnt++;
            if (i<n-1) swap(p[i], p[i+1]);
        }
    }
    print(cnt);
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define P 1000000007
#define N 105 
int n,a,b;
int main(){
	scanf("%d %d %d",&n,&a,&b);
	int step=b-a-1;
	if(step&1)puts("Alice");
	else puts("Borys");
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

int N,A,B;
int h[100010];

bool check(int x) {
  int cnt = 0;
  REP(i,N) {
    int nh = h[i] - x*B;
    if (nh <= 0) continue;
    cnt += (nh + (A-B) - 1) / (A-B);
  }
  return cnt <= x;
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> N >> A >> B;
  REP(i,N) cin >> h[i];
  int ng = 0, ok = 1000000001;
  while (ok - ng > 1) {
    int mid = (ok + ng) / 2;
    if (check(mid)) ok = mid;
    else ng = mid;
  }
  cout << ok << endl;

  return 0;
}

Measured memory_bytes: 1024
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	// n := nextInt()
	var l [3]int
	for i := 0; i < 3; i++ {
		l[i] = nextInt()
	}
	x := l[1] + l[2] - l[0]
	if x > 0 {
		fmt.Println(x)
	} else {
		fmt.Println(0)
	}
}


Measured memory_bytes: 640
#include "bits/stdc++.h"
using namespace std;
#define ff first
#define ss second
#define pb push_back
typedef long long ll;
#define db(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<'\n'
const int inf = 1e9+7;
const int N = 1e6+9;

int main() {
    ios_base::sync_with_stdio(0);
    int a,b,n;
    cin>>n;
    // set<int> st;
    vector<int> v;
    for(int i=0;i<n;++i) {
        cin>>a;
        // st.insert(a);
        v.pb(a);
    }
    // for(int p: st) {
        // v.pb(p);
    // }
    sort(v.begin(), v.end());
    int cnt=0;
    for(int i=0;i<v.size();++i) {
        // cout<<v[i]<<endl;
        for(int j=i+1;j<v.size();++j) if(v[j]!=v[i]) {
            for(int k=j+1;k<v.size();++k) if(v[k]!=v[i] && v[k]!=v[j]) {
                if(v[i]+v[j]>v[k]) {
                    // cerr<<v[i]<<" "<<v[j]<<" "<<v[k]<<endl;
                    // cerr<<" "<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                    ++cnt;
                }
            }
        }
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;

#define trace(...) __f( #__VA_ARGS__ , __VA_ARGS__ )
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
        cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* na, Arg1&& arg1, Args&&... args) {
        const char* c = strchr(na + 1, ',');
        cerr.write(na, c - na) << " : " << arg1 << " , ";
        __f(c + 1, args...);
}
#define endl "\n"
#define all(V) V.begin(),V.end()
#define Unique(V) sort(all(V)), V.erase(unique(all(V)), V.end())
typedef pair <int,int> pii;
typedef long long LL;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int inf = 1e9;
const long long INF = 1e18;
const int N = 1e5 + 5;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    #ifdef LOCAL
        //freopen("input.txt", "r", stdin);
    #endif // LOCAL
    int t = 1; //cin >> t;
    for (int tc = 1; tc <= t; tc++) {
        int a, b;
        cin >> a >> b;
        cout << 6 - a - b << endl;
    }
    return 0;
}







Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll h, w; cin >> h >> w;
    vector<string> s(h);
    rep(i, h) cin >> s[i];

    const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
    const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

    vector<vector<char>> ans(h, vector<char>(w, 0));
    for(ll i=0; i<h; i++){
        for(ll j=0; j<w; j++){
            if(s[i][j] == '#') ans[i][j] = '#';
            else{
                ll bomb = 0;
                for(ll k=0; k<8; k++){
                    ll ni = i + dx[k];
                    ll nj = j + dy[k];
                    if(ni<0 || ni>=h) continue;
                    if(nj<0 || nj>=w) continue;
                    if(s[ni][nj] == '#') bomb++;
                }
                ans[i][j] = bomb+'0';
            }
        }
    }

    for(ll i=0; i<h; i++){
        for(ll j=0; j<w; j++){
            cout << ans[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
# C - Christmas Eve
N, K = map(int, input().split())
h = []
for i in range(N):
    h.append(int(input()))

h.sort()

sa = []
for i in range(0, N + 1 - K):
    h1 = h[i]
    h2 = h[i + K - 1]
    sa.append(h2 - h1)

print('%d' % (min(sa)))


Measured memory_bytes: 11288
#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main(){
	int n, q;
	cin >> n >> q;

	vector<tuple<ll, ll, ll>> event;
	for(int i=0; i<n; i++){
		ll s, t, x;
		cin >> s >> t >> x;
		event.push_back(make_tuple(s-x, 0, x));
		event.push_back(make_tuple(t-x, -1, x));
	}
	for(int i=0; i<q; i++){
		ll d;
		cin >> d;
		event.push_back(make_tuple(d, 1, i));
	}
	sort(event.begin(), event.end());

	ll ans[q];
	multiset<ll> s;
	for(int i=0; i<event.size(); i++){
		ll x=get<0>(event[i]), y=get<1>(event[i]), z=get<2>(event[i]);
		if(y==0) s.insert(z);
		else if(y==-1) s.erase(z);
		else{
			if(s.empty()) ans[z]=-1;
			else ans[z]=*s.begin();
		}
	}
	for(int i=0; i<q; i++) cout << ans[i] << endl;
	return 0;
}

Measured memory_bytes: 26856
def prime_factorize(N): #素因数分解
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

N = int(input())

f = prime_factorize(N)
ans = []
for i in range(len(f)):
    for j in range(f[i][1]):
        ans.append(f[i][0])

##print(str(N)+": "+" ".join(ans))

print(str(N) + ": ",end="")
print(*ans)


Measured memory_bytes: 5600
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false); cin.tie(0);
	string s;
	cin >> s;
	int w;
	cin >> w;
	string ans;
	for (int i = 0; i < (int) s.length(); i += w) {
		ans += s[i];
	}
	cout << ans << endl;
	return 0;	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  int mx = tx-sx;
  int my = ty-sy;
  for (int i = 0; i < mx; i++) cout << "R";
  for (int i = 0; i < my; i++) cout << "U";
  for (int i = 0; i < mx; i++) cout << "L";
  for (int i = 0; i < my+1; i++) cout << "D";
  for (int i = 0; i < mx+1; i++) cout << "R";
  for (int i = 0; i < my+1; i++) cout << "U";
  cout << "L" << "U";
  for (int i = 0; i < mx+1; i++) cout << "L";
  for (int i = 0; i < my+1; i++) cout << "D";
  cout << "R" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(a, b) for (ll i = a; i < b + 1; i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template<class T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}

ll extgcd(ll a, ll b, ll &x, ll &y)
{
    ll d = a;
    if (b != 0)
    {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }
    else
    {
        x = 1;
        y = 0;
    }
    return d;
}

int main(){
    ll n,m;
    cin >> n >> m;
    vector<ll> a(n);
    ll lcm=1;
    ll x,y;
    bool isOdd=false;
    REP(i,n){
        cin >> a[i];
        a[i]/=2;
        if(i==0){
            isOdd=((a[i]%2==1)?(true):(false));
        }
        else{
            if(isOdd){
                if(a[i]%2==0){
                    cout << 0 << endl;
                    return 0;
                }
            }
            else{
                if(a[i]%2==1){
                    cout << 0 << endl;
                    return 0;
                }
            }
        }
        lcm=lcm*a[i]/extgcd(lcm,a[i],x,y);
    }
    REP(i,n){
        if((lcm/a[i])%2==0){
            cout << 0 << endl;
            return 0;
        }
    }
    cout << ((m/lcm)+1)/2 << endl;
}

Measured memory_bytes: 1024
n=int(input())
a=[]
l=[0]*n
ans=0
for i in range(n):
	a.append(int(input()))
	l[i]=[list(map(int,input().split())) for i in range(a[-1])]
#print(a,l)
for i in range(2**n):
	i=format(i,'b').zfill(n)
	c=[]
	for j in range(n):
		if i[j]=='1':
			c.append(j)
	#print(c,l)
	for j in c:
		for k in l[j]:
			#print(k)
			if k[1]==1 and (k[0]-1 not in c):
				break
			elif k[1]==0 and (k[0]-1 in c):
				break
		else:
			continue
		break
	else:
		#print(ans)
		ans=max(ans,len(c))
print(ans)




Measured memory_bytes: 48364
#pragma region Macros
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define REP2(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; ++i)
#define REP3(i, l, r) for (int i = (l), i##_len = (int)(r); i < i##_len; ++i)
#define GET_MACRO_REP(_1, _2, _3, NAME, ...) NAME
#define REP(...) GET_MACRO_REP(__VA_ARGS__, REP3, REP2) (__VA_ARGS__)
#define RREP2(i, n) for (int i = (n - 1); i >= 0; --i)
#define RREP3(i, l, r) for (int i = (r - 1), i##_len = (l); i >= i##_len; --i)
#define GET_MACRO_RREP(_1, _2, _3, NAME, ...) NAME
#define RREP(...) GET_MACRO_REP(__VA_ARGS__, RREP3, RREP2) (__VA_ARGS__)
#define IN(type, n) type n; cin >> n
#define INALL(type, v) REP(i, v.size()) { IN(type, _tmp); v.at(i) = _tmp; }
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#ifdef _DEBUG
#define DEBUG(x) cout << #x << ": " << x << endl
#else
#define DEBUG(x)
#endif

template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#pragma endregion

// int solve2(ll N) {
//   ll mod = 1000000007;
//   ll count = 0;
//   REP(i, N) {
//     ll n = i;
//     vector<ll> check(10, 0);
//     while(n > 0) {
//       check.at(n % 10) = 1;
//       n /= 10;
//     }
//     if (check.at(0) == 1 && check.at(9) == 1) count++;
//     count %= mod;
//   }
// }

int main() {
  IN(ll, N);
  ll mod = 1000000007;
  ll ans = 1;
  ll all = 1;
  ll other = 1;
  REP(i, N) {
    ans *= 9;
    ans %= mod;
    all *= 10;
    all %= mod;
    other *= 8;
    other %= mod;
  }
  ans = all - (ans * 2) % mod + other;
  if (ans <= 0) ans += mod;
  ans %= mod;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3512
#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <float.h>
#include <stdlib.h>
#include <functional>
#include <limits>
#include <numeric>
#include <type_traits>
#include <queue>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define in cin >>
#define out cout <<
#define sort1(v) sort(v.begin(),v.end())
#define reverse(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
typedef long long ll;
bool paircom (pair<int,int> p,pair<int,int> q){
return p.first<q.first;
}
int main() {
  int intmax = 2147483647;
  int n;
  cin >> n;
  vector<int> l(n+5);
  vector<int> r(n+5);
  fill(all(l),intmax);
  fill(all(r),intmax);
  int r1,l1;
  vector<pair<int,int> > p(n+5);
  for(int i=0;i<n;i++){
      cin >> l1 >> r1;
      pair<int,int> q(l1,r1);
      p[i]=q;
  }
  sort(p.begin(),p.end()-5,paircom);
for(int i=0;i<n;i++){
      l[i]=p[i].first;
      r[i]=p[i].second;    
    
  }
  vector<int> minr1(n+5);
  minr1[0]=r[0];
  for(int i=1;i<n;i++){
      minr1[i]=min(minr1[i-1],r[i]);

  }
  vector<int> minr2(n+5);
  minr2[n-1]=r[n-1];
  for(int i=n-2;i>0;i--){
      minr2[i]=min(minr2[i+1],r[i]);
 
  }

  int a,b;
  ll ans,bef;
  ans=0;bef=0;
  for(int i=1;i<n;i++){
      bef=ans;
      a=0;b=0;

      if(minr1[i-1]>=l[i-1])a=minr1[i-1]-l[i-1]+1;

      if(minr2[i]>=l[n-1])b=minr2[i]-l[n-1]+1;
    
      ans=a+b;
      ans=max(ans,bef);
      
  }
  int lr=r[0]-l[0]+1;
  int rs,ls,t;
  t=0;
  for(int i=1;i<n;i++){
      if(r[i]-l[i]+1>=lr){rs=r[i];ls=l[i];t=i;}else{}

      lr=max(lr,r[i]-l[i]+1);

  }
  r.erase(r.begin()+t);
  l.erase(l.begin()+t);
  int minr3=r[0];
  if(n==2){}else{
  for(int i=1;i<n-1;i++){
      minr3=min(minr3,r[i]);
  }
  }
  
  ll ans2=max(minr3-l[n-2]+1,0)+lr;
  ans=max(ans2,ans);
  cout << ans << endl;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000

void solve_abc_a() {
	ll n, m;
	ll x, y;
	ll a, b, d;
	ll c;
	//char c;
	ll h, w;
	ll k;
	string s, t;
	ll l_ans = 0;
	string s_ans = "NG";
	ll l, r;

	V p(3);
	cin >> p[0] >> p[1] >> p[2];

	sort(ALL(p));

	if (p[0] == 5 && p[1] == 5 && p[2] == 7) {
		s_ans = "YES";
	}
	else {
		s_ans = "NO";
	}

	cout << s_ans << "\n";

	return;
}


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed;
	cout << setprecision(7);

	solve_abc_a();

	return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
char s[100];
int main() {
	scanf("%s", s);
	int ans = 0;
	for (int i = 0; s[i]; ++i) ans += s[i] - '0';
	ans = max(ans, int(s[0] - '1' + strlen(s + 1) * 9));
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>

using namespace std;

const int nax = 1e5 + 5;

vector<int> edges[nax];
int in_degree[nax];
int dist[nax];
bool vis[nax];

void dfs(int u){
    vis[u] = true;
    for(auto v : edges[u]){
        dist[v] = max(dist[v] , dist[u] + 1);
        --in_degree[v];
        if(!in_degree[v]){
            dfs(v);
        }
    }
}

int main (){
    int n , m;
    scanf("%d %d" , &n , &m);
    for(int i = 0; i < m; ++i){
        int u , v;
        scanf("%d %d" , &u , &v);
        edges[u].emplace_back(v);
        ++in_degree[v];
    }
    for(int i = 1; i <= n; ++i){
        if(!vis[i] && !in_degree[i]){
            dfs(i);
        }
    }
    int ans = 0;
    for(int i = 1; i <= n; ++i){
        ans = max(ans , dist[i]);
    }
    printf("%d" , ans);
return 0;
}


Measured memory_bytes: 9728
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
map<ll, ll> prime_factor(ll n) {
  map<ll, ll> ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}

vector<int> to[2505];
vector<int> rto[2505];
bool reachablefrom1[2505];
bool reachableToN[2505];
bool ok[2505];

void dfs(int v) {
  if (reachablefrom1[v]) return;
  reachablefrom1[v] = true;
  for (int u : to[v]) {
    dfs(u);
  }
}
void rdfs(int v) {
  if (reachableToN[v]) return;
  reachableToN[v] = true;
  for (int u : rto[v]) {
    rdfs(u);
  }
}

int main() {
  ll n = in();
  vl l(n); cin >> l; sort(l.rbegin(), l.rend());
  ll ans = 0;
  //ll cnt = 0;
  for (int i = 0; i < n - 2; i++)
    for (int j = i + 1; j < n - 1; j++)
      for (int k = j + 1; k < n; k++) {
        //cnt++;
        if (l[i] < l[j] + l[k]) ans++;
        else break;
      }
  cout << ans << endl;
  //cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> V;
const long long MOD=1000000007LL;
const long long INFL=1LL << 60;
const int INF=1<<29;


int main() {
    int N;
    cin >>N;
    vector<string> S(N);
    for(int i=0;i<N;i++) cin >>S.at(i);
    vector<bool> startB(N,false),endA(N,false);
    int cnt=0;
    for(int i=0;i<N;i++){
        if(S.at(i)[0]=='B') startB.at(i)=true;
        for(int j=0;j<S[i].length()-1;j++){
            if(S.at(i)[j]=='A'&&S.at(i)[j+1]=='B') cnt++;
        }
        if(S.at(i)[S[i].length()-1]=='A') endA.at(i)=true;
    }
    int x=0,y=0,z=0;
    for(int i=0;i<N;i++){
        if(startB[i]&&endA[i])z++;
        else if(startB[i])y++;
        else if(endA[i])x++;
    }
    if(x>0&&y>0)cout<<cnt+z-1+2+min(x-1,y-1)<<endl;
    else if(x>0||y>0)cout<<cnt+z<<endl;
    else if(z>0)cout <<cnt+z-1<<endl;
    else cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 896