akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <cstdlib> // abs(x-y)
#include <iomanip> // 出力の桁数指定
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
  int h, a;
  cin >> h >> a;
  
  /*
  vector<int> a(n);
  rep (i, 0, n)
    cin >> a.at(i);
  
  int ans = 0;
  
  rep (i, 0, n) {
    if (min > p.at(i)) {
      ans++;
      min = p.at(i);
    }
  }  
  */
  if (h%a == 0)
    cout << h/a << endl;
  else
    cout << h/a +1 << endl;
  
}


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

using namespace std;

int main(){

	int a[3],d;
	cin >> a[0] >> a[1] >> a[2] >> d;
	if(max(a[0],a[1])-min(a[0],a[1])<=d && max(a[1],a[2])-min(a[1],a[2])<=d){
		cout <<"Yes" <<endl;
	}
	else if(max(a[0],a[2])-min(a[0],a[2])<=d){
		cout <<"Yes" <<endl;
	}
	else{
		cout << "No" <<endl;
	}


	return 0;
}

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

class UnionFindSet {
    public:
    vector<int> rank, parent, size;

    UnionFindSet(int n) : rank(n), parent(n), size(n) {        
        for(int i = 0; i < n; i++) {
            makeSet(i);
        }
    }
    void makeSet(int x) {
        parent[x] = x;
        rank[x] = 0;
        size[x] = 1;
    }
    bool isSame(int x, int y) {
        return findSet(x) == findSet(y);
    }
    void unite(int x, int y) {
        link(findSet(x), findSet(y));
    }
    void link(int x, int y) {
        if (x == y) return;
        if (rank[x] > rank[y]) {
            parent[y] = x;
            size[x] += size[y];
        }
        else{
            parent[x] = y;
            size[y] += size[x];
            if (rank[x] == rank[y]) {
                rank[y]++;
            }
        }
    }
    int getSize(int x){
        return size[findSet(x)];
    }
    int findSet(int x){
        if (x != parent[x]){
            parent[x] = findSet(parent[x]);
        }
        return parent[x];
    }
};

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> p(N);
    for(int i = 0; i < N; i++)
    {
        cin >> p[i];
    }
    UnionFindSet uf(N+1);
    for(int i = 0; i < M; i++)
    {
        int x, y;
        cin >> x >> y;
        uf.unite(x, y);
    }
    int ret = 0;
    for(int i = 0; i < N; i++)
    {
        if (uf.isSame(i+1, p[i]))
            ret++;
    }
    cout << ret << endl;
    
    return 0;
}

Measured memory_bytes: 1920
n,m=map(int,input().split())
a=[]
x=m
ans=0
for i in range(n):
  a.append(list(map(int,input().split())))
a.sort()
for i in range(n):
  if x-a[i][1]>0:
    x-=a[i][1]
    ans+=a[i][1]*a[i][0]
  else:
    ans+=x*a[i][0]
    break
print(ans)

Measured memory_bytes: 27760
#include <cstdlib>
#include <iostream>
int main(void) {
    const long long mod = 1000000007;
    int n;
	while (std::cin >> n) {
		long long ans = 1, stack = 0, *arr, *cnt;
		int fail = 0;
		arr = new long long[n];
		cnt = new long long[n];
		for (int i = 0; i < n; ++i) {
			std::cin >> arr[i];
			++cnt[(fail + 1) / 2];
			if(i == 0) {
				arr[0] = 1;
			}
			else{
				if(arr[i] >= arr[i - 1] + 2) {
					arr[i] = arr[i - 1] + 2;
				}
				if(arr[i - 1] + 1 == arr[i]) {
					++fail;
				}
			}
		}
		for (int i = 0; i < n; ++i) {
			stack += cnt[i];
			(ans *= stack) %= mod;
			--stack;
    	}
		std::cout << ans << std::endl;
		delete[] arr;
		delete[] cnt;
	}
	return EXIT_SUCCESS;
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
   int n;cin >>n;
   string s;cin >>s;
   vector<int>cnt(26,0);
    for (int i = 0; i < n; ++i) {
        cnt[s[i]-'a']++;
    }
    ll ans=1;
    for (int i = 0; i < 26; ++i) {
        ans*=cnt[i]+1;
        ans%=mod;
    }
    ans--;
    if(ans<0)ans+=mod;
    cout <<ans <<endl;
}


Measured memory_bytes: 3708
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using o_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define M 1000010

int main(){
	IOS;
	string s;cin>>s;
	ll n=sz(s);
	ll ans=0;
	rep(i,0,n/2)if(s[i]!=s[n-1-i])ans++;
	cout<<ans;
	
	
	
	return 0;
}



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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(a+b<c) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))

b = []
for i in range(n):
    b.append(a[i]-i-1)
b = sorted(b)

ans = 0
k = b[n//2]
for i in range(n):
    ans += abs(b[i]-k)
print(ans)

Measured memory_bytes: 30816
#include <iostream>
#include <vector>
#include <algorithm>
#define INF 1e9
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    int N, M, R;
    cin >> N >> M >> R;
    vector<int> r(R);
    rep(i, R) cin >> r[i];
    vector<vector<int>> dist(N, vector<int>(N, INF));
    rep(i, N) dist[i][i] = 0;
    rep(i, M) {
        int A, B, C;
        cin >> A >> B >> C;
        dist[A - 1][B - 1] = C;
        dist[B - 1][A - 1] = C;
    }
    
    rep(k, N) rep(i, N) rep(j, N) {
        if (dist[i][j] > dist[i][k] + dist[k][j]) dist[i][j] = dist[i][k] + dist[k][j];
    }
    
    int ans = INF;
    sort(r.begin(), r.end());
    do {
        int cost = 0;
        REP(i, R) cost += dist[r[i - 1] - 1][r[i] - 1];
        ans = min(ans, cost);
    } while (next_permutation(r.begin(), r.end()));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int     main(void)
{
    int a,b,d,r = 0;
    double f = 0;
    
    scanf("%d %d",&a,&b);
    d = a / b;
    r = a % b;
    f = 1.0 * a / b;
    printf("%d %d %f\n",d,r,f);
    return (0);
}


Measured memory_bytes: 2148
import java.lang.*;
import java.io.*;
import java.util.*;

class Main{
	public static void main(String args[]) throws FileNotFoundException{
		FScanner sc=new FScanner();
		//Scanner sc=new Scanner(System.in);
		int[] arg=sc.readIntL();
		int[] ca=sc.readIntL();
		int[] cb=sc.readIntL();
		Arrays.sort(ca);
		Arrays.sort(cb);
		int x=arg[2];
		int y=arg[3];
		
		boolean w=true;
		//disp(ca);
		//disp(cb);
		
		List<Integer> l=new ArrayList<Integer>();
		
		for(int z: ca){
			if(x<z && z<=y){
				l.add(z);
			}
		}
		
		for(int z: cb){
			if(x<z && z<=y){
				l.add(z);
			}
		}
		
		//System.out.println(l);
		
		for(int z: l){
			if(ca[ca.length-1]<z && z<=cb[0]){
				w=false;
			}
		}
		
		System.out.println((w==true)? "War": "No War");
	}
	
	static void solve(int cur, int nx, int en, int hld){}

	static void disp(int[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	}
	
	static void disp(String[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%s ",data[i]);
		}
			System.out.println();
	}
	
	static void disp(long[] data){
		for(int i=0; i<data.length; i++){
				System.out.printf("%d ",data[i]);
		}
			System.out.println();
	}
	
	static class FScanner{
		BufferedReader read=null;
		StringTokenizer tok=null;
		Scanner sc;
		FScanner() throws FileNotFoundException{
			sc=new Scanner(System.in);
		}
		boolean hasNextLine(){
			boolean has=true;
			if(!sc.hasNextLine()){
				has=false;
			}
			return has;
		}
		int readInt(){
			String buf=sc.nextLine();
			return Integer.parseInt(buf);
		}
		long readLong(){
			long i=Long.parseLong(sc.nextLine());
			return i;
		}
		int[] readIntL(){
			String[] buf=sc.nextLine().split(" ");
			int[] num=new int[buf.length];
			for(int i=0; i<buf.length; i++){
				num[i]=Integer.parseInt(buf[i]);
			}
			return num;
		}
		
		String readString(){
			return sc.nextLine();
		}
		String[] readStringL(String dlm){
			String[] s=sc.nextLine().split(dlm);
			return s;
		}
	}
}


Measured memory_bytes: 25044
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag,
		tree_order_statistics_node_update> ordered_set;

#define el				'\n'
#define sz(v)			((int)((v).size()))
#define all(v)          ((v).begin()),((v).end())
#define clr(v, d)		memset(v, d, sizeof(v))

double const EPS = 1e-8, PI = acos(-1);
const int N = 3e5 + 9, M = 1e4 + 9, OO = (int) 2e9 + 1;
const long long MOD = 1e9 + 7, INF = 1e18 + 9;

typedef long long ll;

void OUTPUT() {
	cout << fixed << setprecision(0);
	ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}

void INPUT() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif
}

int n;
ll ans, arr[N];
ll zeroCnt[109], binRep[109];

int getBit(ll num, ll idx) {
	return ((num >> idx) & 1) == 1;		// 110100, idx = 4  -->  110 & 1 = 0
}

ll POW(ll a, ll k, ll M) {
	if (k == 0)
		return 1;
	ll r = POW(a, k / 2, M);
	r = (r * r) % M;
	if (k % 2)
		r = (r * a) % M;
	return r;
}

int main() {
//	INPUT();
	OUTPUT();
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		for (int j = 0; j < 61; j++) {
			if (!getBit(arr[i], j))
				zeroCnt[j]++;
		}
	}

	for (int i = 0; i < 100; i++) {
		ll x = zeroCnt[i] * (n - zeroCnt[i]);
		for (int j = 0; j < 61; j++) {
			if (getBit(x, j)) {
//				binRep[j + i]++;
				binRep[j + i] = (1 + binRep[j + i] % MOD) % MOD;
//				if (i + j == 64)
//					cout << binRep[i + j] << " " << x << " " << el;
			}
		}
	}

//	for (int i = 0; i < 10; i++) {
//		cout << binRep[i] << " ";
////	}
//	cout << el;
	for (int i = 0; i < 100; i++) {
		if (binRep[i]) {
//			cout << i << " ";
			ll vvvv = (POW(2, i, MOD) % MOD * binRep[i] % MOD) % MOD;
//			if (i < 10)
//				cout << binRep[i] << " " << POW(2, i, MOD) << " " << vvvv << " "
//						<< ans << el;

			ans = (ans % MOD + vvvv % MOD) % MOD;
		}
//		if (ans != 237 && i > 10)
//			cout << ans << " " << vvvv << " " << i << " " << binRep[i] << el;
//		vv = (2 % MOD * vv % MOD) % MOD;
	}
//	cout<<ans<<el;
	cout << ans % MOD << el;
//	cout << POW(2, 65, MOD);
//	cout << getBit(21, 64);
	return 0;

}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

struct Point{ double x, y; };
typedef Point Vector;
        
double dot(Vector a, Vector b){ //????????????a??¨b????????????
    return a.x * b.x + a.y * b.y;
}

double dis(Vector a){
    return sqrt(a.x * a.x + a.y * a.y);
}

int main(){
    vector<Vector> V;
    Point p, e;
    e.x = 1; e.y = 0;
    V.pb(e);

    double thita;
    rep(i,1005){
        thita = atan2(V.back().y, V.back().x) + M_PI / 2;
        p.x = V.back().x + cos(thita);
        p.y = V.back().y + sin(thita);
        //cout << p.x << p.y << endl;
        V.pb(p);
    }
    
    int n;
    while(cin >> n, n!=-1){
        cout << fixed << setprecision(2);
        cout << V[n - 1].x << endl << V[n - 1].y << endl;
    }
}

Measured memory_bytes: 1392
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <math.h>
#include <utility>
#include <vector>
#include <map>
#include <cstdlib>
#define div1 1000000007
const long long INF = 1LL << 60;
using namespace std;
using ll = long long;
// a>b -> a==b;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
// a<b -> a==b;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main(void)
{
    ll N, M, k[20], s[20][20], i, j, p[20], ans=0, judge, cnt;

    cin >> N >> M;

    for(i=1; i<=M; i++){
        cin >> k[i];

        for(j=1; j<=k[i]; j++){
            cin >> s[i][j];
        }
    }

    for(i=1; i<=M; i++){
        cin >> p[i];
    }

    // {0, 1, ..., n-1} の部分集合の全探索(SとTに分ける)
    for (ll bit = 0; bit < (1<<N); bit++) {
        vector<ll> S, T;

        for (ll i = 0; i < N; ++i) {
            if (bit & (1<<i)) { // 列挙に i が含まれるか
                // Sの末尾にiを追加する
                S.push_back(i);
            }
            else{
                T.push_back(i);
            }
        }

        judge = 1;

        for(i=1; i<=M; i++){
            cnt = 0;
            for(j=1; j<=k[i]; j++){
                auto it = find(S.begin(), S.end(), s[i][j]-1);
                if(it != S.end()){
                    cnt++;
                }
            }
            if(cnt % 2 != p[i]){
                judge = 0;
            }
        }

        if(judge==1){
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() 
{
    int a,b,c,k;
    cin>>a>>b>>c>>k;
    for(int i = 0; i < k; i++){
        if(a >= b){
            b *= 2;
        }else if(b >= c && a < b){
            c *= 2;
        }else if(a < b && b < c){
            cout<<"Yes"<<endl;
            return 0;
        } 
    }
    if(a < b && b < c){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 3616
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		string s = Console.ReadLine();
		int answer = 0;

    for(int i = 0; i < n; i++)
    {
      int[] answers = Zalgorithm(s,i);

      for(int j = 1; j < answers.Length; j++)
      {
        int answerMemo = Math.Min(j,answers[j]);
        answer = Math.Max(answer, answerMemo);
      }
    }

		Console.WriteLine(answer);
	}

  static int[] Zalgorithm(string s, int n)
  {//文字列sの最初のn(>=0)文字飛ばした部分列と、
  //その部分列の共通'接頭'辞の長さをO(|s|-n)で返す
  //例えば、s=aabab, n=1の時は、部分列はabab,bab,ab,bとなり、[4,0,2,0]を返す
  
    int l = s.Length;
    if(l <= n) return new int[0];
    int[] answers = new int[l-n];

    answers[0] = l-n;
    int i = 1;
    int j = 0;
    while(i < l-n)
    {
      while (i+j < l-n && s[n+j] == s[n+i+j]) j++;
      answers[i] = j;
      if(j == 0)
      {
        i++;
        continue;
      }
      int k = 1;
      while (i+k < l-n && k+answers[k] < j)
      {
        answers[i+k] = answers[k];
        k++;
      }
      i += k;
      j -= k;
    }

    return answers;
  }
  
}

Measured memory_bytes: 34344
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int n,h;
int a[100010];
int b[100010];
int main()
{
	scanf("%d%d",&n,&h);
	for(int i=0;i<n;i++) scanf("%d%d",&a[i],&b[i]);
	int maxx=-1;
	for(int i=0;i<n;i++) maxx=max(maxx,a[i]);
	int sum=0;
	sort(b,b+n);
	for(int i=n-1;i>=0;i--)
	{
		if(b[i]>maxx)
		{
			h-=b[i];
			sum++;
		}
		if(h<=0) break;
	}
	int x=h/maxx;
	if(h<=0) printf("%d\n",sum);
	else if(h>0 && h%maxx==0) printf("%d\n",sum+x);
	else if(h>0 && h%maxx!=0) printf("%d\n",sum+1+x);
	return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
unsigned long long int M=1000000007;
unsigned long long int mul(unsigned long long int a,unsigned long long int b) {
  return (a * b) % M;
}
 
unsigned long long int pw(unsigned long long int a,unsigned long long int n) {
  unsigned long long int res = 1;
  while (n) {
    if (n % 2 == 0) {
      a = mul(a, a);
      n /= 2;
    } else {
      res = mul(res, a);
      n--;
    }
  }
  return res;
}
 
unsigned long long int inv(unsigned long long int x) {
  return pw(x, M - 2);
}
int main() {
unsigned long long int n,a,b,ans,k1=1,k2=1,ans1=1,ans2=1,i;
cin>>n>>a>>b;
ans=pw(2,n);
for(i=n-a+1;i<=n;i++){
    ans1*=i;
    ans1=ans1%M;
}
for(i=n-b+1;i<=n;i++){
    ans2*=i;
    ans2=ans2%M;
}
for(i=1;i<=a;i++){k1*=i;k1=k1%M;}
for(i=1;i<=b;i++){k2*=i;k2=k2%M;}
ans1*=inv(k1);
ans2*=inv(k2);
ans1=ans1%M;
ans2=ans2%M;
ans-=ans1;
ans=(ans+M)%M;
ans-=ans2;
ans=(ans+M)%M;
ans--;
ans=(ans+M)%M;
cout<<ans<<endl;
return 0;
}
	    


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

int main() {
    int n, max, d, k;
    int arr[110000];
    cin >> n;
    for(int i=0; i<n; i++) cin >> arr[i];
    sort(arr, arr+n);
    max = arr[n-1];
    int min_dir = max;
    for(int i=0; i<n-1; i++){
        d = abs(arr[i] - max/2); 
        if(d <= min_dir) {
            min_dir = d;
            k = i;
        }
    }
    cout << max << " " << arr[k] << endl;
}

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

int main() {
  int N;
  cin >> N;
  int a = N / 1000;
  int b = (N % 1000) / 100;
  int c = (N % 100) / 10;
  int d = N % 10;
  
  if (a == b && b == c && c == d) {
    cout << "Yes" << endl;
  }
  else  if (a == b && b== c){
    cout << "Yes" << endl;
  }
  else if (b == c && c == d) {
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned int INT;
typedef unsigned long long LONG;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
#define debug(x) cerr << #x << ": " << (x) << '\n'
#define FW freopen("data2.txt", "w", stdout);
//快速读入输出，只适用于整数，使用时流同步打开，C语言不准关流
// getchar()<<cin(关流)<<scanf()<<cin
template <class T>
inline bool Read(T& ret)
{
    char c;
    int sgn;
    if (static_cast<void>(c = getchar()), c == EOF)
        return 0;
    while (c != '-' && (c < '0' || c > '9'))
        c = getchar();
    sgn = (c == '-') ? -1 : 1;
    ret = (c == '-') ? 0 : (c - '0');
    while (static_cast<void>(c = getchar()), c >= '0' && c <= '9')
        ret = ret * 10 + (c - '0');
    ret *= sgn;
    return 1;
}
//输出只能用于整数
template <class T>
inline void Write(T x)
{
    if (x < 0)
        putchar('-'), x = -x;
    if (x > 9)
        Write(x / 10);
    putchar(x % 10 + '0');
}

LL get_num(LL n)
{
    LL tot = 1;
    for (LL i = 2; i * i <= n; ++i) {
        if (n % i == 0) {
            LL x = 0;
            while (n % i == 0) {
                n /= i;
                ++x;
            }
            tot *= (x + 1);
        }
    }
    if (n > 1)
        tot *= 2;
    return tot;
}
void slove(int question_num)
{
    int n;
    cin >> n;
    LL ans = 0;
    for (int i = 1; i < n; ++i) {
        ans += get_num(n - i);
    }
    cout << ans << endl;
}

int main()
{
    int num = 1;
    // cin >> num;
    for (int i = 1; i <= num; ++i) {
        slove(i);
    }
    // system("pause");
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(var,cnt) for(int (var)=0; (var)<(int)(cnt); ++(var))
#define Rep(var,init,cnt) for(int (var)=(init); (var)<(cnt); ++(var))
#define ran(var,vec) for(auto &(var):(vec))
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(rall(v))
#define SUM(v) accumulate(all(v),0)
#define tget(tp,idx) get<idx>(tp)
#define TF(flag) (flag)?1:0
#define yn(f) cout<<(f?"yes":"no")<<endl
#define Yn(f) cout<<(f?"Yes":"No")<<endl
#define YN(f) cout<<(f?"YES":"NO")<<endl
#define COUT(x) cout<<(x)<<endl
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using ti = tuple<int,int,int>;
using tl = tuple<ll,ll,ll>;

template<typename T>
using vec = vector<T>;
template<typename T>
using mat = vector<vec<T>>;
template<typename T>
using cub = vector<mat<T>>;
template<typename T>
using val = valarray<T>;

template<typename T>
using pq = priority_queue<T>;
template<typename T>
using rpq = priority_queue<T,vec<T>,greater<T>>;

template<typename T1,typename T2>
ostream &operator<<(ostream &os, const pair<T1,T2> &p){
  os<<"P("<<p.first<<", "<<p.second<<") ";
  return os;
}

template<typename T1,typename T2>
istream &operator>>(istream &is, pair<T1,T2> &p){
  is>>p.first>>p.second;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, vector<T> &v){
  for(T &in:v) is>>in;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const valarray<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, valarray<T> &v){
  for(T &in:v) is>>in;
  return is;
}

// Usual Template End ================================================

// Template End ======================================================

constexpr int MOD=1e9+7;

int main(void){
  int n; cin>>n; COUT(n/3);
}













Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int m,d;
	while(!(scanf("%d",&d)==EOF)){
		m=0;
		for(int i=0;(d*i)<(600-d);i++){
			m+=((i+1)*d*(i+1)*d*d);
		}
		printf("%d\n",m);
	}
	return 0;
}

Measured memory_bytes: 2616
def dfs(current):
    for maps in Graph[current]:
        if maps in already:
            continue
        else:
            already.append(maps)
            dfs(maps)

n,m = map(int,input().split())
ans = 0
Edges = []
for _ in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    Edges.append((a,b))

for i in range(m):
    egdes = Edges[0:i]+Edges[i+1:]
    Graph = [[] for _ in range(n)]
    for edge in egdes:
        Graph[edge[0]].append(edge[1])
        Graph[edge[1]].append(edge[0])
    already = []
    dfs(0)
    if len(already) != n:
        ans += 1
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>

int main(){
    long long int a=0, b=0, c=0, n=0, i=0, j=0, count = 0;
    scanf("%lld %lld %lld",&n,&a,&b);
    if(a==0){ printf("0"); return 0; }
    if(b==0){ printf("%lld",n); return 0; }
    c = a+b;
    i = n%c; 
    j = n/c;
    count = a*j;
    //printf("---%d %d---",i,j);
    if(i<=a){ count+=i; } else if(i>a) { count+=a; }
    printf("%lld",count);
    return 0;
}

Measured memory_bytes: 128
/**
 * ３つの整数a, b, cを読み込み、それらが a < b < cの条件を満たすならば"Yes"を、
 * 満たさないならば"No"を出力するプログラム
 * @author 前島佑介
 *@version 2014/12/1
 */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


// 2-A ３つの整数a, b, cを読み込み、それらが a < b < cの条件を満たすならば"Yes"を、
//満たさないならば"No"を出力するプログラム
class Main {

	// プログラムのエントリポイント
	public static void main(String[] args) {

		//入力値1つ目
		int intNum1 = 0;

		//入力値2つ目
		int intNum2 = 0;

		//入力値2つ目
		int intNum3 = 0;

		try{
			//キーボードからの入力準備
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

			//キーボードからの入力をString型で受け取る
			String strLine = br.readLine();

			//文字列の分割:入力値を" "で分ける
			//分けた文字列はstrLineAry[0]とstrLineAry[1]に分けられる
			String[] strLineAry = strLine.split(" ");

			//入力値の１つ目の値
			intNum1 = Integer.parseInt(strLineAry[0]);

			//２つ目の値
			intNum2 = Integer.parseInt(strLineAry[1]);

			//３つ目の値
			intNum3 = Integer.parseInt(strLineAry[2]);

			if(intNum1 < intNum2 && intNum2 < intNum3) {
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}



			//例外処理
			}catch(IOException e) {

				//例外時の出力
				System.out.println(e);

			}catch(NumberFormatException e) {

				//数値以外の入力値で出力
				System.out.println("数値で入力して下さい");
			}
	}
}

Measured memory_bytes: 16904
import java.util.Scanner;

/**
 * https://abc072.contest.atcoder.jp/tasks/abc072_b
 */
public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		sc.close();
		
		StringBuilder sb = new StringBuilder();
		for(int i=0; i<s.length; i++){
			if(i%2==0) sb.append(s[i]);
		}
		
		System.out.println(sb.toString());
		
	}

}


Measured memory_bytes: 25812
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cassert>
#include <string>
#define SIZE 5005

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

ll dp[SIZE];

ll solve(ll N,vector <P> pl)
{
	if(pl.empty()) return N;
	if(pl.size()==1)
	{
		P p=pl[0];
		return N%p.first+(N/p.first)*(ll) p.second;
	}
	else if(pl.size()==2)
	{
		ll ret=N;
		P p=pl[0],q=pl[1];
		for(ll i=0;i*p.first<=N;i++)
		{
			ll zan=N-i*p.first;
			ll now=i*p.second+zan%q.first+(zan/q.first)*q.second;
			ret=max(ret,now);
		}
		return ret;
	}
	for(int i=0;i<=N;i++) dp[i]=0;
	for(int i=0;i<pl.size();i++)
	{
		P p=pl[i];
		for(int j=0;j+p.first<=N;j++) dp[j+p.first]=max(dp[j+p.first],dp[j]+p.second);
	}
	ll ret=N;
	for(int i=0;i<=N;i++) ret=max(ret,dp[i]+N-i);
	return ret;
}
int main()
{
	int n;
	scanf("%d",&n);
	vector <int> A,B;
	int sz=3;
	for(int t=0;t<sz;t++)
	{
		int a;
		scanf("%d",&a);
		A.push_back(a);
	}
	for(int t=0;t<sz;t++)
	{
		int b;
		scanf("%d",&b);
		B.push_back(b);
	}
	vector <P> fr,sc;
	for(int i=0;i<sz;i++)
	{
		if(A[i]<B[i])
		{
			fr.push_back(P(A[i],B[i]));
		}
		else if(A[i]>B[i])
		{
			sc.push_back(P(B[i],A[i]));
		}
	}
	ll ret=solve(n,fr);
	ret=solve(ret,sc);
	printf("%lld\n",ret);
	return 0;
}


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

using namespace std;

#define eb emplace_back
#define ii pair<int, int>
#define OK (cerr << "OK" << endl)
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
#define int long long
#define tt tuple<int, int, int, int>
#define all(x) x.begin(), x.end()
#define Matrix vector<vector<int>>
#define Mat(n, m, v) vector<vector<int>>(n, vector<int>(m, v))
#define endl '\n'

constexpr int INF = 2e18;
constexpr int MOD = 998244353;
constexpr int MAXN = 2e5 + 3;

int mod(int x) { return x % MOD; }

int power(const int x, const int p, const int MOD = 998244353) {
  if (p == 0)
    return 1 % MOD;
  if (p == 1)
    return x % MOD;
  int res = power(x, p / 2, MOD);
  res = (long long)res * res % MOD;
  if (p & 1)
    res = (long long)res * x % MOD;
  return res;
}

vector<int> inv(MAXN);
vector<int> factorial(MAXN);

int gcd(int a, int b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}

// A*B = x (mod m)
// B = x * A^(-1)
// Function to find modular inverse of a under modulo m
// Assumption: m is prime
int modInverse(int a, int mod) {
  int g = gcd(a, mod);
  if (g != 1)
    return -1;
  else
    // If a and m are relatively prime, then modulo inverse
    // is a^(m-2) mod m
    return power(a, mod - 2, mod);
}

int choose(int n, int k) {
  return mod(mod(factorial[n] * modInverse(factorial[k], MOD)) *
             modInverse(factorial[n - k], MOD));
}

signed main() {

  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int t;

  // cin >> t;
  t = 1;

  while (t--) {
    int n, m, k;
    cin >> n >> m >> k;

    factorial[0] = 1;
    for (int i = 1; i <= MAXN; i++) {
      factorial[i] = (factorial[i - 1] * i) % MOD;
    }

    int ans = 0;
    for (int i = 0; i <= k; ++i) {
      ans += mod(choose(n - 1, i) * mod(m * power((m - 1), (n - (i + 1)))));
      ans = mod(ans);
    }

    cout << ans << endl;
  }
}

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

int main(){
    int a, b, x;
    cin >> a >> b;
    
    if((a+b)%2==0){
        x = (a+b)/2;
    }
    else
        x = (a+b)/2+1;
    
    cout << x << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using static System.Console;

namespace ABC216A
{
    static class Program
    {
        static void Main(string[] args)
        {
            var n = ReadLine().SplitTryParseToList<int>();
            var s = ReadLine();
            Char c =Char.ToLower(s[n[1] - 1]);

            WriteLine(s.ChangeCharAt(n[1] - 1,c));
        }
        public static string ChangeCharAt(this string str, int index, char newChar)
        {
            return str.Remove(index, 1).Insert(index, newChar.ToString());
        }

        public static T TryParse<T>(this String input)
        {
            try
            {
                var converter = TypeDescriptor.GetConverter(typeof(T));
                if (converter != null)
                {
                    return (T)converter.ConvertFromString(input);
                }
                else
                {
                    throw new InvalidCastException("");
                }
            }
            catch
            {
                throw new InvalidCastException(typeof(T) + " is not supported.");
            }
        }

        public static List<T> SplitTryParseToList<T>(this String input)
        {
            return input.Split().Select(n => n.TryParse<T>()).ToList();
        }

        public static List<T> ListSwap<T>(this List<T> list, Int32 index1, Int32 index2)
        {
            var t = list[index1];
            list[index1] = list[index2];
            list[index2] = t;
            return list;
        }

        public static List<Tuple<T, int>> DuplicateCount<T>(this IEnumerable<T> list)
        {
            return list
                .GroupBy(i => i)
                .Where(g => g.Any())
                .Select(g => Tuple.Create(g.Key, g.Count()))
                .ToList();
        }
        public static List<Tuple<T, int>> DuplicateSort<T>(this IEnumerable<Tuple<T, int>> list)
        {
            return list.OrderByDescending((x) => x.Item2).ToList();
        }
        public static List<T> ReadLineOne<T>(int n)
        {
            var list = new List<T>();
            foreach (var i in Enumerable.Range(1, n))
            {
                list.Add(Console.ReadLine().TryParse<T>());
            }
            return list;
        }
        public static void PrintAll<T>(this IEnumerable<T> list)
        {
            foreach (var i in list)
            {
                Console.Write($"{i} ");
            }

            Console.WriteLine();
        }
    }
}


Measured memory_bytes: 13280
#include <bits/stdc++.h>
using namespace std;
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
//#define int long long

struct IoSetup {
    IoSetup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout <<fixed<<setprecision(12);
        cerr <<fixed<<setprecision(12);
    }
}IoSetup;

typedef long long ll;
typedef pair < int , int >  pii;
static constexpr const signed int INF = 0x3f3f3f3f;
static constexpr const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static constexpr const signed int SMOD = 1000000007;
static constexpr const signed int NMOD = 998244353;
static constexpr const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static constexpr const signed int dy[]={0,-1,0,1,-1,1,-1,1};

inline bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>bool chmax(T &a, const T &b){return(a=max(a,b))==b;}
template<class T>bool chmin(T &a, const T &b){return(a=min(a,b))==b;}
inline int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

int a, b, c;
int x, y;

signed main() {

    cin >> a >> b >> c >> x >> y;
    
    int ans , t = min(x, y);
    if(a + b > 2 * c) {
        ans = c * 2;
    }
    else {
        ans =  (a + b);
    }
    ans *= t;
    x -= t;
    y -= t;

    if(x) {
        ans += min(c*2, a) * x;
    }
    else{
        ans += min(c*2, b) * y;
    }

    cout << ans << endl;
  
    return 0;
}



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

const long long INF = 1LL << 60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int GetDigit(int num) { return log10(num) + 1; }

typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define vi vector<int>
#define vii vector< vector<int> >

int N;
int memo[100];

int main() {

	cin >> N;

	rep1(i, N + 1) {

		int banchi = (i / (int)pow(10, GetDigit(i) - 1)) * 10 + (i % 10);
		//cout << banchi << endl;
		if (i > N) break;
		else memo[banchi] += 1;

	}

	int ans = 0;
	
	rep1(i, 10) {
		rep1(j, 10) ans += memo[i * 10 + j] * memo[j * 10 + i];
	}

	cout << ans << endl;

}


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

int main(int argc, char** argv)
{
	int A, B, X;
	bool flip;
	std::cin >> X;
	A = 0;
	B = 0;
	flip = false;
	while (X != std::pow(A, 5.0) - std::pow(B, 5.0))
	{
		if (A == B)
		{
			A++;
			B = 0;
		}
		else if(flip)
		{
			B *= -1;
			flip = B < 0 ? true : false;
		}
		else
		{
			B++;
			flip = true;
		}
	}
	std::cout << A << ' ' << B << std::endl;
	return 0;
}

Measured memory_bytes: 4100
import java.util.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
 
public class Main{
//    static final long mod=1000000007;
    static int dx[]={-1,0,1,0};
    static int dy[]={0,-1,0,1};
    static long pl,mi;

    public  static void main(String[] args)   throws Exception, IOException{        
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);
        // int n=sc.nextInt();
        // char c[][] = new char[h][w];
        // char c[]=sc.nextString().toCharArray();
        // int d[]=new int[n];
        // for(int i=0; i<n; i++) {d[i]=sc.nextInt();}

//        int n=sc.nextInt();
	    String s=sc.nextString();
	    String a="NO";
	    lp:
	    for (int i = 0; i < s.length(); i++) {
			for (int j = i; j < s.length(); j++) {
				if((s.substring(0, i+1)+s.substring(j+1, s.length())).equals("keyence"))
				{a="YES"; break lp;}
			}
		} 
	     
        out.println(a);
        out.flush();
    }
    
    static boolean validpos(int x,int y,int r, int c){
        return x<r && 0<=x && y<c && 0<=y;
    }

    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }  
}

//class P {
//    int id, d;
//    P(int  id, int d) {
//        this.id=id;
//        this.d=d;
//    }
//}

//class P implements Comparable<P>{
//    int id, d;
//    P(int  id, int d) {
//        this.id=id;
//        this.d=d;
//    }
//    public int compareTo(P p){
//        return d-p.d; //des
//    }
//}

class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public int[] nextIntArray(int size) throws IOException{
    	int r[] = new int[size];
    	for (int i = 0; i < size; i++) {
			r[i] = this.nextInt(); 
		}
    	return r;
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}


Measured memory_bytes: 24660
import math

nim, mike = map(int, input().split())
mod = 10**9+7

t = math.factorial(nim)*math.factorial(mike)
if nim == mike:
    print((2*t)%mod)
elif abs(nim-mike) > 1:
    print(0)
elif abs(nim-mike) <= 1:
    print(t%mod)


Measured memory_bytes: 5184
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repeat(i,s,n) for(int (i)=s; (i)<(n); (i)++)
#define revrep(i,n) for(int (i)=(n)-1;i>=0; i--)

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(std::numeric_limits<float>::max_digits10);
  cout<<fixed;
  string s;
  cin>>s;
  stringstream ss;
  rep(i,s.size()) {
    ss<<'x';
  }
  cout << ss.str() << endl;
  return 0;
}


Measured memory_bytes: 256
#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>;




int main() {

 int n;
 cin >> n;
 vector<int> d(n);
 rep(i,n){
     cin >> d.at(i);
 }
 sort(d.begin(),d.end());
 reverse(d.begin(),d.end());

 int care = 0;
 int ans = 0;
 rep(i,n){
    if(care != d.at(i)){//もしcareがdのi番と違うなら
        ans++;
        care = d.at(i);
    }else{
        care = d.at(i);
    }
 }
 cout << ans << endl;

}



Measured memory_bytes: 3640
s = input()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
op1 = '+'
op2 = '+'
op3 = '+'
for B in [b, -b]:
    for C in [c, -c]:
        for D in [d, -d]:
            if a + B + C + D == 7:
                if B < 0:
                    op1 = '-'
                if C < 0:
                    op2 = '-'
                if D < 0:
                    op3 = '-'
                print(str(a)+op1+str(b)+op2+str(c)+op3+str(d)+'=7')
                exit()

Measured memory_bytes: 3064
import java.io.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		long answer = 1;
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String s = buf.readLine();
        long n = Integer.parseInt(s);
        for (int i = 1; i <= n;i++){
        	answer = answer * i;
        }
		System.out.println(answer);
		
	}
}

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

int main() {
	int n, m;
	cin >> n >> m;
	int a[n];
	int sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}

	double min = sum / (4.0 * m);
	int cnt = 0;

	for (int i = 0; i < n; i++) {
		if (min <= a[i]) {
			cnt++;
		}
	}
	string ans = "No";
	if (m <= cnt) {
		ans = "Yes";
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,b,a) for(int i=b;i>=a;i--)
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Forenska(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-x))
#define GREATER(x) x,vector<x>,greater<x>
#define randIn(L,R) (((LL)rand()*rand())%(R-L)+L)
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pLL;
typedef vector<int> vec;
typedef vector<LL> vecL;
typedef vector<pii> vecP;
typedef vector<pLL> vecPL;
typedef vector<string> vecS;
typedef vector<vec> mat;
typedef complex<double> point;
const long double PI=3.14159265358979323846264338327950;
const LL INFLL=0x3f3f3f3f3f3f3f3f;
const int INF=0x3f3f3f3f;
const long double EPS=1e-10;
int read()
{
    int x=0;
    char ch=' ';
    bool flag=false;
    while(ch<'0' || ch>'9')
    {
        if(ch=='-')flag=true;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=(x<<3)+(x<<1)+ch-'0';
        ch=getchar();
    }
    return flag?-x:x;
}
int lcm(int a,int b)
{
	return a/__gcd(a,b)*b;
}
const int MAX_N=100005;
int n;
vec g[MAX_N];
int dis[2][MAX_N];
void dfs(int v,int dist,int p)
{
	dis[p][v]=dist;
	rep(i,0,g[v].size())
	{
		int u=g[v][i];
		if(dis[p][u]!=0)continue;
		dfs(u,dist+1,p);
	}
}
int main()
{
	cin>>n;
	rep(i,1,n)
	{
		int a=read(),b=read();
		g[a].pb(b);
		g[b].pb(a);
	}
	dfs(1,1,0);
	dfs(n,1,1);
	int ans=0;
	For(i,1,n)ans+=(dis[0][i]<=dis[1][i])?1:-1;
	puts(ans>0?"Fennec":"Snuke");
	return 0;
}




Measured memory_bytes: 12800
#include<bits/stdc++.h>
using namespace std;
long long a[20];
int main (){
	long long n;
	cin>>n;
	long long a[n],temp=0;
	cin>>a[0];
	if(a[0]!=1)temp++;
	for(int i=1; i<n ; i++){
		cin>>a[i];
		if(a[i]!=i+1)temp++;
	}
	if(temp<=2)cout<<"YES";
	else cout<<"NO";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=1LL<<60;
const double EPS = 1e-10;
const ll mod=1000000007;
//const ll mod=998244353;
ll dp[3010][3010][4]={};
ll z[3010][3010]={};
int main(void){
    ll R,C,K;
    cin>>R>>C>>K;
    for(int i=0;i<K;i++){
        ll r,c,k;
        cin>>r>>c>>k;
        r--,c--;
        z[r][c]=k;
    }
    dp[0][0][1]=z[0][0];
    for(int i=0;i<R;i++){
        for(int j=0;j<C;j++){
            for(int b=0;b<=3;b++){
                if(i>0){
                    dp[i][j][0]=max(dp[i-1][j][b],dp[i][j][0]);
                    dp[i][j][1]=max(dp[i-1][j][b]+z[i][j],dp[i][j][1]);
                }
                if(j>0){
                    dp[i][j][b]=max(dp[i][j-1][b],dp[i][j][b]);
                    if(b==3) continue;
                    dp[i][j][b+1]=max(dp[i][j-1][b]+z[i][j],dp[i][j][b+1]);
                }
            }
        }
    }
    ll ans=-INF;
    for(int i=0;i<=3;i++){
        ans=max(ans,dp[R-1][C-1][i]);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 356252
#include <numeric>
#include <bits/stdc++.h>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <math.h>
#include <string>
#define ll long long
#define ull unsigned long long
#define make(type,x) type x; cin>>x
#define make2(type,x,y) type x,y; cin>>x>>y
#define fr(x,y) for(long long x=0;x<y;x++)
#define makevec(x,y,n) vector <x> y(n); for(ll i=0;i<n;i++) cin>>y[i]
#define M (ll)1000000007
#define MM (ll) 1e8
#define INF (ll) 1e18

# define IOS ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;

template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
bool sortbysec(const pair <ll,ll> &a,const pair <ll,ll> &b){
    return a.second<b.second;
}

struct cmp {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		int lena = a.second - a.first + 1;
		int lenb = b.second - b.first + 1;
		if (lena == lenb) return a.first < b.first;
		return lena > lenb;
	}
};


struct c_h {
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        x ^= FIXED_RANDOM;
        return x ^ (x >> 16);
    }
};

ll calcpow(ll x, ll y)
{
    ll temp;
    if(y == 0)
        return 1;
    temp = calcpow(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
    {
        if(y > 0)
            return x * temp * temp;
        else
            return (temp * temp) / x;
    }
}
ll gcd(ll a, ll b){
    if(b==0) return a;
    return gcd(b,a%b);

}
ll egcd(ll a, ll b, ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1;
    ll y1;
    ll g=egcd(b,a%b,x1,y1);
    x=y1;
    y=x1-y1*(a/b);
    return g;
}


bool isprime(ll a){
bool flag=1;
for(ll i=2;i*i<=a;i++){
    if(a%i==0) {flag=0; break;}
}
return flag;
}

ll dx8[8]={1,0,-1,0,1,-1,1,-1};
ll dy8[8]={0,1,0,-1,1,-1,-1,1};
ll dx4[4]={0,0,1,-1};
ll dy4[4]={1,-1,0,0};
ll n,m;
bool ok(ll a,ll b){
    return a>=0&&a<n&&b>=0&&b<m;
}



int main(){
    IOS;
    cin>>n>>m;
    vector <string> vec(n);
    bool ans=1;
    fr(i,n) cin>>vec[i];
    fr(i,n){
        fr(j,m){
            if(vec[i][j]=='#'){
            bool flag=0;
            fr(k,4){
                ll x=i+dx4[k]; ll y=j+dy4[k];
                if(ok(x,y) && vec[x][y]=='#') flag=1;

            }
            if(!flag) ans=0;
            }
        }
    }
    if(ans) cout<<"Yes \n";
    else cout<<"No \n";


    return 0;
}


Measured memory_bytes: 3664
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <string>

using namespace std;

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

	if (a <= x && x <= a + b) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
n = int(input())
ans = [0]*(n+1)
for x in range(1, int(n**0.5+10)):
    for y in range(1, int(n**0.5+10)):
        for z in range(1, int(n**0.5+10)):
            if x*x+y*y+z*z+x*y+y*z+z*x <= n:
                ans[x*x+y*y+z*z+x*y+y*z+z*x] += 1
for i in range(n):
    print(ans[i+1])

Measured memory_bytes: 69712
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <stack>

using namespace std;

int main(){
  string S;
  cin >> S;
  int count = 700;
  for(int i=0;i<3;++i){
    if(S[i] == 'o'){
      count += 100;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 764
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			b[i] = i + 1;
		}
		for (int i = 0; i < n; i++) {
			c[a[i] - 1] = b[i];
		}
		for (int i = 0; i < n; i++) {	
			System.out.print(c[i] + " ");
		}
	}
}

Measured memory_bytes: 62512
//
// Created by kuroneko on 2019-07-06.
//

#include<iostream>
#include<cmath>

using namespace std;

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

    int X[N][D];
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < D; j++) {
            cin >> X[i][j];
        }
    }
    int ans = 0;
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            double sum = 0;
            for (int k = 0; k < D; k++) {
                sum += double(X[i][k] - X[j][k]) * double(X[i][k] - X[j][k]);
            }
            sum = sqrt(sum);
            if (sum == int(sum)) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 888
#include<iostream>
#include<vector>
using namespace std;
int main() {
	vector<int>n(4);
	bool n1, n9, n7, n4;
	for(auto&e:n)cin>>e;

	n1=n9=n7=n4=false;
	for(auto e:n) {
		switch(e)
		{
		case 1:
			n1=true; break;
		case 9:
			n9=true; break;
		case 7:
			n7=true; break;
		case 4:
			n4=true; break;
		}
	}
	if(n1&&n9&&n7&&n4)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <cmath>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

int main()
{
    // 整数の入力
    string S,cursor,last;
    ll K = 0;
    cin >> S;
    cursor = "";
    last = "";
    for(int i = 0;i<S.size();i++){
        cursor.push_back(S[i]);
        if (last != cursor){
            K++;
            last = cursor;
            cursor = "";
        }
    }

    cout << K << endl;
    return 0;
}

Measured memory_bytes: 768