akhauriyash/Code-Regression huggingface dataset:
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fo(i,n) for(int i=0;i<(n);i++)
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);fo(i,n)cin>>a[i];
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
using namespace std;
#define int ll
// #define MAX 20
#define INF (int)1e18

template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.F<<','<< P.S<<')';}

vector<int> a;
int n;
map<pair<int,int>,int> done;


int f(int l,int r,int left)
{
	if(left==0)
		return 0;
	if(r-l+1<left*2-1 || r<l)
		return -INF;
	if(done.find({l,left})!=done.end())
		return done[{l,left}];
	return done[{l,left}]=max(a[l]+f(l+2,r,left-1), f(l+1,r,left));
}


signed main()
{
	fio
	cin>>n;
	a.resize(n);
  
  
	fo(i,n)	
		cin>>a[i];
	cout<<f(0,n-1,n/2)<<'\n';
	printclock;
}


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

int main() {
 int K,S, counts = 0, Z = 0;
  cin >> K >> S;
  
  for(int i = 0; i < K+1; i++){
   for(int j = 0; j < K+1; j++){
    Z = S - i - j;
     if(Z < K+1 && Z > -1) counts++;
   }    
  }
  cout << counts << endl;
}


Measured memory_bytes: 3588
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <map>
#include <set>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define INF 100000000000
#define MOD 100000007 //10^9+7
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    int n, m, k, i, j;
    set<string> ans;

    cin >> n;
    rep(i,n) {
        string tmp;
        cin >> tmp;
        ans.insert(tmp);
    }

    cout << ans.size() << endl;
    return 0;
}


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

struct memo {
  int x;
  int y;
  int xx;
  int yy;
};

int main() {
  int H, W; cin >> H >> W;
  vector<vector<int>> a(H, vector<int>(W));
  rep(i, H)rep(j, W) cin >> a[i][j];
  vector<memo> vec;
  rep(i, H)rep(j, W) {
    if (a[i][j]%2) {
      memo tmp;
      tmp.x = j+1;
      tmp.y = i+1;
      if (j < W-1) {
        tmp.xx = j+2;
        tmp.yy = i+1;
        a[i][j+1]++;
        vec.push_back(tmp);
      }
      else if (i < H-1){
        tmp.xx = j+1;
        tmp.yy = i+2;
        a[i+1][j]++;
        vec.push_back(tmp);
      }
    }
  }
  cout << vec.size() << endl;
  rep(i, vec.size()) {
    cout << vec[i].y << " " << vec[i].x << " " << vec[i].yy << " " << vec[i].xx << endl;
  }
}


Measured memory_bytes: 5232
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(register int i=st,i##end=ed;i<=i##end;++i)
#define DREP(i,st,ed) for(register int i=st,i##end=ed;i>=i##end;--i)
typedef long long ll;
template<typename T>inline bool chkmin(T &x,T y){return (y<x)?(x=y,1):0;}
template<typename T>inline bool chkmax(T &x,T y){return (y>x)?(x=y,1):0;}
inline int read(){
	int x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1)+(x<<3)+(c^'0');
	return x*f;
}
inline ll readll(){
	ll x;
	char c;
	int f=1;
	while((c=getchar())!='-' && (c>'9' || c<'0'));
	if(c=='-') f=-1,c=getchar();
	x=c^'0';
	while((c=getchar())>='0' && c<='9') x=(x<<1ll)+(x<<3ll)+(c^'0');
	return x*f;
}
const int maxn=50+5;
int ans,n,fa[maxn],fb[maxn],cnt,p[maxn],deg[maxn];
vector<int> A[maxn],B[maxn];
void dfsa(int x){
	if(!p[x]) ++cnt;
	for(auto v:A[x]) if(v!=fa[x]){
		fa[v]=x;
		p[v]=(p[x]|(find(B[x].begin(),B[x].end(),v)==B[x].end()));
		dfsa(v);
		++deg[x];
	}
}
void dfsb(int x){
	for(auto v:B[x]) if(v!=fb[x]){
		fb[v]=x;
		dfsb(v);
	}
}
inline int work(int rt){
	REP(i,1,n) p[i]=deg[i]=0;
	cnt=0;
	fa[rt]=fb[rt]=0;
	dfsa(rt);
	if(cnt<=ans) return -1;
	dfsb(rt);
	set<int> st;
	REP(i,1,n) if(p[i] && !deg[i]) st.insert(i);
	while(1){
		int x=0;
		for(auto u:st) if(!p[fb[u]]){x=u;break;}
		if(x==0) break;
		st.erase(x),p[x]=0;
		--deg[fa[x]];
		if(!deg[fa[x]] && p[fa[x]]) st.insert(fa[x]);
	}
	REP(i,1,n) if(p[i]) return -1;
	return cnt;
}
int main(){
	int T=read();
	while(T--){
		ans=-1;
		n=read();
		REP(i,1,n-1){
			int x=read(),y=read();
			A[x].push_back(y),A[y].push_back(x);
		}
		REP(i,1,n-1){
			int x=read(),y=read();
			B[x].push_back(y),B[y].push_back(x);
		}
		REP(i,1,n) chkmax(ans,work(i));
		if(ans==-1) REP(i,1,n) if(A[i].size()==1){
			int u=A[i][0];
			A[i].pop_back();
			A[u].erase(find(A[u].begin(),A[u].end(),i));
			REP(j,1,n) if(j!=i && j!=u){
				A[j].push_back(i);
				A[i].push_back(j);
				chkmax(ans,work(i)-1);
				A[j].pop_back();
				A[i].pop_back();
			}
			A[i].push_back(u),A[u].push_back(i);
		}
		printf("%d\n",ans==-1?ans:n-ans);
		REP(i,1,n) A[i].clear(),B[i].clear();
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) xmax = x; return true;
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) xmin = x; return true;
    return false;
}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr); ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;

class Prime
{
public:
    static bool is_prime(long long n) {
        if (n == 1) return false;
        for (ll a = 2; a * a <= n; ++a) if (n % a == 0) return false;
        return true;
    }
    static std::vector<long long> listup(long long n) {
        std::vector<long long> ret;
        for (long long i = 1; i * i < n; ++i) {
            if (n % i == 0) ret.push_back(i);
            long long other = n / i;
            if (other != i) ret.push_back(other);
        }
        std::sort(ret.begin(), ret.end());
        return ret;
    }
    static std::vector<std::pair<long long, long long>> factorize(long long n) {
       std::vector<pair<ll, ll>> res;
        for (ll a = 2; a * a <= n; ++a) {
            if (n % a != 0) continue;
            ll ex = 0;
            while (n % a == 0) {
                ++ex;
                n /= a;
            }
            res.push_back({a, ex});
        }
        if (n != 1) res.push_back({n, 1});
        return res;
    }
};

long long calc_digit(long long n, int& num) {
    long long sum = 0;
    num = 0;
    while(n > 0) {
        ++num;
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

void solve() {
    ll n; cin >> n;
    int ret = (1<<29);
    for (ll a = 1; a*a <= n; ++a) {
        if (n % a == 0) {
            ll b = n / a;
            int anum, bnum;
            calc_digit(a, anum);
            calc_digit(b, bnum);
            int f = max(anum, bnum);
            chmin(ret, f);
        }
    }
    cout << ret << endl;    
}

signed main() {
    solve();
    return 0;
}

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

int main(){
    int A[3];
    scanf("%d %d %d", A, A+1, A+2);
    int lowest = min({A[0], A[1], A[2]}), highest = max({A[0], A[1], A[2]});
    unsigned candidate, answer = 78;
    for (int goal = lowest; goal <= highest + 1; goal++){
        candidate = 0;
        for (size_t i = 0; i < 3; i++){
            if(A[i] >= goal) candidate += A[i] - goal;
            else{
                candidate += goal - A[i] >> 1;
                if(goal - A[i] & 1) candidate += 2;
            }
        }
        if(candidate < answer) answer = candidate;
    }
    printf("%u\n", answer);
	return 0;
}

Measured memory_bytes: 1728
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int MOD=1000000007;

int main(){
    ll n,m,x,ans;
    ans=0;
    int i;
    cin>>n>>m;
    priority_queue<ll> que;
    rep(i,n){
        cin>>x;
        que.push(x);
    }
    rep(i,m){
        x=que.top(); que.pop();
        x/=2;
        que.push(x);
    }
    while(!que.empty()){
        ans+=que.top(); que.pop();
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1400
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
////////////////////////////


int main(){fastio
    ll a,b;cin>>a>>b;
    string s,t;
    rep(i,1,b)s+=to_string(a);
    rep(i,1,a)t+=to_string(b);
    cout<<min(s,t)<<endl;
    
    
    return 0;
}


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

using namespace std;

typedef long long ll;

const ll MAXI = 1000001;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> inc(MAXI, 0);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        ++inc[a[i]];
    }
    
    if (inc[1] > 0) {
        if (inc[1] > 1) {
            cout << "0\n";
        } else {
            cout << "1\n";
        }
        return 0;
    }
    
    int cou = 0;
    for (ll i = 2; i < MAXI; ++i) {
        if (inc[i] == 0) {
            continue;
        }
        if (inc[i] == 1) {
            ++cou;
        }
        for (ll j = i + i; j < MAXI; j += i) {
            inc[j] = 0;
        }
    }
    cout << cou << "\n";
    
    return 0;
}


Measured memory_bytes: 7912
#include <bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1<<29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
const int MOD=1000000007;

bool isPowerOfTwo (ll x)  
{  
    return x && (!(x&(x-1)));  
}
bool isPrime(int n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
int highestPowerof2(unsigned int n) 
{ 
    // Invalid input 
    if (n < 1) 
        return 0; 
  
    int res = 1;
    for (int i=0; i<8*sizeof(unsigned int); i++) 
    { 
        int curr = 1 << i; 
        if (curr > n) 
           break; 
  
        res = curr; 
    } 
  
    return res; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}       
////////////////////////////////////////////////////////////////////

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(NULL);
  ll t=1;
  while(t--)
  {
    int n;
    cin>>n;
    int a[n];
    REP(i,n)cin>>a[i];
    int x=1;
    REP(i,n)
    {
        if(a[i]==x)
        x++;
    }
    if(x==1)cout<<-1;
    else cout<<n-(x-1);
  }  
  return 0;
}

Measured memory_bytes: 1024
import sys
H,W,M=map(int, input().split())
h=[]
w=[]
Hcount=[0 for _ in range(H)]
Wcount=[0 for _ in range(W)]
B=set()

for i in range(M):
    hi,wi=map(int, input().split())
    #h.append(hi)
    #w.append(wi)
    B.add((hi,wi))
    Hcount[hi-1]+=1
    Wcount[wi-1]+=1
Hcountmax=max(Hcount)
Wcountmax=max(Wcount)
h_max=[i for i, v in enumerate(Hcount) if v == Hcountmax]
w_max=[i for i, v in enumerate(Wcount) if v == Wcountmax]
#print(h_max,w_max)
for ii in h_max:
    for jj in w_max:
        if (ii+1,jj+1) not in B:
            print(max(Hcount)+max(Wcount))
            sys.exit()
print(max(Hcount)+max(Wcount)-1)

Measured memory_bytes: 83368
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define curr(P, i) P[i]
#define next(P, i) P[(i+1)%P.size()]
const double EPS = 1e-8;
const int N = 3;
typedef complex<double> P;

typedef vector<P> G;

struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

double cross(const P& a, const P& b) { return imag(conj(a)*b); }
double dot(const P& a, const P& b) { return real(conj(a)*b); }

bool intersectSP(const L &s, const P &p) {
  return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS; // triangle inequality
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}

double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}

enum { OUT, ON, IN };
int contains(const G &g, const P &p) {
  bool in = false;
  for (int i = 0; i < g.size(); ++i) {
    P a = curr(g,i) - p, b = next(g,i) - p;
    if (imag(a) > imag(b)) swap(a, b);
    if (imag(a) <= 0 && 0 < imag(b))
      if (cross(a, b) < 0) in = !in;
    if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
  }
  return in ? IN : OUT;
}

bool input(P &p){
  int x, y; cin >>x >>y;
  p = P(x, y);
  return !(x == 0 && y == 0);
}

char solve(G &g, P &p, int r){
  double maxd = 0, mind = 1e9;
  REP(i, N){
    maxd = max(maxd, abs(curr(g, i) - p));
    mind = min(mind, distanceSP(L(curr(g, i), next(g, i)), p));
  }
  if(maxd <= r) return 'b';
  int cont = contains(g, p);
  if(cont == IN && mind >= r) return 'a';
  if(cont == OUT && mind > r) return 'd';
  return 'c';
}

int main() {
  G g(N);
  while(input(g[0])){
    FOR(i, 1, N) input(g[i]);
    P p; int r;
    input(p); cin >>r;
    cout <<solve(g, p, r) <<endl;
  }
  return 0;
}

Measured memory_bytes: 1208
def valid(dt, dx, dy)
  m = dx.abs + dy.abs
  m <= dt and (dt - m).even?
end

n = gets.to_i
x, y = 0, 0
t = 0
n.times do
  t_, x_, y_ = gets.split.map(&:to_i)
  if valid(t_ - t, x - x_, y - y_)
    next
  else
    puts :No
    exit
  end
end
puts :Yes


Measured memory_bytes: 1916
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
long long h,w;
cin >> h >> w;
if(h == 1 || w == 1){
	cout << "1" << '\n';
	}
else if(h % 2 == 0 && w % 2 == 1){
	cout << h * w / 2 << '\n';
	}
else if(h % 2 == 1 && w % 2 == 0){
	cout << h * w / 2 << '\n';
	}
else if(h % 2 == 0 && w % 2 == 0){
	cout << h * w / 2 << '\n';
	}
else if(h % 2 == 1 && w % 2 == 1){
	cout << h * w / 2 + 1 << '\n';
	}
return 0;
}

Measured memory_bytes: 3480
import java.util.Scanner;

class Main {
	public static void main(String[] a) {
		Scanner scanner = new Scanner(System.in);
		
		RightTriangle[] triangle = new RightTriangle[scanner.nextInt()];
		
		for(int i = 0; i < triangle.length; i++) {
			triangle[i] = new RightTriangle(scanner.nextInt(), scanner.nextInt(), scanner.nextInt());
		}
		
		for(int i = 0; i < triangle.length; i++) {
			System.out.println(triangle[i].judge());
		}
		
	}
}

class RightTriangle {
	private int hypotenuse;
	private int side;
	private int otherside;
	
	public RightTriangle(int x, int y, int z) {
	  if(x < y) {
	  	int temp = x;
	  	x = y;
	  	y = temp;
	  }
	  if(x < z) {
	  	int temp = x;
	  	x = z;
	  	z = temp;
	  }
	  hypotenuse = x;
	  side = y;
	  otherside = z;	  
	}
	
	public String judge() {
		boolean judge = (hypotenuse * hypotenuse == side * side + otherside * otherside);
		if(judge) {
		  return "YES";
		} else {
			return "NO";
		}
	}
}

Measured memory_bytes: 24152
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c, d, e, f,i,j,k,l,ans1,ans2;
  cin >> a >> b >> c >> d >> e >> f;
  ans1=0;
  ans2=0;
  double co=-5;
  for (i=0;i*a*100<=f;i++){
    for(j=0;i*a*100+j*b*100<=f;j++){
      int w=i*a*100+j*b*100;
      for(k=0;c*k<=e*w/100&&w+c*k<=f;k++){
        int s=c*k;
        for (l=0;s+d<=e*w/100&&w+s+d<=f;l++){
          s+=d;
        }
        if(w!=0){
          double res=1000000*s/(w+s);
          if(co<res){
            co=res;
            ans1=w+s;
            ans2=s;
          }
        }
      }
    }
  }
  cout << ans1 << ' ' << ans2 << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    int a,b,c;
    public void Germany() {
        Scanner sc = new Scanner(System.in);
            a = sc.nextInt();
            b = sc.nextInt();
            c = sc.nextInt();
        if(a < b && b < c) {
        System.out.println("Yes");
        }else{
            System.out.println("No");
                }
    }
    public static void main(String[] args) {
        new Main().Germany();
    }
}

Measured memory_bytes: 17156
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define files(name) name!=""?freopen(name".in","r",stdin),freopen(name".out","w",stdout):0
#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define elif else if
#define mp make_pair
#define pb push_back
#define fir first
#define sec second

using namespace std;
#define int long long

typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long double ld;
typedef long long ll;

const int arr=2e5+10;
const int ar=2e3+10;
const ld pi=acos(-1);
const ld eps=1e-10;
const ll md=1e9+7;

///---program start---///

string s;

int dp[arr][6];

bool eq(int l1,int r1,int l2,int r2)
{
    if (r1-l1!=r2-l2){
        return 0;
    }
    for (int i=0;i<r1-l1+1;i++){
        if (s[l1+i]!=s[l2+i]){
            return 0;
        }
    }
    return 1;
}

main()
{
    #ifdef Barik
        files("barik");
        freopen("debug.txt","w",stderr);
    #endif

    cin>>s;
    dp[0][0]=0;
    for (int i=0;i<len(s);i++){
        for (int from=0;from<6;from++){
            for (int to=1;to<6&&i<=len(s);to++){
                if (from==0||!eq(i-from,i-1,i,i+to-1)){
                    dp[i+to][to]=max(dp[i+to][to],dp[i][from]+1);
                }
            }
        }
    }
    int ans=0;
    for (int i=1;i<6;i++){
        ans=max(ans,dp[len(s)][i]);
    }
    cout<<ans<<"\n";
}


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

int main(){
	int n;
	cin >> n;
	long long a[n];
	for( int i = 0; i < n; ++i )
		cin >> a[i];
	
	long long cnt = 0;
	bool bl = false;
	while( 1 ){
		for( int i = 0; i < n; ++i ){
			if( a[i]%2 == 0 ){
				a[i] /= 2;
			} else {
				bl = true;
				break;
			}
		}
		if( bl )
			break;
		cnt++;
	}
	cout << cnt << endl;
	return 0;
}

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

int main(){
  int x,y; cin >> x >> y;
  int ans_area = x * y;
  int ans_perimeter = x * 2 + y * 2;
  cout << ans_area << " " << ans_perimeter << endl;

  return 0;
}


Measured memory_bytes: 3088
n, k = input().split()
strN = list()
for num in n:
    if num not in strN: strN.append(int(num))
sorted(strN)
N = int(n)
K = int(k)
nonFavDigits = input().split()
NonFavDigits = list()
for nFD in nonFavDigits:
    NonFavDigits.append(int(nFD))
Digits = list(range(0,10))
for dig in range(0,10):
    if dig in NonFavDigits: Digits.remove(dig)
flag = 0
if(all(x in Digits for x in strN)): flag = 1
if(flag):   print(N)
else:
    finalNum = N+1
    strFN = list()
    for num in str(finalNum):
        if num not in strFN: strFN.append(int(num))
    while not all(x in Digits for x in strFN):
        finalNum+=1
        strFN = list()
        for num in str(finalNum):
            if num not in strFN: strFN.append(int(num))
    print(finalNum)


Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n,r;
    cin>>n>>r;
    cout<<r+100*(10-n)*(n<10)<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll MX = 1e18;
const ll MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MAX = 1000001;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {fac[0] = fac[1] = 1;finv[0] = finv[1] = 1;inv[1] = 1;for (int i = 2; i < MAX; i++){fac[i] = fac[i - 1] * i % MOD;inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;finv[i] = finv[i - 1] * inv[i] % MOD;}}
long long COM(int n, int k){if (n < k) return 0;if (n < 0 || k < 0) return 0;return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;}

int main() {
  int a,b;
  cin>>a>>b;
  if(abs((a-b))%2==0){
    cout<<(a+b)/2<<endl;
    return 0;
  }
  cout<<"IMPOSSIBLE"<<endl;
}

Measured memory_bytes: 3520
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <set>

using namespace std;

typedef long long i64;
typedef i64 int_t;
typedef vector<int_t> vi;
typedef vector<vi> vvi;

typedef pair<int_t, int_t> pi;

#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define pb push_back
#define sz(a) int((a).size())
#define all(c) (c).begin(), (c).end()
#define REP(s, e, i) for(i=(s); i < (e); ++i)

pair<bool, i64> check(vector<pi> &S) {
  i64 i;
  sort(all(S), [](const pi &lhs, const pi &rhs) {
      if(lhs.first == rhs.first) {
	return lhs.second > rhs.second;
      }
      return lhs.first > rhs.first;
    });
  i64 cur = 0;
  REP(0, sz(S), i) {
    //cout << S[i].first << " " << S[i].second << endl;
    i64 m = S[i].first, t = S[i].second;
    if(cur + m < 0) {
      return {false, -1};
    }
    cur += t;
  }
  return {true, cur};
}

int main(int argc, char *argv[]) {
  i64 N, i, j;
  cin >> N;
  vector<pi> S_pos, S_neg; // minimum, total
  REP(0, N, i) {
    string S;
    cin >> S;
    i64 t = 0;
    i64 m0 = 0;
    REP(0, sz(S), j) {
      if(S[j] == '(') {
	t++;
      }
      else {
	t--;
      }
      m0 = min(m0, t);
      //m1 = max(m1, t);
    }
    if(t >= 0) {
      S_pos.pb({m0, t});
    }
    else {
      S_neg.pb({m0 - t, -t});
    }
  }

  //cout << "check1" << endl;
  pair<bool, i64> res1 = check(S_pos);
  //cout << "check2" << endl;
  pair<bool, i64> res2 = check(S_neg);

  if(res1.first && res2.first && res1.second == res2.second) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }

  return 0;
}


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

bool provera(string s,int x,int y)
{
    while(x<y && s[x]==s[y])
    { x++; y--; }

    if(x>=y)
        return true;
    else
        return false;
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    string s;
    int n;
    cin >> s; n=s.size();
    if(provera(s,0,n-1) && provera(s,0,(n-1)/2-1) && provera(s,(n+3)/2-1,n-1))
        cout << "Yes";
    else
        cout << "No";
}


Measured memory_bytes: 256
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt
from fractions import gcd
from itertools import permutations, combinations

def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas



H, N = mulinputs()
As = list(mulinputs())

As.sort(reverse=True)

flg = False
sum = 0
for a in As:
    sum += a
    if H - sum <= 0:
        flg = True
        break

# 出力
if flg:
    print('Yes')
else:
    print('No')




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

int main()
{
	int N;
	scanf("%d", &N);
	std::vector<std::pair<std::pair<std::string, int>, int>> rest(N);
	for (int i{}; i < N; i++)
	{
		std::cin >> rest[i].first.first >> rest[i].first.second;
		rest[i].first.second *= -1;
		rest[i].second = i;
	}
	std::sort(rest.begin(), rest.end());
	for (auto& e: rest)
		printf("%d\n", e.second + 1);

	return 0;
}

Measured memory_bytes: 256
// AOJ GRL_3_B: Connected Components - Bridges
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define Get(t, i) get<(i)>((t))
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

const int inf = 1 << 25;
const ll INF = 1LL << 55;

struct UnionFind
{
  vector<int> data;
  UnionFind(int sz):data(sz, -1){};
  int size(int x) { return -data[find(x)]; }  
  int find(int x) { return data[x] < 0 ? x : data[x] = find(data[x]); }
  bool same(int x, int y) { return find(x) == find(y); }  
  int unite(int x, int y)
  {
    x = find(x), y = find(y);
    if(x != y) {
      if(data[x] < data[y]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return -data[x];
  }
};

// Biconnected Components (lowlink)
struct BICC
{
  UnionFind uf;
  vector< vector<int> > graph, tree;
  vector<Pi> edges;
  vector<bool> vis;
  vector<int> ord, low, cmp;
  vector<int> articulation;
  vector<Pi> bridge;
  BICC(int sz):uf(sz), graph(sz), vis(sz, false), ord(sz), low(sz), cmp(sz){}
  void add_edge(int u, int v)
  {
    graph[u].emplace_back(v);
    graph[v].emplace_back(u);
    edges.emplace_back(minmax(u, v));
  }
  void dfs(int u, int p, int& k)
  {
    vis[u] = true;
    
    ord[u] = low[u] = k++;

    bool is_articulation = false;
    int cnt = 0;
    
    for(auto v : graph[u]) {
      if(!vis[v]) {
	cnt++;
	dfs(v, u, k);
	low[u] = min(low[u], low[v]);
	if(~p && ord[u] <= low[v]) is_articulation = true;
	if(ord[u] < low[v]) bridge.emplace_back(minmax(u, v));
	else uf.unite(u, v);
      } else if(v != p) {
	low[u] = min(low[u], ord[v]);
      }
    }
    
    if(p == -1 && cnt > 1) is_articulation = true;
    if(is_articulation) articulation.push_back(u);
  }
  void compose()
  {
    int k = 0;
    dfs(0, -1, k);

    int num = 0;
    vector<int> conn(graph.size());
    for(int i = 0; i < graph.size(); i++) {
      if(i == uf.find(i)) conn[i] = num++;
    }

    tree.resize(num);
    for(int i = 0; i < graph.size(); i++) {
      cmp[i] = conn[uf.find(i)];
    }
    for(auto e : edges) {
      int x = cmp[e.first], y = cmp[e.second];
      if(x == y) continue;
      tree[x].emplace_back(y);
      tree[y].emplace_back(x);
    }
  }
};


int main()
{
  int V, E; cin >> V >> E;
  BICC bicc(V);
  while(E--) {
    int s, t;
    cin >> s >> t;
    bicc.add_edge(s, t);
  }
  bicc.compose();
  sort(all(bicc.bridge));
  rep(i, bicc.bridge.size()) cout << bicc.bridge[i].first << " " << bicc.bridge[i].second << endl;
  return 0;
}

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

void insertionSort(int* A, int N){
    for(int i = 0; i < N; i++){
        int temp = A[i];
        int j = i - 1;
        while(j >= 0 and A[j] > temp){
            A[j + 1] = A[j];
            j--;
        }
        A[j+1] = temp;
        for(int k = 0; k < N; k++){
            if(k > 0){
                cout << " ";
            }
            cout << A[k];
        }
        cout << endl;
    }
}

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

    int* A;
    A = new int[N];

    for(int i = 0; i < N; i++){
        cin >> A[i];
    }

    insertionSort(A, N);

    delete [] A;
    
    return 0;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
// atoi : atoi(変数名.c_str())
// find(): int i = 変数名.find(“文字列”) 何番目にあるかを得る
// cout << (条件 ? "Yes" : "No") << endl;
// 降順 sort(a.begin(),a.end(),greater<int>());
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0; i<(int)(n);i++)

int main(){
  int sx,sy,tx,ty;
  cin >> sx >> sy >> tx >> ty;
  int dx = tx - sx;
  int dy = ty - sy;
  rep(i,dx) cout << "R";
  rep(i,dy) cout << "U";
  rep(i,dx) cout << "L";
  rep(i,dy) cout << "D";
  cout << "D";
  rep(i,dx+1) cout << "R";
  rep(i,dy+1) cout << "U";
  cout << "LU";
  rep(i,dx+1) cout << "L";
  rep(i,dy+1) cout << "D";
  cout << "R" << endl;
}

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

int main()
{
	string s;
	cin>>s;

	int cntA=0,cntB=0;
	for(int i=0;i<3;i++)
	{
		if(s[i] == 'A')
			cntA++;
		if(s[i] == 'B')
			cntB++;
	}

	if(cntA && cntB)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define il inline
#define rg register
#define lch(x) ((x)<<1)
#define rch(x) ((x)<<1^1)
#define rep(i,st,ed) for(rg int i=(st);i<=(ed);++i)
#define per(i,ed,st) for(rg int i=(ed);i>=(st);--i)
#define rep0(i,n) for(rg int i=0;i<(n);++i)
#define per0(i,n) for(rg int i=(n)-1;i>=0;--i)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef double dbl;
typedef long double ldb;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T> il T qmin(const T &x,const T &y){return x<y?x:y;}
template<typename T> il T qmax(const T &x,const T &y){return x>y?x:y;}
template<typename T> il void getmin(T &x,const T &y){if(y<x) x=y;}
template<typename T> il void getmax(T &x,const T &y){if(y>x) x=y;}
il void fileio(const string &s){
	freopen((s+".in").c_str(),"r",stdin);
	freopen((s+".out").c_str(),"w",stdout);
}

const int inf=(int)1e9+7;
const ll linf=(ll)1e18+7;
const int N=1e5+7;

int n,sum[N];

int main(){
//	fileio("test");
	scanf("%d",&n);
	rep(i,1,n-1){
		int x=i;
		while(x){
			sum[i]+=x%10;
			x/=10;
		}
	}
	int ans=inf;
	rep(i,1,n-1) getmin(ans,sum[i]+sum[n-i]);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <utility>

using namespace std;

#define int long long

typedef pair<int, int> pii;

int N, W;

int v[45], w[45];
int dp[1 << 21];

signed main()
{
    cin >> N >> W;

    for (int i = 0; i < N; ++i) {
        cin >> v[i] >> w[i];
    }

    vector<pii> arr1, arr2;

    int len1 = N / 2, len2 = N - len1;

    for (int bit = 0; bit < (1 << len1); ++bit) {
        pii hoge(0, 0);

        for (int j = 0; j < len1; ++j) {
            if (bit >> j & 1) {
                hoge.first += w[j], hoge.second -= v[j];
            }
        }

        arr1.push_back(hoge);
    }

    for (int bit = 0; bit < (1 << len2); ++bit) {
        pii hoge(0, 0);

        for (int j = 0; j < len2; ++j) {
            if (bit >> j & 1) {
                hoge.first += w[j + len1], hoge.second -= v[j + len1];
            }
        }

        arr2.push_back(hoge);
    }

    sort(begin(arr1), end(arr1));
    sort(begin(arr2), end(arr2));

    dp[0] = -arr2[0].second;
    for (int i = 1; i < arr2.size(); ++i) dp[i] = max(dp[i - 1], -arr2[i].second);

    int ma = 0;

    int now = -1, idx = (int)arr2.size() - 1;;
    for (int i = 0; i < arr1.size(); ++i) {
        while (idx && arr1[i].first + arr2[idx].first > W) idx--;

        if (arr1[i].first + arr2[idx].first > W) continue;

        ma = max(ma, -arr1[i].second + dp[idx]);
    }

    cout << ma << endl;
}

Measured memory_bytes: 44036
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep_1(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define rep_2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int inf = 1e9;
const int mod = 1e9+7;
const ll linf = 1e18;

int main()
{
  ll x; cin >> x;
  ll ans = 0;
  ans = x / 500;
  ans *= 1000;
  x = x % 500;
  ans += (x / 5) * 5;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 764
let is_palindrome str = 
  let n = String.length str in
  List.fold_left (&&) true @@
  List.init (n/2) @@ fun i -> str.[i] = str.[n-1-i]

let () =
  let s = read_line () in
  let n = String.length s in
  Printf.printf "%s\n" @@
  if
    is_palindrome s &&
    is_palindrome (String.sub s 0 ((n-1)/2)) &&
    is_palindrome (String.sub s ((n+1)/2) ((n-1)/2))
  then "Yes"
  else "No"

Measured memory_bytes: 3620
// 九九を出すだけ
package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main(){
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	for sc.Scan(){
	    s := nextIntIs()
	    sc.Scan()
	    t := nextIntIs()
        a := len(strconv.Itoa(s+t))
	    fmt.Fprintln(out, a)
	}
}

func next() string{
	sc.Scan()
	return sc.Text()
}

func nextInt() int{
	a, _ := strconv.Atoi(next())
	return a
}

func nextIntIs() int{
	a, _ := strconv.Atoi(sc.Text())
	return a
}


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ll          long long
#define pb          push_back
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define rs(v,n)     v.resize(n)
#define hell        1000000007
#define peak        9123372036854775807
#define pii         acos(-1)
#define clr(a,x)    memset(a,x,sizeof(a))
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class x,class y> x sum(x a,y b){return a+b;}
template<class x,class y> x mul(x a,y b){return a*b;}
template<class x,class y> x sub(x a,y b){return a-b;}
template<class x,class y> x divi(x a,y b){return a/b;}

template<class x,class y>
istream &operator>>(istream &in,pair<x,y> &p) 
{ 
    in>>p.F>>p.S;
    return in;
}
template<class x>
istream &operator>>(istream &in,vector<x> &v) 
{
    for(auto& i:v)
        in>>i;
    return in;
}
template<class x,class y>
ostream &operator<<(ostream &out,pair<x,y> &p) 
{ 
    out<<"("<<p.F<<","<<p.S<<") ";
    return out; 
}
template<class x>
ostream &operator<<(ostream &out,vector<x> &v) 
{ 
    out<<v.size()<<endl;
    for(auto i:v)
        out<<i<<" ";
    out<<endl;
    return out; 
}
#define N  1000005

int main()
{
    ios;
    ll tt=1;
    // cin>>tt;
    while(tt--)
    {
    	ll i,j,k,l,m,n;
    	ll a[]={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};
    	cin>>n;
    	cout<<a[n-1];
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define N 100005
#define mod 1000000007
#define pp pair<ll,ll>
typedef long long int ll;
typedef long double ld;
typedef vector<pp> vpl;
#define MP make_pair

#define endl "\n"
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<n;i++)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define repb(i,n) for(ll i=1;i<n-1;i++)     
void fastIO(void);

void decimal(int);
ll modmulti(ll, ll, ll);
ll modadd(ll, ll, ll);
ll modpower(ll, ll, ll);
ll gcd(ll, ll );
ll modinv(ll, ll);







int main()
{
   decimal(8);
   ll n;
   cin>>n;
   ld a[n];
   rep(i,n) cin>>a[i];
   sort(a,a+n);
   ld sum = (a[0]+a[1])/2.0;
   for(ll i=2;i<n;i++){
      sum = (sum+a[i])/2.0;
   }
   cout<<sum<<endl;
   
}























void fastIO(void)
{  ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
}

void decimal(int n){
   cout<<fixed;
   cout<<setprecision(n);
}
ll modmulti(ll a, ll b, ll m){
   return ((a%m)*(b%m))%m;
}
ll modadd(ll a, ll b, ll m){
   return ((a%m)+(b%m)+m)%m;
}
ll modpower(ll a, ll n, ll m){
   if(n==0)
      return 1;
   ll result = 1;
   while(n>0){
      if(n%2==1)
         result = modmulti(result,a,m);
      a = modmulti(a,a,m);
      n = n/2;
   }
   return result;
}
ll gcd(ll a, ll b){
   if(b==0)
      return a;
   return gcd(b,a%b);
}
ll modinv(ll a, ll m){
   return modpower(a,m-2,m);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) (x).begin(), (x).end()
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
  #define debug(x) cerr << #x " => " << x << endl
#else
  #define debug(x) 0
#endif
using lint = long long;
constexpr int    INF  = 1 << 30;
constexpr lint   INFL = 1LL << 62;
constexpr int    MOD  = (int)1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

using Weight = int;
struct Edge {
  int src, dst;
  Weight weight;
  Edge(void) {}
  Edge(int src, int dst) : src(src), dst(dst) {}
  Edge(int src, int dst, Weight weight) : src(src), dst(dst), weight(weight) {}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void edges_to_graph(Graph &graph, const Edges &edges, const int vertices, const bool directed = true) {
  graph.resize(vertices);
  for (const auto &e : edges) graph[e.src].emplace_back(e);
  if (!directed) for (const auto &e : edges) graph[e.dst].emplace_back(Edge(e.dst, e.src, e.weight));
}

void dfs(Graph &g, int v, vector<int> &route, vector<bool> &checked, bool &ok, const vector<bool> &vlist, const int len) {
  if ((int)route.size() >= len - 1) return;
  route.push_back(v);
  if (checked[v]) {
    ok = true;
    return;
  }
  checked[v] = true;
  for (const auto &e : g[v]) {
    if (!vlist[e.dst]) continue;
    dfs(g, e.dst, route, checked, ok, vlist, len);
    if (ok) return;
  }
  route.pop_back();
  checked[v] = false;
}

Graph graph;
int main(void) {
  int n, m;
  cin >> n >> m;
  Edges edges(m);
  rep (i, m) {
    int a, b;
    cin >> a >> b;
    edges[i] = {--a, --b};
  }
  edges_to_graph(graph, edges, n);
  vector<int> route(n + 1);
  iota(all(route), 0);
  bool changed = true;
  int  len = INT_MAX;
  while (changed) {
    changed = false;
    vector<bool> vlist(n);
    rep (i, route.size() - 1) vlist[route[i]] = true;
    rep (i, route.size() - 1) {
      vector<bool> checked(n);
      bool ok = false;
      vector<int> newroute;
      dfs(graph, route[i], newroute, checked, ok, vlist, len);
      if (ok) {
        int start = newroute.back();
        rep (j, newroute.size()) {
          if (newroute[j] == start) {
            route = vector<int>(newroute.begin() + j, newroute.end());
            len   = newroute.size() - j;
            break;
          }
        }
        changed = true;
        break;
      }
    }
  }
  len = len != INT_MAX ? len - 1 : -1;
  cout << len << endl;
  rep (i, len) cout << route[i] + 1 << "\n";
  return 0;
}

Measured memory_bytes: 512
#include <stdio.h>

int main(void)
{
	int h, w;
	int i, j;

	while(scanf("%d %d", &h, &w)!=EOF && !(h==0 && w==0)){
		for(i=0;i<h;i++){
			for(j=0;j<w;j++){
				if((i+j)%2 == 0)
					printf("#");
				else
					printf(".");
			}
			printf("\n");
		}
		printf("\n");
	}

	return 0;
}

Measured memory_bytes: 572
#include<bits/stdc++.h>
using namespace std;
int N,K;

bool ans[100005];
vector<int> G[100005];
int depth[100005];
int parent[100005];

void dfs(int pos,int d=0){
  depth[pos]=d;
  for(int i=0;i<(int)G[pos].size();i++){
    int to=G[pos][i];
    dfs(to,d+1);
  }
}

int main(){
  
  cin>>N>>K;
  for(int i=1;i<=N;i++){
    int x;
    cin>>x;
    if(x==0)ans[i]=1;
    else{
      G[x].push_back(i);
      parent[i]=x;
    }
  }
  
  for(int i=1;i<=N;i++){
    if(ans[i])dfs(i);
  }
  
  typedef pair<int,int> P;
  vector<P> vec;
  for(int i=1;i<=N;i++){
    if(G[i].empty())
      vec.push_back( P(depth[i],i) );
  }
  sort(vec.begin(),vec.end());
  for(int i=0;i<(int)vec.size();i++){
    int p=vec[i].second;
    for(int j=0;j<K;j++){
      if(ans[p])break;
      ans[p]=1;
      p=parent[p];
    }
  }

  int count=0;
  for(int i=1;i<=N;i++){
    count+=ans[i];
  }
  
  cout<<count<<endl;
  return 0;
}

Measured memory_bytes: 14112
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_set>
#include<unordered_map>

using namespace std;

#define MAX 100002

int n;
int m;
int s;
int tt;

struct st{
	int to;
	long long int a;
	long long int b;
};
vector<st> v[MAX];

long long int dist1[MAX];
long long int dist2[MAX];

queue<int> q;



int main(){
	cin >> n >> m >> s >> tt;
	for (int i = 0; i < m; i++){
		int u, vv, a, b;
		scanf("%d%d%d%d", &u, &vv, &a, &b);
		u--;
		vv--;
		v[u].push_back({ vv, a, b });
		v[vv].push_back({ u, a, b });
	}
	for (int i = 0; i < MAX; i++){
		for (int j = 0; j < 2; j++){
			dist1[i] = LLONG_MAX;
			dist2[i] = LLONG_MAX;
		}
	}
	s--;
	dist1[s] = 0;
	q.push(s);
	while (!q.empty()){
		int b = q.front();
		q.pop();
		for (auto f : v[b]){
			int go = f.to;
			long long int nex = dist1[b];
			nex += f.a;
			if (dist1[go] > nex){
				dist1[go] = nex;
				q.push(go);
				continue;
			}
		}
	}
	tt--;
	dist2[tt] = 0;
	q.push(tt);
	while (!q.empty()){
		int b = q.front();
		q.pop();
		for (auto f : v[b]){
			int go = f.to;
			long long int nex = dist2[b];
			nex += f.b;
			if (dist2[go] > nex){
				dist2[go] = nex;
				q.push(go);
				continue;
			}
		}
	}
	vector<long long int> v1;
	long long int c = LLONG_MAX;
	for (int i = n-1; i >=0 ; i--){
		c = min(c, dist1[i] + dist2[i]);
		v1.push_back(c);
	}
	long long int A = 10LL;
	for (int i = 0; i < 14; i++){
		A *= 10LL;
	}
	while (v1.size()){
		printf("%lld\n", A - v1.back());
		v1.pop_back();
	}
	return 0;
}

Measured memory_bytes: 13172
#include<bits/stdc++.h>
int len,a1,a2,ans;
char o,s[200005];
int main()
{
	scanf("%s",s+1);
	len=strlen(s+1);
	a1=0;
	a2=0;
	ans=0;
	for (int i=1;i<=len;i++)
	{
		o=s[i];
		if (o=='g')
		{
			if (a1>a2)
			{
				ans++;
				a2++;
			} else
				a1++;
		} else
		{
			if (a1>a2)
				a2++; else
				a1++,ans--;
		}
	}
	std::cout << ans;
}

Measured memory_bytes: 384