akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define pq priority_queue
#define um unordered_map
#define lb lower_bound
#define ub upper_bound
#define F first
#define B begin()
#define E end()
#define ln length()
#define sz size()
#define S second
#define em empty()
#define what_is(x) cerr << #x << " is " << x << endl;
#define ch(x) (x - 'a' + 1)
#define mp make_pair
#define pb push_back
#define loop(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define scan(x, n) loop(i, 0, n) cin >> x[i];
#define adde(g, u, v) g[u].pb(v), g[v].pb(u);
#define addew(g, u, v, w) g[u].pb({ v, w }), g[v].pb({ u, w });
#define print(x, n) loop(i, 0, n) cout << x[i] << " ";
#define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define inf 10000000000
#define mod 1000000007

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef pair<long, long> pll;
typedef vector<ii> vii;
typedef vector<pll> vll;
typedef um<int, int> umii;
typedef um<char, int> umci;
typedef map<char, int> mci;
typedef map<int, int> mii;

struct Job {
    int deadline, duration, idx;

    bool operator<(Job o) const
    {
        return deadline < o.deadline;
    }
};

int compute_schedule(vector<Job> jobs)
{
    sort(jobs.B, jobs.E);

    set<pair<int, int>> s;
    vector<int> schedule;
    for (int i = jobs.size() - 1; i >= 0; i--) {
        int t = jobs[i].deadline - (i ? jobs[i - 1].deadline : 0);
        s.insert({ jobs[i].duration, jobs[i].idx });
        while (t && !s.em) {
            auto it = s.B;
            if (it->F <= t) {
                t -= it->F;
                schedule.pb(it->S);
            } else {
                s.insert(make_pair(it->F - t, it->S));
                t = 0;
            }
            s.erase(it);
        }
    }
    return schedule.sz;
}
int main()
{
    fast;
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    ii p[n];
    vector<Job> jobs;
    for (int i = 0; i < n; i++) {
        Job j;
        cin >> j.duration >> j.deadline;
        j.idx = i;
        jobs.pb(j);
    }
    cout << (compute_schedule(jobs) == n ? "Yes" : "No");
}


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

int main() {
  int a,b,c;
  cin>>a>>b>>c;

  if (a<=c && c <= b) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long mod=1000000000+7;
const long long INF=-mod;

//マクロ
//型エイリアス
using ll = long long;
using P=pair<long long,long long>;
using vl=vector<long long>;
//ショートカット
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,k,n) for(int i=k;i<n;i++) //半開区間
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
//入力
#define vin(v,N) for(long long i=0;i<N;i++) cin>>v.at(i)
#define lin(n) long long n;cin>>n
#define vlin(v,N) vector<long long>v(N);for(long long i=0;i<N;i++)cin>>v.at(i)

//関数
//最大公約数
long long gcd(long long m,long long n){
  long long a=max(m,n);
  long long b=min(m,n);
  long long r=a%b;
  while(r!=0){
    a=b; b=r; r=a%b;
  }
  return b;
}
// 最小公倍数
long long lcd(long long m,long long n){
  return m*n/gcd(m,n);
}
//xのn乗
long long power(long long x,long long N){
  long long ret=1;
  for(long long i=0;i<N;i++)   
    ret*=x;
  return ret;
}
//nCr
long long C(long long n, long long r);
//nCr (mod)
long long modC(long long n, long long r) {
    vector<long long> f(n+1),inv(n+1),invf(n+1);
    f[0]=f[1]=1;
    invf[0]=invf[1]=1;
    inv[1]=1;
    for (long long i=2;i<n+1;i++) {
        f[i]=(i*f[i-1])%mod;
        inv[i]=mod-((mod/i)*inv[mod%i])%mod;
        invf[i]=(inv[i]*invf[i-1])%mod;
    }
    long long cmb=f[n]*(invf[r]*invf[n-r]%mod)%mod;
    if (n>=r) return cmb;
    else return 0;
}
//素因数分解(mapで返す)
map<long long,long long> factor(long long p){
  ll p1=p;
  map<long long,long long>ret;
  for(long long i=2;i*i<=p1;i++){
     while(p%i==0){
      ret[i]++;
      p/=i;
    }
  }
  if(p!=1)
  ret[p]++;
  return ret;
}
//素数判定
bool is_prime(long long N){
  for(long long i=2;i*i<=N;i++){
    if(N%i==0)
      return false;
  }
  return true;
}
//最大値更新
void chmax(long long &a,long long b){
  a=max(a,b);
}
//最小値更新
void chmin(long long &a,long long b){
  a=min(a,b);
}

//メイン関数
int main(){
  //doubleの桁数
  cout<<fixed<<setprecision(10);
  
  lin(a);lin(b);
  
  cout<<6-a-b;
}

Measured memory_bytes: 256
import std.stdio;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.ascii;
void times(alias fun)(int n) {
    foreach(i; 0..n) fun();
}
auto rep(alias fun, T = typeof(fun()))(int n) {
    T[] res = new T[n];
    foreach(ref e; res) e = fun();
    return res;
}
// fold was added in D 2.071.0.
template fold(fun...) if (fun.length >= 1) {
    auto fold(R, S...)(R r, S seed) {
        static if (S.length < 2) {
            return reduce!fun(seed, r);
        } else {
            return reduce!fun(tuple(seed), r);
        }
    }
}

void main() {
    readln.chomp.to!int.pipe!(N => N*(N+1)/2).writeln;
}


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

typedef long long ll;
typedef pair<int, int> pii;

ll h, w;
set<pii> points;

void add_points(int y, int x) {
    if (0 <= y && y < h - 2 && 0 <= x && x < w - 2) {
        points.insert(pii(y, x));
    }
}

int main() {
    int n;
    cin >> h >> w >> n;
    set<pii> f;
    
    for (int i = 0; i < n; i++) {
        ll a, b;
        cin >> a >> b;
        a--;
        b--;
        f.insert(pii(a, b));
        for (int dx = 0; dx <= 2; dx++) {
            for (int dy = 0; dy <= 2; dy++) {
                add_points(a - dy, b - dx);
            }
        }
    }
    ll ans[10];
    for (int i = 0; i < 10; i++) {
        ans[i] = 0;
    }
    
    ans[0] = (ll)(h - 2) * ( w - 2);
    for (pii p : points) {
        int y = p.first;
        int x = p.second;
        int num = 0;
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (f.count(pii(y + j, x + k))) {
                    num++;
                }
            }
        }
        ans[0]--;
        ans[num]++;
    }
    
    for (int i = 0; i < 10; i++) {
        cout << ans[i] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 47104
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0
for a in range(min([A,-(-X//500)])+1):
    _a = a*500
    for b in range(min([B,-(-X//100)])+1):
        _b = b*100 + _a
        if _b > X: break
        for c in range(min([C,-(-X//50)])+1):
            _c = c*50 + _b
            if _c > X: break
            if _c == X:
                cnt+=1
print(cnt)

Measured memory_bytes: 9148
#include <stdio.h>

int main(){
	int a,b,c,d,i=0;
	
	scanf("%d %d %d",&a,&b,&c);
	d = a;
	while(d <= b){
		if(c % d == 0){
		i++;
		}
		d++;
		
	}printf("%d\n",i);
	
	return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

int main() {
    ll W, H, x, y;
    cin >> W >> H >> x >> y;

    printf("%.9f ", W * H / 2.0);
    if (H % 2 == 0 && y == H / 2 && W % 2 == 0 && x == W / 2) {
        printf("%d\n", 1);
    }
    else {
        printf("%d\n", 0);
    }
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
const int INF = (1LL<<30);
const ll LLINF = (1LL<<60);
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;
//#define int ll

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

signed main(void)
{
  int i, o, t, j, l, s, z;
  cin >> i >> o >> t >> j >> l >> s >> z;
  ll ret = 0;
  int flag = 0;
  if(i%2) flag++;
  if(j%2) flag++;
  if(l%2) flag++;
  if(flag >= 2) {
    // int ii = i, jj = j, l2 = l;
    if(i && j && l) {
      ret += 3;
      i--, j--, l--;
    }
    ret += (i/2)*2; i -= i/2;
    ret += (j/2)*2; j -= j/2;
    ret += (l/2)*2; l -= l/2;
    ret += o;

    // ll rret = 0;
    // rret += min({ii, jj, l2})*3;
    // int tmp = min({ii, jj, l2});
    // ii -= tmp; jj -= tmp; l2 -= tmp;
    // rret += (ii/2)*2; ii -= ii/2;
    // rret += (jj/2)*2; jj -= jj/2;
    // rret += (l2/2)*2; l2 -= l2/2;
    // rret += o;
    // chmax(ret, rret);
  } else {
    ret += (i/2)*2; i -= i/2;
    ret += (j/2)*2; j -= j/2;
    ret += (l/2)*2; l -= l/2;
    ret += o; o = 0;
    // ret += min({i, j, l})*3;
    // int tmp = min({i, j, l});
    // i -= tmp; j -= tmp; l -= tmp;
  }
  cout << ret << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>


#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define DEBUG freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define int long long
using namespace std;

signed main() {
    FAST_IO;
    //DEBUG;

    // Knapsack 0/1

    int n, m; // coins, total wt
    cin >> n >> m;
    int val[n + 1], wt[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> wt[i];
        cin >> val[i];
    }

    int dp[n + 1][m + 1]; // item, weight
    for (int i = 0; i <= n; i++) dp[i][0] = 0;
    for (int i = 0; i <= m; i++) dp[0][i] = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            if (j < wt[i]) dp[i][j] = dp[i - 1][j];
            else dp[i][j] = max(val[i] + dp[i - 1][j - wt[i]], dp[i - 1][j]);
        }
    }
    cout << dp[n][m];
    return 0;
}

Measured memory_bytes: 79232
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while(true){
			String tmpStr = br.readLine();
			if(tmpStr == null){
				break;
			}

			String[] tmpArray = tmpStr.split(" ");
			//int num1;

			int num1 = Integer.parseInt(tmpArray[0]);
			int num2 = Integer.parseInt(tmpArray[1]);

			int sum = num1 + num2;

			int keta = 0;
			for (keta = 0; sum > 0 ; keta++ ){
				sum /= 10;
			}
			System.out.println(keta);
		}


	}

}

Measured memory_bytes: 24068
#include <stdio.h>
int main(){
	int i,n;
	scanf("%d\n",&n);
	for(i=3; i<=n; i++){
		if(i%3==0 || i%10==3 ||i/10%10 ==3 || i/100%10==3 || i/1000%10 ==3){
			printf(" %d",i);
		}
		
	}
	printf("\n");
	return 0;
}



Measured memory_bytes: 2100
// CODING BEAST
/*******************************************************************************************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define sum(a)     ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a)    (*min_element((a).begin(), (a).end()))
#define maxe(a)    (*max_element((a).begin(), (a).end()))
#define mini(a)    ( min_element((a).begin(), (a).end()) - (a).begin())
#define maxi(a)    ( max_element((a).begin(), (a).end()) - (a).begin())
#define lowb(a, x) ( lower_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define uppb(a, x) ( upper_bound((a).begin(), (a).end(), (x)) - (a).begin())
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define Precision(a) cout << fixed << setprecision(a)

using ll = long long;
ll inf = 1e18;
using vb = vector<bool>; using vc = vector<char>; using vd = vector<double>; using vi = vector<int>; using vvi = vector<vi>;
using vll = vector<ll>; using vvll = vector<vll>; using pi = pair<int, int>; using pll = pair<ll, ll>;
#define endl "\n"
#define pb push_back
#define mp make_pair
#define rep(i,n) for(ll i = 0; i < n; i++)
#define repc(i,a,n) for(ll i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define pow2(x) (1ll<<(x))
#define Blazing_fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define trav(a,v) for(auto &a:v)
int a[8] = { -1, -1, -1, 0, 0, 1, 1, 1};
int b[8] = { -1, 0, 1, -1, 1, -1, 0, 1};
inline ll power(ll x, ll y)
{
    ll temp;
    if ( y == 0)
        return 1;
    temp = power(x, y / 2) ;
    if (y % 2 == 0)
        return (temp * temp) ;
    else
        return (x * temp * temp) ;
}
bool sortbysec(pll & a, pll & b) {
    return (a.second < b.second);
}
/*
ll fact(ll n)
{
    ll res = 1;
    for (ll i = 2; i <= n; i++)
        res = (res * i) ;
    return res;
}

ll ncr(ll n, ll r)
{
    return fact(n) / (fact(r) * fact(n - r));
}
bool isprime(ll n) {
    if (n <= 1) return false;
    if (n <= 3) return true;
    if ((n % 2 == 0) || (n % 3 == 0)) return false;
    for (ll i = 5; i * i <= n; i = i + 6)
        if ((n % i == 0) || (n % (i + 2) == 0)) return false;

    return true;
}*/
/*********************************************************************************************************************************************************/
signed main() {
    ll  n, d;
    cin >> n >> d;
    ll ans = 0;
    rep(i, n) {
        ll a, b;
        cin >> a >> b;
        if (sqrt((a * a) + (b * b)) <= d) {
            ans++;
        }
    }
    cout << ans << endl;
}




Measured memory_bytes: 3668
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))
#define iter(v,ite) for(auto ite=(v).begin();ite!=(v).end();ite++)
#define mimunum(v,x) distance((v).begin(),lower_bound((v).begin(),(v).end(),x))

lli n,m;
int main(void){
	scanf("%lld%lld",&n,&m);
	printf("%lld\n",min((n*2+m)/4,m/2));
	return 0;
}






Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

//---------------------------------------------------------------
// ------ graph ------ //
using Weight = int;
using Flow = int;
struct Edge {
    int src, dst;
    Weight weight;
    Flow cap;
    Edge() : src(0), dst(0), weight(0) { }
    Edge(int s, int d, Weight w) : src(s), dst(d), weight(w) { }
};
bool operator < (const Edge &e, const Edge &f) {
    return e.weight != f.weight ? e.weight > f.weight : // pqが降順のため
        e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;
void add_edge1(Graph &g, int a, int b, Weight w = 1) {
    g[a].emplace_back(a, b, w);
}
void add_edge2(Graph &g, int a, int b, Weight w = 1) {
    g[a].emplace_back(a, b, w);
    g[b].emplace_back(b, a, w);
}
void add_arc(Graph &g, int a, int b, Weight w = 1) {
    g[a].emplace_back(a, b, w);
}
//---------------------------------------------------------------

int main() {
    int n; cin >> n;
    Matrix M(n, Array(n, 0));
    for (int i = 0; i < n; i++) {
        int u, k; cin >> u >> k;
        while (k--) {
            int v; cin >> v; M[u - 1][v - 1]++;
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cout << M[i][j] << " \n"[j == n - 1];
        }
    }
    return 0;
}


Measured memory_bytes: 3148
#include<iostream>
 
using namespace std;
 
int main(){
 
  int n, m, t, a[100];
 
  cin>>n>>m>>t;
  for(int i=0;i<n;i++) cin>>a[i];
 
  int ans=0;
  for(int i=1;i<n;i++){
    if(a[i]-a[i-1]>m*2) ans+=a[i]-a[i-1]-m*2;
  }
  ans+=max(0, a[0]-m);
  ans+=max(0, t-a[n-1]-m);
 
  cout<<ans<<endl;
   
   
  return 0;
}

Measured memory_bytes: 3100
#include<iostream>
#include<sstream>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<cfloat>
#include<functional>
#include<map>
#include<string>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<bitset>
#include<list>
#include<numeric>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;
typedef vector<int> Vint;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define ll2(x, y) ll x, y; cin >> x >> y;
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int2(n, k);
    bool d[10] = {false};
    rep(i, k){
      int(x);
      d[x] = true;
    }

    for(;;n++){
      bool fl = false;
      int tmp = n;
      rep(i, 10){
        if(d[tmp % 10])break;
        tmp /= 10;
        if(tmp == 0){fl = true; break;}
      }
      if(fl){
        pri(n); break;
      }
    }

/*/

//*/ break;
  }
  return 0;
}


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

#define MOD 1000000007

long long ipow(long long b, long long e) {
	if (e == 0) {
		return 1;
	} else if (e % 2 == 0) {
		return ipow(b * b % MOD, e / 2) % MOD;
	} else {
		return ipow(b * b % MOD, e / 2) * b  % MOD;
	}
}

int main() {
	int m, n;
	cin >> m >> n;
	cout << ipow(m, n) % MOD << endl;
	return 0;
}



Measured memory_bytes: 3104
N = int(input())
a = [int(i) for i in input().split()]

ans = [0 for i in range(N)]

for i in reversed(range(1, N+1)):
    tmp = 0
    for j in range(i, N+1, i):
        tmp += ans[j-1]
    if tmp % 2 != a[i-1]:
        ans[i-1] = 1

anslist = []
for i in range(N):
    if ans[i] == 1:
        anslist.append(i+1)

print(len(anslist))
print(*anslist)

Measured memory_bytes: 14136
N = int(input())
mod = 10**9 + 7

dp_A = [1] + [0] * (N + 5)
dp_G = [1] + [0] * (N + 5)
dp_C = [1] + [0] * (N + 5)
dp_T = [1] + [0] * (N + 5)
dp_AG = [0] * (N + 5)
dp_AC = [0] * (N + 5)
dp_GA = [0] * (N + 5)
dp_AGA = [0] * (N + 5)
dp_AGG = [0] * (N + 5)
dp_AGT = [0] * (N + 5)
dp_AAG = [0] * (N + 5)
dp_AGG = [0] * (N + 5)
dp_ATG = [0] * (N + 5)
dp_ok = [4] + [0] * (N + 5)
#ng=AGC,ACG,GAC,AG*C,A*GC
for i in range(1, N):
    dp_A[i] = dp_ok[i - 1]
    dp_C[i] = dp_ok[i - 1] - dp_AG[i - 1] - dp_GA[i - 1] - dp_AGG[
        i - 1] - dp_AGT[i - 1] - dp_ATG[i - 1]
    dp_C[i] %= mod
    dp_G[i] = dp_ok[i - 1] - dp_AC[i - 1]
    dp_G[i] %= mod
    dp_T[i] = dp_ok[i - 1]
    dp_T[i] %= mod
    dp_AG[i] = dp_A[i - 1]
    dp_AG[i] %= mod
    dp_AC[i] = dp_A[i - 1] - dp_GA[i - 1]
    dp_AC[i] %= mod
    dp_GA[i] = dp_G[i - 1]
    dp_GA[i] %= mod
    dp_AGG[i] = dp_AG[i - 1]
    dp_AGG[i] %= mod
    dp_AGT[i] = dp_AG[i - 1]
    dp_AGT[i] %= mod
    dp_ATG[i] = dp_A[i - 2]
    dp_ATG[i] %= mod
    dp_ok[i] = dp_A[i] + dp_C[i] + dp_G[i] + dp_T[i]
    dp_ok[i] %= mod
print(dp_ok[N - 1])


Measured memory_bytes: 3192
#include <bits/stdc++.h>
#define ll long long
#define ld long double
int main()
{
    ll n;
    ll k;
    ll total = 0;
    ll ans;
    ll zero_max = 0;
    std::vector<ll> A;
    std::cin >> n >> k;
    for (ll i = 0; i < n; ++i) {
        ll temp;
        std::cin >> temp;
        A.push_back(temp);
        total += temp;
        zero_max = std::max(temp, zero_max);
    }
    if (k == 0) {
        std::cout << zero_max << std::endl;
        return 0;
    }
    ll mid;
    ll left = 0;
    ll right = zero_max;
    while ((right - left) > 1) {
        mid = (left + right) / 2;

        ll temp_count = 0;
        for (ll j = 0; j < n; ++j) {
            temp_count += ((A[j] + mid - 1) / mid - 1);
        }
        //std::cout << mid << " " << temp_count << std::endl;

        if (temp_count <= k) {
            right = mid;
        } else {
            left = mid;
        }
    }
    std::cout << right << std::endl;
    return 0;
}


Measured memory_bytes: 5280
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}



int main() {
	
	string s;
	cin >> s;
	if (s.size() < 7) {
		cout << "NO" << endl;
		return 0;
	}
	if(
		(s[s.size() - 7] == 'k' &&
		s[s.size() - 6] == 'e' &&
		s[s.size() - 5] == 'y' &&
		s[s.size() - 4] == 'e' &&
		s[s.size() - 3] == 'n' &&
		s[s.size() - 2] == 'c' &&
		s[s.size() - 1] == 'e'
		)
		||
		(s[0] == 'k' &&
			s[s.size() - 6] == 'e' &&
			s[s.size() - 5] == 'y' &&
			s[s.size() - 4] == 'e' &&
			s[s.size() - 3] == 'n' &&
			s[s.size() - 2] == 'c' &&
			s[s.size() - 1] == 'e'
			)
		||
		(s[0] == 'k' &&
			s[1] == 'e' &&
			s[s.size() - 5] == 'y' &&
			s[s.size() - 4] == 'e' &&
			s[s.size() - 3] == 'n' &&
			s[s.size() - 2] == 'c' &&
			s[s.size() - 1] == 'e'
			)
		||
		(s[0] == 'k' &&
			s[1] == 'e' &&
			s[2] == 'y' &&
			s[s.size() - 4] == 'e' &&
			s[s.size() - 3] == 'n' &&
			s[s.size() - 2] == 'c' &&
			s[s.size() - 1] == 'e'
			)
		||
		(s[0] == 'k' &&
			s[1] == 'e' &&
			s[2] == 'y' &&
			s[3] == 'e' &&
			s[s.size() - 3] == 'n' &&
			s[s.size() - 2] == 'c' &&
			s[s.size() - 1] == 'e'
			)
		||
		(s[0] == 'k' &&
			s[1] == 'e' &&
			s[2] == 'y' &&
			s[3] == 'e' &&
			s[4] == 'n' &&
			s[s.size() - 2] == 'c' &&
			s[s.size() - 1] == 'e'
			)
		||
		(s[0] == 'k' &&
			s[1] == 'e' &&
			s[2] == 'y' &&
			s[3] == 'e' &&
			s[4] == 'n' &&
			s[5] == 'c' &&
			s[s.size() - 1] == 'e'
			)

		||
		(s[0] == 'k' &&
			s[1] == 'e' &&
			s[2] == 'y' &&
			s[3] == 'e' &&
			s[4] == 'n' &&
			s[5] == 'c' &&
			s[6] == 'e'
			)
		)
	{
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}

}




Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<functional>
#include<numeric>
#include<queue>
#include<stack>
#include<map>
#include<unordered_map>
#include<set>
#include<bitset>
#include<random>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 2222222222222222222LL;
const ll mod = 1000000007LL;

ll n = 0, m = 0, ans = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok;
ll dx[9] = { 0,1,-1,0,0,1,1,-1,-1 }, dy[9] = { 0,0,0,1,-1,1,-1,1,-1 };
#define endl '\n'
#pragma endregion
#define MAX 222222






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



  vll a(5);
  rep(i, 5)cin >> a[i];
  rep(i, 5) {
    if (a[i] % 10) mi = min(mi, a[i] % 10);
  }
  rep(i, 5) {
    ans += ((a[i] + 9) / 10) * 10;
  }
  if (mi != inf) ans -= 10 - mi;
  cout << ans << endl;





  return 0;
}

Measured memory_bytes: 256
import itertools
Row = int(input())
List = []
l=[]
for i in range (Row):
  l.append(i+1)
  List.append(list(map(int, input().split())))
x = 0
y = 0
mid = 0
p_list = list(itertools.permutations(l, Row))
for v in p_list:
  for i in range(1,Row):
    x = List[v[i]-1][0]-List[v[i-1]-1][0]
    y = List[v[i]-1][1]-List[v[i-1]-1][1]
    k = x*x+y*y
    mid += k**0.5
res = mid / len(p_list)
print(res)

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

int n;
int a[4];
double dp[305][305][305];

void solve(){
	dp[0][0][0] = 0;
	for (int k = 0; k <= 300; k++)
		for (int j = 0; j + k <= 300; j++)
			for (int i = 0; i + j + k <= 300; i++){
				if (!i && !j && !k) continue;
				int N = i + j + k;
				if (i) dp[i][j][k] += dp[i-1][j][k] * i/(1.0*N);
				if (j) dp[i][j][k] += dp[i+1][j-1][k] * j/(1.0*N);
				if (k) dp[i][j][k] += dp[i][j+1][k-1] * k/(1.0*N);
				dp[i][j][k] += 1.0 * n/N;
			}
	printf("%.12lf\n", dp[a[1]][a[2]][a[3]]);
}

int main(){
	scanf("%d",&n);
	for (int i = 1, u; i <= n; i++){
		scanf("%d",&u); a[u]++;
	}
	solve();
	return 0;
}


Measured memory_bytes: 219520
N, K, C = map(int, input().split())
S = input()
work_day_front = []
work_day_back = []

rest = 0
for i, c in enumerate(S):
    if rest > 0:
        rest -= 1
        continue

    if c == 'o':
        rest = C
        work_day_front.append(i)
max_work = len(work_day_front)

rest = 0
for i, c in enumerate(S[::-1]):
    if rest > 0:
        rest -= 1
        continue
    if c == 'o':
        rest = C
        work_day_back.append(N-i-1)

work_day_back = work_day_back[::-1]


if len(work_day_front) > K:
    print()
    exit()

ans = []
for i in range(len(work_day_back)):
    if work_day_back[i] == work_day_front[i]:
        ans.append(str(work_day_back[i]+1))
print("\n".join(ans))


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

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X,i) ((X>>i)&1)
#define REP(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define ina(x,n) rep(x_i,n) cin>>x[x_i]
#define outa(x,n) rep(x_i,n) cerr<<x[x_i]<<" \n"[x_i==n-1]

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pll> vll;

const int MOD = 1e9+7;
const int INF = (1<<28);
const ll INFL = (1LL<<60);

int main() {
  int n, ans = 0;
  string s;
  cin >> n >> s;
  rep(i,n-2) {
    if (s.substr(i,3) == "ABC") {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>

int main() {
	int n = 0, c = 0;
	std::string eng = "abcdefghijklmnopqrstuvwxyz";
	std::string s;
	std::cin >> s;
	int i, j;
	for (i = 0; i < 26; ++i) {
		for (j = 0; j < s.size(); ++j) {
			if (eng[i] == s[j]) { n += 1; }
		}
		if (n == 0) { std::cout << eng[i] << std::endl; goto end; }
		if (n = 1) { c += 1; }
		n = 0;
	}
	std::cout << "None" << std::endl;
end:return 0;
}

Measured memory_bytes: 512
n,m=map(int,input().split())
D=dict()
for i in range(n):
  D[i+1]=0
for i in range(m):
  a,b=map(int,input().split())
  D[a]+=1
  D[b]+=1
for i in range(1,n+1):
  print(D[i])

Measured memory_bytes: 62088
#include "bits/stdc++.h"
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
ll MOD=1e9+7;
#define INF 1e9+7
#define N 400001
#define MAX_V 400010
#define vec vector<int>
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
template<typename A, size_t NNN, typename T>
void Fill(A (&array)[NNN], const T &val){
    fill( (T*)array, (T*)(array+NNN), val );
}

main(){
    ll n=lin();
    ll p=lin();
    ll ans=1;
    if(n==1){
        cout<<p<<endl;
        return 0;
    }
    for(ll i=2;i*i<=p;i++){
        int res=0;
        ll pp=p;
        while(pp%i==0){
            pp/=i;
            res++;
        }
        if(res>=n)ans=i;
    }
    cout<<ans;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;

int main() {
    int N, M;
    cin >> N >> M;
    vector<tuple<int, int, int>> v(M);
    for(int i = 0; i < M; i++) {
        int P, Y;
        cin >> P >> Y;
        v[i] = make_tuple(Y, P, i);
    }
    sort(v.begin(), v.end());

    int cnt[N];
    for(int i = 0; i < N; i++) cnt[i] = 0;
    vector<pair<int, string>> ans(M);
    for(int i = 0; i < M; i++) {
        int p = get<1>(v[i]);
        int num = get<2>(v[i]);

        cnt[p - 1]++;
        ostringstream ss;
        ss << setw(6) << setfill('0') << p;
        ss << setw(6) << setfill('0') << cnt[p - 1];
        string t(ss.str());

        ans[i] = {num, t};
    }
    sort(ans.begin(), ans.end());
    for(int i = 0; i < M; i++) {
        cout << ans[i].second << "\n";
    }
    return 0;
}


Measured memory_bytes: 9344
N = gets.to_i
H = gets.split.map(&:to_i)
ans = 1
m = 0
if N == 1
  puts 1
else
  (1..N - 1).each do |i|
    if H[m] <= H[i]
      ans += 1
      m = i
    end
  end
  puts ans
end

Measured memory_bytes: 1788
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7
x = int(input())
cnt = 0
if x<=6:
    print(1)
elif x<=11:
    print(2)
else:
    if x%11 == 0:
        print((x//11)*2)
    elif x%11 > 6:
        print(((x//11)+1)*2)
    else:
        print((x//11)*2 + 1)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using p = pair<int,int>;
const long long INF = 1ll << 60;



int main() {
  string S; cin >> S;
  int l=S.size();
  int c=0;
  int ans = 0;
  
  rep(i,l){
      if(S[i]=='A'||S[i]=='C'||S[i]=='G'||S[i]=='T'){
          c++;
          ans = max(ans,c);
      }
      else{
          c = 0;
      }
  }
  cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 3608
// author:  Harsh Nema
#include <bits/stdc++.h>
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main()
{
    fastio;
    ll s=0,w=0;
    cin>>s>>w;
    if(w>=s) cout<<"unsafe";
    else cout<<"safe";
    return 0;
}


Measured memory_bytes: 3652
import heapq
import string


INF = 1e9


def dijkstra(graph, start=0, goal=None):
    min_cost = [INF for _ in range(len(graph))]
    min_cost[start] = 0
    que = [(0, start)]
    result = INF

    while len(que) > 0:
        cur_cost, cur_node = heapq.heappop(que)
        if goal is not None and cur_node == goal:
            result = cur_cost
            break
        for to, cost in graph[cur_node]:
            new_cost = cur_cost + cost
            if new_cost >= min_cost[to]:
                continue
            min_cost[to] = new_cost
            heapq.heappush(que, (new_cost, to))

    return min_cost


def main():
    n, m, r = map(int, input().split())
    graph = [[] for _ in range(n)]
    for _ in range(m):
        u, v, cost = map(int, input().split())
        graph[u].append((v, cost))

    min_cost = dijkstra(graph, r)

    for c in min_cost:
        print(c if c < INF else "INF")


if __name__ == "__main__":
    main()



Measured memory_bytes: 90116
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let mut aseq = vec![vec![0 as i32; n]; 2];
    for y in 0..2 {
        for x in 0..n {
            aseq[y][x] = read();
        }
    }
    let mut ans = 0;
    for target in 0..n {
        let mut sum = 0;
        for x in 0..n {
            if x <= target { sum += aseq[0][x]; }
            if x >= target { sum += aseq[1][x]; }
        }
        ans = std::cmp::max(ans, sum);
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <tuple>

using namespace std;

long long MOD = 1000000007;

int main(){
    int N, Q;
    cin >> N >> Q;

    priority_queue<tuple<int, int, int>, vector<tuple<int, int, int> >, greater<tuple<int, int, int> > > que1;
    priority_queue<tuple<int, int, int>, vector<tuple<int, int, int> >, greater<tuple<int, int, int> > > que2;

    for(int i=0; i<N; i++){
        int S, T, X;
        cin >> S >> T >> X;
        que1.push(make_tuple(S-X, T-X, X));
    }
    for(int i=0; i<Q; i++){
        int D;
        cin >> D;
        que1.push(make_tuple(D, MOD, 0));
    }

    while((int)que1.size()>0){
        int B, E, X;
        B=get<0>(que1.top());
        E=get<1>(que1.top());
        X=get<2>(que1.top());
        
        que1.pop();
        if(X==0){
            while((int)que2.size()>0 && B>=get<2>(que2.top())){
                que2.pop();
            }
            if((int)que2.size()==0){
                cout << -1 << endl;
            }else{
                cout << get<0>(que2.top()) << endl;
            }
        }else{
            que2.push(make_tuple(X, B, E));
        }
    }
}

Measured memory_bytes: 12140
#include<iostream>
#include<string>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <algorithm>
#include <cstdlib>
using namespace std;
int ctoi(char c) {
	switch (c) {
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default: return 0;
	}
}

int main() {
	int N, K;
	cin >> N >> K;
	cout << N - K + 1;
}

Measured memory_bytes: 256
N = int(input())

work = []
for _ in range(N):
    A, B = map(int, input().split())
    work.append([B, A])
    
work.sort()

#print(work)

sum = 0
for i in range(N):
    sum += work[i][1]
    
    if sum > work[i][0]:
        print("No")
        exit()
        
print("Yes")

Measured memory_bytes: 35608
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

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

    int n, m; cin>>n>>m;
    vector<vector<int>> jobs(m+1);
    for(int i=0; i<n; i++){
        int a, b; cin>>a>>b;
        if(m < a) continue;
        jobs[a].emplace_back(b);
    }

    int ans = 0;
    priority_queue<int> pq;
    for(int i=1; i<=m; i++){
        for(auto j:jobs[i]){
            pq.emplace(j);
        }

        if(pq.size()){
            ans += pq.top();
            pq.pop();
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 5632
#include <iostream>

#include <string>

using std::cin;
using std::cout;
using std::endl;

using std::string;

int
main()
{
  int a;
  cin >> a;
  string s;
  cin >> s;
  cout << (3200 <= a ? s.c_str() : "red") << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int h, w;
char c[205][205];
int s[205][205];
int dpx[2][205][205][205], dpy[2][205][205][205];

bool check(int sx, int sy, int tx, int ty)
{
	int cnt = s[tx][ty] - s[sx-1][ty] - s[tx][sy-1] + s[sx-1][sy-1];
	return cnt == 0 || cnt == (tx-sx+1)  * (ty-sy+1);
}

int main(void)
{
	cin >> h >> w;
	for(int y = 1; y <= h; y++){
		for(int x = 1; x <= w; x++){
			cin >> c[x][y];
		}
	}
	for(int x = 1; x <= w; x++){
		for(int y = 1; y <= h; y++){
			s[x][y] = s[x-1][y] + s[x][y-1] - s[x-1][y-1];
			if(c[x][y] == '#') s[x][y]++;
		}
	}
	if(check(1, 1, w, h)){
		cout << 0 << endl;
		return 0;
	}
	
	for(int x = 1; x <= w; x++){
		for(int y = 1; y <= h; y++){
			for(int l = 0; y+l <= h; l++){
				int ub = w+1, lb = x-1, mid;
				while(ub-lb>1){
					mid = (ub+lb)/2;
					if(mid < x || check(x, y, mid, y+l)) lb = mid;
					else ub = mid;
				}
				dpx[0][x][y][l] = lb;
			}
			for(int l = 0; x+l <= w; l++){
				int ub = h+1, lb = y-1, mid;
				while(ub-lb>1){
					mid = (ub+lb)/2;
					if(mid < y || check(x, y, x+l, mid)) lb = mid;
					else ub = mid;
				}
				dpy[0][x][y][l] = lb;
			}
		}
	}
	
	/*for(int x = 1; x <= w; x++){
		for(int y = 1; y <= h; y++){
			for(int l = 0; y+l <= h; l++){
				cout << x << " " << y << " " << l << " " << dpx[0][x][y][l] << endl;
			}
		}
	}
	cout << endl;*/
	
	for(int i = 1; i < 20; i++){
		
		for(int x = 1; x <= w; x++){
			for(int y = 1; y <= h; y++){
				for(int l = 0; y+l <= h; l++){
					int nx = dpx[(i-1)%2][x][y][l]+1;
					if(nx > w) dpx[i%2][x][y][l] = w;
					else dpx[i%2][x][y][l] = dpx[(i-1)%2][nx][y][l];
					
					int ub = w+1, lb = x-1, mid;
					while(ub-lb>1){
						mid = (ub+lb)/2;
						if(mid < x) lb = mid;
						else{
							int ny = dpy[(i-1)%2][x][y][mid-x]+1;
							if(ny > y+l || dpy[(i-1)%2][x][ny][mid-x] >= y+l) lb = mid;
							else ub = mid;
						}
					}
					dpx[i%2][x][y][l] = max(dpx[i%2][x][y][l], lb);
				}
				for(int l = 0; x+l <= w; l++){
					int ny = dpy[(i-1)%2][x][y][l]+1;
					if(ny > h) dpy[i%2][x][y][l] = h;
					else dpy[i%2][x][y][l] = dpy[(i-1)%2][x][ny][l];
					
					int ub = h+1, lb = y-1, mid;
					while(ub-lb>1){
						mid = (ub+lb)/2;
						if(mid < y) lb = mid;
						else{
							int nx = dpx[(i-1)%2][x][y][mid-y]+1;
							if(nx > x+l || dpx[(i-1)%2][nx][y][mid-y] >= x+l) lb = mid;
							else ub = mid;
						}
					}
					dpy[i%2][x][y][l] = max(dpy[i%2][x][y][l], lb);
				}
			}
		}
		
		/*cout << i << endl;
		for(int x = 1; x <= w; x++){
			for(int y = 1; y <= h; y++){
				for(int l = 0; y+l <= h; l++){
					cout << x << " " << y << " " << l << " " << dpx[i%2][x][y][l] << endl;
				}
			}
		}
		cout << endl;*/
		
		if(dpx[i%2][1][1][h-1] >= w){
			cout << i << endl;
			return 0;
		}
	}
	
	return 0;
}


Measured memory_bytes: 129152
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""


n = onem()

a = l()

aa = sum(a)/n
po = 0
aaa = sum(a)//n
if aa != sum(a)//n:
    ppo = 0
    for i in range(n):
        po += (aaa - a[i])**2
    aaa += 1
    for i in range(n):
        ppo += (aaa - a[i])**2
    po = min(po,ppo)

else:
    for i in range(n):
        po += (aaa - a[i])**2

print(po)







Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main(){
  string s;
  cin>>s;
  int len=s.size();
  string ans="";
  for(int i=0;i<len;i++){
    if(s[i]=='B'&&ans.size()) ans.erase(ans.end()-1);
    if(s[i]!='B') ans+=s[i];
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
/*  ex6_2
    ruuu0048 */
#include <stdio.h>
#include <string.h>
#define SIZE 100 //式の長さの条件を定義

int main(void){

    int word_len; //単語の長さの変数を宣言
    char word[SIZE]; //単語を入力する文字列を宣言
    
    scanf("%s",word); //単語を入力

    word_len = strlen(word); //文字列の長さを代入

    printf("%c%d%c\n",word[0],word_len-2,word[word_len-1]); //単語の最初の文字と、その間の数と、最後の文字を出力

    return 0; 
}

Measured memory_bytes: 128
#include <cstdio>
#include <queue>
#include <bitset>
using namespace std;

bitset <100> maskdiv[100], invmaskdiv[100], full;
int n;
vector <int> a;
long long ans=0;
//mulai dari pos=1, bukan pos=0 because smashing first gem --> ans=0 --> already considered
//"return bruteForcePrune(something)" actually returns nothing (void)
void bruteForcePrune(long long potential, long long curr=0, bitset <100> currmask=full, int pos=1) {
	//potential is an upperbound for the answer
	if(potential<=ans){//prune
		return;
	}
	//base case
	if(pos==n){
		ans=curr;
		return;
	}
	//gem already smashed
	if(!currmask[pos]){
		return bruteForcePrune(potential, curr, currmask, pos+1);
	}
	//tidak ada gunanya smash gem yg non-negative
	if(a[pos]>=0){
		return bruteForcePrune(potential, curr+a[pos], currmask, pos+1);
	}
	//keep the bad gem
	bruteForcePrune(potential+a[pos], curr+a[pos], currmask, pos+1);
	//smash the bag gem (and some other gems after)
	//maskdiv and invmaskdiv are precomputed so no time is wasted on ~ operator
	bitset <100> toDelete=currmask&maskdiv[pos];
	for(int i = pos+1;i < n;i ++){
		if(toDelete[i]){
			//potential goes down when a positive gem is smashed
			if(a[i]>0){
				potential-=a[i];
			}
		}
	}
	return bruteForcePrune(potential, curr, currmask&invmaskdiv[pos], pos+1);
}
int main(){
	//precompute masks
	for(int i = 0;i < 100;i ++){
		for(int j = i+1;j <= 100;j += i+1){
			maskdiv[i][j-1]=true;
		}
		invmaskdiv[i]=~maskdiv[i];
	}
	//cuma kepake sekali sih ini
	full.set();
	//input
	scanf("%d", &n);
	a.resize(n);
	long long fullPotential=0;
	for(int&i:a){
		scanf("%d", &i);
	}
	//if gems numbered 51-100 are negative, they definitely won't be considered
	for(int i = n/2;i < n;i ++){
		a[i]=max(a[i], 0);
	}
	for(int i = 1;i < n;i ++){
		fullPotential+=max(a[i], 0);
	}
	bruteForcePrune(fullPotential);
	printf("%lld\n", max(ans+a[0], 0ll));
}

Measured memory_bytes: 3260
#include<iostream>
#include<vector>
using namespace std;

int n, m;
vector<int> vec;

void setVec();
void loop();

int main(){
    while(cin >>n >>m){
        if(n == 0 && m == 0) break;
        vec.clear();
        setVec();
        loop();
        cout <<vec[0] <<endl;
    }
}

void setVec(){
    for(int i = 1; i <= n; i++){
        vec.push_back(i);
    }
}

void loop(){
    int cnt = 1;
    vector<int>::iterator it = vec.begin();
    while(vec.size() != 1){
        if(it == vec.end()){
            it = vec.begin();
        }
        if(cnt == m){
            vec.erase(it);
            cnt = 1;
            continue;
        }
        cnt++;
        it++;
    }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define msi map<string,int>
#define mci map<char,int>
#define pb push_back
#define mp make_pair
#define M 1101
#define MOD 1000000007
#define fi first
#define se second
#define vi vector<int>
#define vl vector<ll>
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define repl(i,l,r) for(long long i=l;i<=r;++i)
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define ins insert
#define inf 10000000000000000ll
#define vpi vector< pair<int,int> >
#define vpl vector< pair<ll,ll> >
#define eps 1e-7
#define endl "\n"
/*ll gcd(ll a,ll b){if(a==0){return b;}return gcd(b%a,a);}
ll modexp(ll x,ll y,ll p)
{ll res=1;x%=p;while(y){if(y&1){res=(res*x)%p;}y=y>>1;x=(x*x)%p;}return res;}
*/
int n;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    int m=0;
    rep(i,0,n-1)
    {
        int c;cin>>c;
        if(c!=i+1){m++;}
    }
    if(m<=2)
    {
        cout<<"YES"<<"\n";
    }
    else
    {
        cout<<"NO"<<"\n";
    }


    return 0;

    /*check for long long or int*/
}


Measured memory_bytes: 256
N,A,B = map(int,input().split())
L = []
for i in range(1,N+1) :
    K = []
    a = str(i)
    for j in range(len(a)) :
        K.append(int(a[j]))
    b = sum(K)
    if A <= b <= B :
        L.append(i)
print(sum(L))
#print(L)



Measured memory_bytes: 3292