akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize ("-Ofast")
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define ld long double
#define _ ios_base::sync_with_stdio(false) ;cin.tie(NULL);cout.tie(NULL);
#define F(i,b) for(int i= 0; i<(int)(b);i++)
#define FI(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define RF(i,a,b) for(int i = (int)(a); i >= (int)(b); i--)
#define inp(a) for(auto& i : a) cin >> i;
#define out(a) for(auto i : a){cout << i << ' ';}cout << endl;
#define dbg(x) cerr << #x << " is " << x << endl;
#define ms(x,a) memset(x,(int)(a),sizeof(x))
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define pii pair<int,int>
#define vi vector<int >
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
#define MOD 1000000007
const int N = 2e5+7 ;
string s ;
#define pp pair<pair<string,int>, int >
bool comp(pp a ,pp b){
	if(a.ff.ff < b.ff.ff)
		return true ;
	else if(a.ff.ff == b.ff.ff && a.ff.ss > b.ff.ss)
		return true ;
	return false ;

}

int32_t main(){_
	int n,k ;
	cin >> n ;
	vector<pair<pair<string,int>,int>> v(n) ;
	F(i,n){
		cin >> v[i].ff.ff >> v[i].ff.ss ;
		v[i].ss = i+1 ;
	}
	sort(all(v),comp) ;
	for(auto i : v){
		cout << i.ss << endl ;
	}
	
	
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
#define de(x) cout << #x << "=" << x << endl;
template <class T> bool maxi(T &a, const T &b) {
    if (a < b) { a = b; return 1;} return 0;}
template <class T> bool mini(T &a, const T &b) {
    if (b < a) { a = b; return 1;} return 0;}
#define dame {cout<< "-1" <<"\n"; return;}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
using namespace std;
using ll = long long;
using ld = long double;
using P  = pair<ll,ll>;
//--GLOBAL---------------------------------

//--MAIN-----------------------------------
void Main() {
    ll N; cin>>N;
    vector<ll> A(N);
    vector<ll> B(N);
    rep(i,N) cin>>A[i];
    rep(i,N) cin>>B[i];
    ll ans=INF2;
    rep(i,1<<N){
        vector<ll> moto(N);
        bool gu[N]={}; 
        rep(j,N){
            if(i>>j&1){
                moto[j]=A[j];
                gu[j]=true;
            }
            else{
                moto[j]=B[j];
            }
        }

        auto sorted=moto;
        SORT(sorted);

        vector<bool> used(N,false); //使用したj
        vector<ll> jplus(N,0); //右に移動したj
        ll tent=0;
        rep(k,N){ //jからkに移動 小さいkから埋めていく
            rep(j,N){
                if(used[j]) continue;
                ++jplus[j];

                if(abs(k-j)%2==0 xor gu[j]) continue;
                if(moto[j]==sorted[k]){
                    used[j]=true;
                    tent+=j+(jplus[j]-1)-k;
                    break;
                }
            }
        }
        bool ok=true;
        rep(j,N) if(!used[j]) ok=false;

        if(ok) {
            mini(ans,tent);
        }
    }

    cout<< ( ans==INF2 ? -1 : ans )<<"\n";

}

//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------


Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
using namespace std;
int main() {
  int N;
  cin >> N;
  int sqsum = 0;
  int sum   = 0;
  for (int i = 0; i < N; i++) {
	  int d;
	  cin >> d;
	  sum   += d;
	  sqsum += d * d;
	}
  cout << (sum * sum - sqsum) / 2 << endl;
  return 0;
}


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


void solve(std::string S){
    cout << S;
    if (S[S.size()-1] == 's') {
        cout << "es";
    } else {
        cout << "s";
    }
    cout << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 3600
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<cstdio>
#include<map>
using namespace std;
typedef long long ll;
const int MAX=200000+10; 
int n,k;
ll a[MAX];
ll b[MAX];
ll s[MAX];
map<ll, int>mp;
int lowbit(int x)
{
	return (x&-x);
}
ll sum(int x)
{
	ll ans=0;
	while(x>0)
	{
		ans+=a[x];
		x-=lowbit(x);
	}
	return ans;
}
void inite(int x,int num)//维护前缀数组a 
{
    while(x<=n+1){
        a[x]+=(long long)num;
        x+=lowbit(x);
    }
}
int main()
{
	scanf("%d%d",&n,&k);
	s[0]=b[0]=0;
	for(int i=1;i<=n;i++)
	{	
		int t;
		scanf("%d",&t);
		s[i]=s[i-1]+(long long)(t-k);
		b[i]=s[i];
	}
	sort(b,b+1+n);
	int tot=0;
	for(int i=0;i<=n;i++)
		if(!mp.count(b[i]))mp[b[i]]=++tot;
	memset(a,0,sizeof(a));
	ll res=0;
	for(int i=0;i<=n;i++)
	{
		res+=sum(mp[s[i]]);
		inite(mp[s[i]],1);
	}
	printf("%lld\n",res); 
return 0;
}

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

int main() {
  int x, y;
  cin >> x >> y;
  vector<int> g1 = {1,3,5,7,8,10,12}, g2 = {4, 6, 9, 11};
  int xg = 0, yg = 0;
  for (int i = 0; i < g1.size(); i++) {
    if (x == g1[i]) xg = 1;
    if (y == g1[i]) yg = 1;
  }
  for (int i = 0; i < g2.size(); i++) {
    if (x == g2[i]) xg = 2;
    if (y == g2[i]) yg = 2;
  }
  cout << ((xg == yg) ? "Yes" : "No") << endl;
}

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

typedef long long ll;
#define rep(i,x) for(int i=0;i<x;i++)
#define put(ans)    cout << ans << endl;


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

    int ans(0);
    for(int i=a;i<=b;i++){
        string t = to_string(i);
        string x(t);
        reverse(x.begin(),x.end());
        if(x==t)    ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3688
import java.util.Scanner;

class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int N = Integer.parseInt(scanner.next());
    long[] input = new long[N];
    boolean is0 = false;
    for(int i=0; i<N; i++){
      input[i] = Long.parseLong(scanner.next());
      if(input[i] == 0){
        System.out.println(0);
        is0 = true;
        break;
      }
    }
    if(!is0){
      long ans = 1l;
      long judge = 1000000000000000000l;
      double now_pow = 0d;
      for(int i=0; i<N; i++){
        if(now_pow+Math.log10(input[i])<=18){
          ans *= input[i];
          now_pow = Math.log10(ans);
          if(ans > judge){
            System.out.println(-1);
            break;
          }else if(i == N-1){
            System.out.println(ans);
          }
        }else{
          System.out.println(-1);
          break;
        }
      }
    }
  }
}


Measured memory_bytes: 58968
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  sort(s.begin(),s.end());
  if(s[0]==s[1] && s[2]==s[3] && s[1]!=s[2]) cout<<"Yes";
  else cout<<"No";
 return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>

int main(int argc, char const *argv[])
{
	int a,b,k;
	int v[100],p = 0;
	scanf("%d%d%d",&a,&b,&k);
	for (int i = 1; i <= ((a < b) ? a : b); ++i){
		if(!(a % i) && !(b % i))	v[p++] = i;
	}
	printf("%d\n",v[p - k]);
}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        string s=cin.next();
        int n=s.Length;
        string ans="Yes";
        for(int i=0;i<n;i++)
        {
          if(i%2==0&&s[i]=='L'){ans="No";break;}
          if(i%2==1&&s[i]=='R'){ans="No";break;}
        }
        Console.WriteLine(ans);
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
    public void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<int,int> P;

void unite(int *par,int *r,int a,int b);
int root(int *par,int a);

int main(void){
  int n,m,i,j,a,b,ans=0;
  vector<P> e;
  cin >> n >> m;
  for (i=0;i<m;i++){
    cin >> a >> b;
    e.push_back(P(a,b));
  }
  for (i=0;i<m;i++){
    int par[55],r[55],p=0;
    for (j=1;j<=n;j++){
      par[j]=j;
      r[j]=1;
    }
    for (j=0;j<m;j++){
      if (i==j) continue;
      unite(par,r,e[j].first,e[j].second);
    }
    p=root(par,1);
    for (j=2;j<=n;j++) if (root(par,j)!=p) break;
    if (j!=n+1) ans++;
  }
  cout << ans << endl;
  return 0;
}

int root(int *par,int a){
  if (par[par[a]]==par[a]) return par[a];
  else return par[a]=root(par,par[a]);
}

void unite(int *par,int *r,int a,int b){
  a=root(par,a);
  b=root(par,b);
  if (r[par[a]]>r[par[b]]){
    par[par[a]]=par[b];
    r[par[b]]++;
  }else{
    par[par[b]]=par[a];
    r[par[a]]++;
  }
  return;
}

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

using namespace std;

int main(){

    char entrada[3];
    int contador=0;

    cin >> entrada;
    for(int i=0;i<3;i++){
        if(entrada[i]=='1'){
            contador++;
        }
    }
    cout << contador << '\n';

    return 0;
}

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

int main()
{   //数N
	string weather_yosou;
	string weather_true;

	cin >> weather_yosou;
	cin >> weather_true;

	int count=0;

	for (int i = 0; i < 3; i++) {
		if (weather_yosou[i] == weather_true[i]) {
			count++;
		}
	}

	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
const ll MOD=1e9+7;
const ll MOD2=998244353;
const ll N=2e5+5;
const ld pi=3.14159265359;
const ll INF=(1LL<<60);
#define SQ(i) ((i)*(i))
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define setp setprecision
#define lwb lower_bound
#define SZ(_a) (ll)_a.size()

ll x,n,ans;
map<pll,ll> cnt;

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>n;
	REP(i,n){
		ld tmp;cin>>tmp;
		ll two=0,five=0;
		x=llround(tmp*1e9);
		while(x%2==0)++two,x/=2;
		while(x%5==0)++five,x/=5;
		++cnt[mp(two,five)];
	}
	for(auto i:cnt){
		for(auto j:cnt){
			if(i.X.X+j.X.X>=18&&i.X.Y+j.X.Y>=18){
				if(i<j)ans+=i.Y*j.Y;
				else if(i==j)ans+=(i.Y-1)*i.Y/2;
			}
		}
	}
	cout<<ans<<"\n";
	return 0;
}



Measured memory_bytes: 3812
#include<bits/stdc++.h>
#define rep(i,f,n) for(ll i=(f); (i) < (n); i++)
#define repe(i,f,n) for(ll i=(f); (i) <= (n); i++)
using namespace std;

typedef long long ll;
ll INF = 1LL << 60;
ll MAX = 100010;
ll MOD = 2019;

int
main() 
{
  int n; cin >> n;
  vector<ll> arr(n);
  rep(i, 0, n){
    cin >> arr[i];
  }

  if(n == 1){
    cout << "Yes" << endl;
    return 0;
  } else if(n == 2){
    if(arr[0] - 1 <= arr[1]){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }

  bool flag = true;
  arr[0] -= 1;
  repe(i, 1, n - 1){
    if(arr[i - 1] < arr[i]) arr[i] -= 1;
    if(arr[i - 1] > arr[i]){
     flag = false;
    }
  }

  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}



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

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

    int a,b,c;
    cin>>a>>b>>c;
    if(a==b && b==c)
        cout<<1<<"\n";
    else if(a==b || a==c || b==c)
        cout<<2<<"\n";
    else cout<<3<<"\n";
}


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

int main() {
    int N, L; cin >> N >> L;
    vector<string> s(N);
    for (int i = 0; i < N; i++) {
        cin >> s[i];
    }
    sort(s.begin(), s.end());
    string  ans = "";
    for (int i = 0; i < N; i++) {
        ans += s[i];
    }

    cout << ans << endl;
}

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

int main(){
    int n,m;
    while(true){
        cin>>n>>m;
        if(n==0&&m==0)break;
        vector<int> v;
        for (int i = 0; i < n; ++i) {
            int t;
            cin>>t;
            v.emplace_back(t);
        }
        for (int i = 0; i < m; ++i) {
            int t;
            cin>>t;
            v.emplace_back(t);
        }
        v.emplace_back(0);
        sort(v.begin(),v.end());
        int ans=0;
        for (size_t i = 1; i < v.size(); ++i) {
            ans=max(ans,v[i]-v[i-1]);
        }
        cout<<ans<<endl;
    }
    return 0;
}


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

using namespace std;

typedef long long ll;

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

// combination
// O(n)

const ll MOD = 1e9 + 7;
const ll max_n = 2020202;
ll fact[max_n];
bool fact_init = false;

ll powmod(ll a, ll b){
	if(b == 0) return 1;
	if(b % 2 == 1) return a * powmod(a, b - 1) % MOD;

	ll d = powmod(a, b / 2) % MOD;
	return d * d % MOD;
}

ll comb(ll n, ll k){
	if(!fact_init){
		fact[0] = 1;
		fact[1] = 1;

		for(ll i = 2; i < max_n; i++){
			fact[i] = fact[i-1] * i;
			fact[i] %= MOD;
		}

		fact_init = true;
	}

	ll ret = fact[n];
	ret *= powmod(fact[k],MOD-2);
	ret %= MOD;
	ret *= powmod(fact[n-k],MOD-2);
	ret %= MOD;
	return ret;

	// X^(-1) = X^(p-2) (mod p) (Fermat's little theorem)
}

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

	ll k;
	cin >> k;

	string s;
	cin >> s;

	ll n = s.size();
	ll ans = 0;
	rep(i, k+1){
		ll t = comb(n - 1 + k - i, n - 1);
		t *= powmod(25, k - i);
		t %= MOD;
		
		t *= powmod(26, i);
		t %= MOD;

		ans += t;
		ans %= MOD;
	}
	
	cout << ans << endl;
}


Measured memory_bytes: 20016
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


// CHECK THE LIMITS
typedef long long ll;

const int MOD = 1000000007;
const ll INFLL = 1e18;
const int INF = 1e9;
const int NMAX = 1e5+5;

int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
} 

vector<int> graph[NMAX];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
	int n,m;
	cin >> n >> m;

	for(int i = 0; i< m; ++i)
	{
		int x,y;
		cin >> x >> y;
		x--;y--;
		graph[x].push_back(y);
		graph[y].push_back(x);
	}

	queue<int> coada;
	vector<int> res(n,-1);
	vector<bool> visited(n);
	visited[0] = true;
	coada.push(0);
	while(!coada.empty())
	{
		int node = coada.front();
		
		coada.pop();

		for(auto &child : graph[node])
		{
			if(!visited[child])
			{
				visited[child] =true;
				coada.push(child);
				res[child] = node;
			}

		}
	}

	for(int i = 1; i< n; ++i)
	{
		if(res[i] == -1)
		{
			cout << "No";
			return 0;
		}
	}
	cout << "Yes" << '\n';
	for(int i = 1; i< n; ++i)
	{
		cout << res[i]+1 << '\n';
	}
	

    return 0;
}


Measured memory_bytes: 10224
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
#define F first
#define S second
#define MK make_pair
const ll E=1e17+7;
const ll MOD=1000000007;





int main(){
    ll n,k;
    cin>>n>>k;
    ll ans=0;
    for(ll i=k+1;i<=n;i++){
        ll count=i-k;
        ans+=(n/i)*count;
        ans+=max(n%i-k+1,(ll)0);
        //cout<<i<<" "<<(n/i)*count<<" "<<max(n%i-k+1,(ll)0)<<endl;
        if(k==0){ans--;}
    }
    cout<<ans<<endl;
    
    
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>				//Written by ThiDaiLoc
using namespace std;				//Team Three Wolves
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> trp;
typedef vector<ll> vi;
typedef vector<pll> vp;

#define fu(i,a,b)   for(ll i=a;i<=b;i++)
#define f1(i,n)     for(ll i=1;i<=n;i++)
#define fs(i,s)     for(ll i=0;i+1<=s.length();i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define fuv(i,a)    for(ll i=0;i<a.size();i++)
#define fdv(i,a)    for(ll i=(ll)a.size()-1;i>=0;i--)
#define ms(a,x)     memset(a, x, sizeof a)
#define prec(n)     fixed<<setprecision(n)
#define uni(a)      (a).erase(unique(all(a)), (a).end())
#define pb(i)       push_back(i)
#define pob         pop_back()
#define sc(a)       cin>>a
#define sc2(a,b)    cin>>a>>b
#define sc3(a,b,c)  cin>>a>>b>>c
#define pr(a)       cout<<a<<endl
#define pr2(a,b)    cout<<a<<" "<<b<<endl
#define rpr(a)      return cout<<a<<endl,0
#define prY         cout<<"YES"<<endl
#define prN         cout<<"NO"<<endl
#define bit(n,i)    (((n)>>(i))&1)
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)  lower_bound(all(a),x) -a.begin()
#define all(x)      (x).begin(), (x).end()
#define sz(a)       (ll)a.size()
#define le(s)       (ll)s.length()		
#define re          return 	
#define	mp(a,b)     make_pair(a,b)
#define	mp3(a,b,c)  make_pair(a,make_pair(b,c))
#define se          second
#define fi          first 
#define sse         second.second
#define sfi         second.first
#define soA         sort(A+1,A+1+n)
#define so(A,n)     sort(A+1,A+1+n)
#define sov(v)      sort(all(v))
#define sovr(v)     sort(all(v),greater<ll>())
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline ll mnz(ll& a,ll b){return a=(a>b?b:a);}
inline ll mxz(ll& a,ll b){return a=(a<b?b:a);}
inline string toString(ll n) {stringstream ss; ss << n;return ss.str();}
double const eps = 1e-6;
ll const Base=1e9+7,oo=1e17,MAXN=1e6;


ll A[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
ll Solves(){
	
	ll n,m,k,cnt=0,ans=0,x,y,q,c,sum=0,v,t;
	// PROCESS IN HERE
	sc(n);
	pr(A[n-1]);
	
	
	
	
	
	
	re 0;
	// Hack it if you can :)
}

int main(){
	//INPUT;
	if(fopen("locin.txt", "r"))INPUT;
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll test=1;
//	sc(test);
	fu(T,1,test){
//		cout<<"Case #"<<T<<": ";
		Solves();
	} 		
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t k,a,b,c,d;
  cin>>a>>b>>c>>d;
  k=a*c;
  if(k<a*d){
    k=a*d;
  }
  if(k<b*c){
    k=b*c;
  }
  if(k<b*d){
    k=b*d;
  }
  cout<<k;
}

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

typedef long long ll;

int p[101], q[101], r[101], b[101];

ll gcd(ll a, ll b){
    return (b == 0)? a : gcd(b, a % b);
}

ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll solve(int M){
	ll w;
	if( M == 0 ){
		w = 1;
	}else{
		ll rw = solve(r[M]);
		ll bw = solve(b[M]);
		ll l = lcm(rw * p[M], bw * q[M]);
		w = (l / p[M]) + (l / q[M]);
	}
	return w;
}

int main(){
	int n;
	while( cin >> n, n ){
		vector<bool> used(n+1, false);
		for(int i = 1; i <= n; i++){
			cin >> p[i] >> q[i] >> r[i] >> b[i];
			used[r[i]] = used[b[i]] = true;
		}
		for(int i = 1; i <= n; i++){
			if( !used[i] ) cout << solve(i) << endl;
		}
	}
}

Measured memory_bytes: 1188
#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
#define pub push_back
const ll md = 1000000007;
bool bt[100001][2]={};
ll dp[100001][2]={};
using namespace std;
vector<vector<int>> AdjList;
ll dfs(ll n,ll s,ll pv)
{
	if (!bt[n][s])
	{
		int v = 0;bt[n][s]=1;dp[n][s]=1;
		for (int i=0;i<AdjList[n].size();i++)
		{
			if (AdjList[n][i]!=pv)
			{
				ll rs = 0;
				rs += dfs(AdjList[n][i],0,n);
				if (s==0) {rs += dfs(AdjList[n][i],1,n);}
				rs%=md;
				dp[n][s]*=rs;dp[n][s]%=md;
				v++;
			}
		}
		if (v==0) {return 1;}
	}
	return dp[n][s];
}
int main()
{
	ll n;cin>>n;
	for (int i=0;i<n;i++) {AdjList.pub(vector<int>());}
	for (int i=0;i<n-1;i++)
	{
		int a,b;cin>>a>>b;
		AdjList[a-1].pub(b-1);
		AdjList[b-1].pub(a-1);
	}
	cout<<(dfs(0,0,-1)+dfs(0,1,-1))%md<<"\n";
	return 0;
}

Measured memory_bytes: 16240
package main

import (
	"fmt"
)

const MOD = 1000000007

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	idx, value int
	a, b       int
	index      int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func main() {
	var N int
	fmt.Scanf("%d\n", &N)
	A := make([]int, N)
	for i := 0; i < N; i++ {
		var a int
		fmt.Scan(&a)
		A[i] = a
	}
	B := make([]int, N)
	M := 0
	m := map[int]bool{}
	for i := N; i > 0; i-- {
		a := A[i-1]
		p := 2
		sum := 0
		for i*p <= N {
			b := B[i*p-1]
			if b > 0 {
				sum++
			}
			p++
		}
		if sum%2 == a {
			continue
		}
		B[i-1] = 1
		m[i-1] = true
		M++
	}
	fmt.Println(M)
	for i := 0; i < N; i++ {
		if m[i] {
			fmt.Print(i+1, " ")

		}
	}
	fmt.Println()

}

func Reverse(runes []rune) []rune {
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return runes
}


Measured memory_bytes: 12288
#include<bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, start, end) for(int i = start; i < (int)(end); ++i)

int main(){
    long long n, a, b;
    cin >> n >> a >> b;
    long long ans;
    ans = n / (a + b) * a;
    ans += n % (a + b) >= a ? a : n % (a + b);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

string s;
int n, nex[200010][26], can[200010];
int dp[200010];

int main(){
	cin >> s;
	n = s.size();
	fill(&nex[0][0], &nex[200010][0], -1);
	for(int i = n - 1; i >= 0; i--){
			rep(j, 26) nex[i][j] = nex[i + 1][j];
			nex[i][s[i] - 'a'] = i;
	}
	rep(i, n + 10) dp[i] = 1e9;
	dp[0] = 0;
	rep(i, n + 1) rep(j, 26){
		int k = nex[i][j];
		if(k < 0) dp[n + 1] = min(dp[n + 1], dp[i] + 1);
		else dp[k + 1] = min(dp[k + 1], dp[i] + 1);
	}
	//cerr << dp[n + 1] << endl;
	
	can[n + 1] = 1;
	for(int i = n; i >= 0; i--) rep(j, 26){
		int k = nex[i][j];
		if(k < 0){
			if(dp[n + 1] == dp[i] + 1 && can[n + 1]) can[i] = 1;
		}
		else{
			if(dp[k + 1] == dp[i] + 1 && can[k + 1]) can[i] = 1;
		}
	}
	string ans;
	for(int i = 0; i <= n;){
		rep(j, 26){
			int k = nex[i][j];
			if(k < 0){
				if(can[n + 1] && dp[n + 1] == dp[i] + 1){
					//cerr<<dp[i]<<" to "<<dp[n+1]<<endl;
					ans += 'a' + j;
					i = n + 1; break;
				}
			}
			else{
				if(can[k + 1] && dp[k + 1] == dp[i] + 1){
					//cerr<<dp[i]<<" to "<<dp[k+1]<<endl;
					ans += 'a' + j;
					i = k + 1; break;
				}
			}
		}
		//cerr<<"i:"<<i<<" ans:"<<ans<<endl;
	}
	//cerr<<"n:"<<n<<endl;
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 22532
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
typedef pair<int,int> P;
const int inf=1000000007;
const int MOD=1000000007;
bool judge(int key,int x){
  if(key%2==0)return key/2*11>=x;
  else return key/2*11+6>=x;
}
signed main(){
  int x;cin>>x;
  int d=0;
  int up=1e16;
  while(up-d>1){
    int mid=(d+up)/2;
    if(judge(mid,x)){
      up=mid;
    }
    else d=mid;
  }
  //if(x%11==0)up=x/11*2;
  cout<<up<<"\n";
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <numeric>


using namespace std;


int main() 
{
	int r, c;
	int arr[100 + 1][100 + 1] = {};

	cin >> r >> c;

	for (int i = 0; i < r; i++)
	{
		for (int j = 0; j < c; j++)
		{
			cin >> arr[i][j];
		}
	}

	for (int i = 0; i < r; i++)
	{
		int sum = 0;
		for (int j = 0; j < c; j++)
		{ 
			sum += arr[i][j];
		}
		arr[i][c] = sum;
	}

	for (int i = 0; i < c; i++)
	{
		int sum = 0;
		for (int j = 0; j < r; j++)
		{
			sum += arr[j][i];
		}
		arr[r][i] = sum;
	}

	for (int i = 0; i < r; i++)
	{
		arr[r][c] += arr[i][c];
	}
	for (int i = 0; i <= r; i++)
	{
		for (int j = 0; j <= c; j++)
			cout << (j ? " " : "") << arr[i][j];
		cout << endl;
	}
	

	return 0;
}

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

int main(){
    int n, i, c = 0, z = 0;
    cin >> n;
    long long t = 0, a, mini = 9999999999;
    for(i=0; i<n; i++){
        cin >> a;
        if(a == 0){
            z++;
        }
        if(a < 0){
            a *= -1;
            c++;
        }
        mini = min(a, mini);
        t += a;
    }
    if(c%2 == 1 && z == 0){
        t += -2*mini;
    }
    cout << t;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define rep(i,n) REP(i, 0, n)
typedef complex<double> Point;
double cross(const Point& a, const Point& b){
    return (conj(a) * b).imag();
}
double dot(const Point& a, const Point& b){
    return real((conj(a) * b));
}
Point projection(const Point& a, const Point& b, const Point &p) {
    double t = dot(p - a, a - b) / norm(a - b);
    return a + t * (a - b);
}

int main(){
    Point p1, p2, q; char gomi;
    while(cin >> p1.real() >> gomi >> p1.imag() >> gomi >>
                 p2.real() >> gomi >> p2.imag() >> gomi >>
                 q.real() >> gomi >> q.imag()){
        Point pro = projection(p1, p2, q);
        Point ans = pro + (pro - q);
        cout << fixed << setprecision(6) << ans.real() << ' ' << ans.imag() << endl;
    }
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    int sum = 0;
    for (int i = 0; i < s.size(); i++) {
        sum += s[i] - '0';
    }
    cout << (sum % 9 == 0 ? "Yes" : "No");
    return 0;
}

Measured memory_bytes: 3708
while True:
    s = input().split(" ")
    H = int(s[0])
    W = int(s[1])
    if H == 0 and W == 0:
        break
    for i in range(H):
        for j in range(W):
            if i % 2 == 0:
                if j % 2 == 0:
                    print("#",end="")
                else:
                    print(".",end="")
            else:
                if j % 2 == 0:
                    print(".",end="")
                else:
                    print("#",end="")
        print("")
    print("")

Measured memory_bytes: 9072
import java.util.*;


// 英小文字からなる文字列 S が与えられます。
// T が空文字列である状態から始めて、以下の操作を好きな回数繰り返すことで S=T とすることができるか判定してください。

// T の末尾に "dream", "dreamer", "erase", "eraser" のいずれかを追加する。

public class Main{
    public static void main (String[]args){
        
        Scanner sc = new Scanner(System.in);
        
        // 標準入力
        String S = sc.nextLine();
 
        sc.close();
        
        // 入力文字列をreplaceで分割する→使わない文字列に置き換えてすべて削除
        S = S.replaceAll("eraser", "-");
        S = S.replaceAll("erase", "-");
        S = S.replaceAll("dreamer", "-");
        S = S.replaceAll("dream", "-");
        S = S.replaceAll("-", "");

        if (S.length() == 0){
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }


    }
}

Measured memory_bytes: 30540
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
//#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define y1 y122
#define int long long

/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
/*
#pragma comment(linker, "/STACK: 20000000005")
*/


using namespace std;

const int N = 200005, MOD = 998244353;



main()
{
    ios_base::sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    cout << (n * (n - 1) + m * (m - 1)) / 2 << endl;
    return 0;
}


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

int n, x[10], y[10];
double dist(int i, int j) {
  double dx = x[i] - x[j];
  double dy = y[i] - y[j];
  return sqrt(pow(dx, 2) + pow(dy, 2));
}

int main() {
  cin >> n;
  vector<int> v(n); 
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  for(int i = 0; i < n; i++) v[i] = i + 1;
  double sum = 0.0;  
  do {
    for (int i = 0; i < n - 1; i++) {
      sum += dist(v[i], v[i+1]);
    }  
  } while(next_permutation(v.begin(), v.end()));
  int fac = 1;
  for (int i = 2; i <= n; i++) {
    fac *= i;
  }
  cout << fixed << setprecision(10) << sum /fac << endl;
}

Measured memory_bytes: 3816
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n,m,l;
    long c;
    n = sc.nextInt();
    m = sc.nextInt();
    l = sc.nextInt();
    int[][] a = new int[n][m];
    int[][] b = new int[m][l];
    for(int i=0;i < n;i++){
      for(int j=0;j < m;j++){
        a[i][j] = sc.nextInt();
      }
    }
    for(int i=0;i < m;i++){
      for(int j=0;j < l;j++){
        b[i][j] = sc.nextInt();
      }
    }

    for(int i=0;i < n;i++){
      for(int j=0;j < l;j++){
        c = 0L;
        for(int k=0;k < m;k++){
          c += a[i][k]*b[k][j];
        }
        System.out.print(c);
        if(j != l-1)System.out.print(" ");
      }
      System.out.println("");
    }
    sc.close();
  }
}


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

#define each(i, c) for (auto& i : c)
#define mkp(a, b) make_pair(a, b)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> Pll;
const ll MOD = 1e9+7;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << ": " << p.second << ")"; return os; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ", "; os << ")"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; each (i, m) os << i << ", "; os << "}"; return os; }


int main() {
  ll n;
  cin >> n;

  ll ans = 1e18;
  for (ll i = 1; i*i <= n; ++i) {
    if (n % i == 0) {
      ll x = to_string(i).size();
      ll y = 0;
      if (n/i != i) {
        y = to_string(n/i).size();
      }
      ans = min(ans, max(x, y));
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

ll copy(ll x){
	return x;
}


int main(){
	ll n;cin>>n;
	ll k;cin>>k;
	ll x = copy(k);
	int c = 1;
	while(k <= n){
		k *= x;
		c++;
	}
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 256
/**
*	  Name: Ajay Subhash Jadhav
*	  Institute: International Institute of Technology Hyderabad 
*/

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <deque>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <ctime>
#include <string.h>
#define LL long long
#define inf 0x7fffffff
#define mod 1000000007
#define pb push_back
#define ppi pair<int,int>
#define vi vector<int>
#define vii vector<ppi>
#define vll vector<LL>
#define mp make_pair
using namespace std;

void fastio()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
void inputread()
{
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  #endif
}

int v[21],c[21];
int n;
int solve(int i,int val,int cost)
{
	if(i==n)
	{
		return val-cost;
	}
	return max(solve(i+1,val+v[i],cost+c[i]),solve(i+1,val,cost));
}

int main()
{
      
  fastio();
  int i;
  cin>>n;
  for(i=0;i<n;i++)
  	cin>>v[i];
  for(i=0;i<n;i++)
  	cin>>c[i];
  cout<<solve(0,0,0)<<"\n";
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <strings.h>
using namespace std;

int main()
{
 int N,K,R,S,P;
 cin>>N>>K>>R>>S>>P;
 char* T =new char[N];
 char* D =new char[N];
 cin>>T;
 int j;
 for(j=0;j<N;j++){
     D[j]='l';
 }
 int i,p;
 p=0;
 char a,b;
 for(i=0;i<N;i++){
     a=T[i];
     if(i<K){
         b='l';
     }else{
         b=D[i-K];
     }
    if(i<K){
        if(T[i]=='r'){
         p=p+P;
         D[i]='r';
     }  else if(T[i]=='s'){
         p=p+R;
         D[i]='s';
     }  else if(T[i]=='p'){
         p=p+S;
         D[i]='p';
     }
    }else if(a==b){D[i]='l';
    }else{
          if(T[i]=='r'){
         p=p+P;
         D[i]='r';
     }  else if(T[i]=='s'){
         p=p+R;
         D[i]='s';
     }  else if(T[i]=='p'){
         p=p+S;
         D[i]='p';
     }
    }



 }
 cout<<p;
 return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll X;
    cin >>X;
    if(X==1){
        cout<<1<<endl;
        return 0;
    }
    ll ans =1;
    rep3(i,2,102){
        ll now=i;
        while(1){
            now*=i;
            if(now<=X){
                chmax(ans,now);
            }else{
                break;
            }
        }
    }
    cout << ans << endl;


    return 0;
    

}

Measured memory_bytes: 3616
S = input()
r = "WA"
n = len(S)
l = list(S)

if S[0] == "A" and S[2:n-1].count('C') == 1:
  s = S.replace('A', 'p').replace('C', 'p')
  if s.islower():
    r = 'AC'
print(r)

Measured memory_bytes: 8960
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<ll> a(x), b(y), c(z);
    for(int i = 0; i < x; i++) {
        cin >> a[i];
    }
    for(int i = 0; i < y; i++) {
        cin >> b[i];
    }
    for(int i = 0; i < z; i++) {
        cin >> c[i];
    }
    priority_queue<ll> pque;
    for(int i = 0; i < x; i++) {
        for(int j = 0; j < y; j++) {
            pque.push(a[i] + b[j]);
        }
    }
    vector<ll> kouho;
    for(int i = 0; i < min(k, x * y); i++) {
        ll tmp = pque.top();
        pque.pop();
        kouho.emplace_back(tmp);
    }
    vector<ll> ans;
    for(int i = 0; i < min(k, x * y); i++) {
        for(int j = 0; j < z; j++) {
            ans.emplace_back(kouho[i] + c[j]);
        }
    }
    sort(RALL(ans));
    for(int i = 0; i < k; i++) {
        cout << ans[i] << endl;
    }
}

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

using namespace std;

int main() {
   
   string S;
   cin >> S;
   
   int ans = 700;

   for (int i = 0; i < 3; i++) {
      if (S[i] == 'o') ans += 100;
   }

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


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<math.h>
#include<bitset>
#include <numeric>
using namespace std;
using ll=long long;
using ld=long double;
using pint=pair<int,int>;
using pll=pair<ll,ll>;
#define LONG_INF 9223372036854775807
#define INF 1000000000LL
#define EPS 1e-10
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define dump(a) rep(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define all(v) v.begin(),v.end()
#define pb push_back


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

    int a;
    cin >> a;
    cout << a+a*a+a*a*a << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <iomanip>
using namespace std;
#define MM 1000000000
#define MOD MM+7
#define pi pair<int32,int32>
#define pl pair<int64,int64>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
template<typename T>
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T>
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

int LIS(int n,vector<int> a){
    //dp
    vector<int> dp(n+1,MOD);
    for(int i = 0; i < n; i++){
        *lower_bound(dp.begin(),dp.end(),a[i]) = a[i];
    }
    return lower_bound(dp.begin(),dp.end(),MOD) - dp.begin();
}

int main(){
    int n; cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    cout << LIS(n,a) << endl;
    return 0;
}
  




Measured memory_bytes: 3932
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn gcd(x: i64, y: i64) -> i64 {
    if y == 0 {
        x.abs()
    } else {
        gcd(y, x % y)
    }
}

fn main() {
    input!{
        n: usize,
        a: [i64;n],
    };
    let mut x = vec![0; n];
    let mut y = vec![0; n];

    x[0] = a[0];
    for i in 0..n-1 {
        x[i+1] = gcd(x[i], a[i+1]);
    }

    y[n-1] = a[n-1];
    for i in (1..n).rev() {
        y[i-1] = gcd(y[i], a[i-1]);
    }
    // println!("{:?}", x);
    // println!("{:?}", y);
    let mut max_gcd = 0;
    for i in 0..n {
        let g = if i == 0 {
            y[1]
        } else if i == n - 1 {
            x[n-2]
        } else {
            gcd(x[i-1], y[i+1])
        };
        max_gcd = std::cmp::max(max_gcd, g);
    }

    println!("{}", max_gcd);

}



Measured memory_bytes: 6396
import math
n, d = [int(item) for item in input().split()]
x = []
for i in range(n):
    x.append([int(item) for item in input().split()])
ans = 0
for i in range(n):
    for j in range(i+1, n):
        val = 0
        for k in range(d):
            val += (x[i][k] - x[j][k]) ** 2.0 
        if math.sqrt(val).is_integer():
            ans += 1
print(ans)


Measured memory_bytes: 3060
n = int(input())
dp = [[0 for i in range(3)] for i in range(n)]
H = [list(map(int,input().split())) for i in range(n)]
for i in range(3):
    dp[0][i]=H[0][i]
for i in range(n-1):
    for j in range(3):
        if j==0:
            dp[i+1][0]=max(dp[i][1]+H[i+1][0],dp[i][2]+H[i+1][0])
        if j==1:
            dp[i+1][1]=max(dp[i][0]+H[i+1][1],dp[i][2]+H[i+1][1])
        if j==2:
            dp[i+1][2]=max(dp[i][0]+H[i+1][2],dp[i][1]+H[i+1][2])
print(max(dp[n-1][0],dp[n-1][1],dp[n-1][2]))

Measured memory_bytes: 50232
#include<cstdio>
#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
const int INF=0x3f3f3f3f;
typedef long long ll;
int n,num1,num0,tmp=0,num11=INF,num00=INF;
char a[100100];
int ans=INF;
int main()
{
	cin>>a;
	//tmp--;
	tmp=strlen(a);
	ans=tmp;
	for(int i=1;i<tmp;i++)
	{
		if(a[i]!=a[i-1])
		{
			ans=min(ans,max(i,tmp-i));
		}
	}
	printf("%d\n",ans);
	return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(2e2 + 5);

int n;

vector<vector<int>> graph(MAX_N);

vector<int> paint(MAX_N);

ll connect[MAX_N][MAX_N];

ll path[MAX_N][MAX_N];

// color: -1, 0, 1
bool coloring(int node, int color) {
  if (paint[node] == 0) {  // not painted
    paint[node] = color;
    for (auto &next : graph[node]) {
      if (!coloring(next, color * -1)) {
        return false;
      }
    }
  } else {  // already painted
    return paint[node] == color;
  }

  return true;
}

bool check() {
  // initialize
  for (int i = 1; i <= n; ++i) paint[i] = 0;  // no coloar at first

  return coloring(1, 1);
}

ll calc() {
  for (int k = 1; k <= n; ++k) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        if (path[i][j] > path[i][k] + path[k][j]) {
          path[i][j] = path[i][k] + path[k][j];
        }
      }
    }
  }

  ll ret = -1LL;

  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (path[i][j] == INF) continue;
      ret = max(ret, path[i][j]);
    }
  }

  return ret;
}

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      path[i][j] = INF;
    }
  }

  for (int i = 1; i <= n; ++i) {
    path[i][i] = 0LL;
  }

  // make graph
  for (int i = 0; i < n; ++i) {
    string tmp;
    cin >> tmp;

    for (int j = 0; j < n; ++j) {
      if (tmp[j] == '0') {
        connect[i + 1][j + 1] = INF;
      } else {
        graph[i + 1].push_back(j + 1);
        path[i + 1][j + 1] = 1LL;
      }
    }
  }

  if (!check()) {
    printf("%d\n", -1);
    return 0;
  }

  ll ans = calc() + 1LL;

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 1152