akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

int n;
vector<int> g[200010];
int dist[200010];


void bfs(int s){
    queue<int> que;
    bool seen[n] = {};
    memset(dist, 0, sizeof(dist));
    que.push(s);
    seen[s] = true;
    while(!que.empty()){
        int v = que.front();
        que.pop();
        for(auto nv : g[v]){
            if (seen[nv]) continue;
            seen[nv] = true;
            dist[nv] = dist[v] + 1;
            que.push(nv);
        }
    }
}


int main(){
    cin >> n;
    rep(i, n - 1){
        int a, b;
        cin >> a >> b;
        a--, b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    bfs(0);
    int mx = 0;
    rep(i, n) mx = max(mx, dist[i]);

    int ns;
    rep(i, n) {
        if (dist[i] == mx) {
            ns = i;
            break;
        }
    }

    bfs(ns);
    rep(i, n) mx = max(mx, dist[i]);

    cout << (mx%3==1 ? "Second":"First") << endl;

    return 0;
}


Measured memory_bytes: 16480
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <array>
#include <tuple>
#include <random>

using namespace std;
typedef long long int ll;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()

#define inf 10000000000

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

    ll m;
    cin >> m;
    cout << 48 - m << endl;
}


Measured memory_bytes: 256
def f(x)
    x.to_s.length
end

def max(x,y)
    x>y ? x:y
end

n=gets.to_i
ans = f(n)
(2..Math.sqrt(n).ceil).each do |a|
    next if n % a != 0
    b = n/a
    t = max(f(a),f(b))
    ans = t if t < ans
end
puts ans


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

int main()
{
	int N;
	long long x;
	cin >> N >> x;
	vector<long long> a( N );
	long long all = 0;
	for( int i = 0; i < N; i++ ) {
		cin >> a[i];
		all += a[i];
	}

	int ans = 0;
	if( x <= all ) {
		sort( a.begin(), a.end() );
		for( int i = 0; i < N; i++ ) {
			if( x >= a[i] ) {
				x -= a[i];
				ans++;
			}
			else break;
		}
	}
	else ans = N - 1;

	cout << ans << endl;
}


Measured memory_bytes: 3648
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var t=sc.S;
		int n=t.Length,p=0;
		var hs=new Dictionary<int,int>{[0]=0};
		for(int i = 0;i<n;i++) {
			p^=1<<(t[i]-'a');
			int d=int.MaxValue;
			for(int j = 0;j<26;j++) {
				int g=p^(1<<j);
				if(hs.ContainsKey(g)){d=Min(d,hs[g]+1);}
			}
			if(!hs.ContainsKey(p)){hs.Add(p,d);}
			else{hs[p]=Min(hs[p],d);}
		}
		Console.WriteLine("{0}",p==0?1:hs[p]);
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 25824
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,c,m,r,coun;
    cin>>n>>m>>c;
    int b[m],a[m];
    for(int i=0; i<m; i++)
        cin>>b[i];
        coun=0;
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<m; j++){
            cin>>a[j];
        }
        r=c;
        for(int j=0; j<m; j++){
            r+=a[j]*b[j];
        }
        if(r>0)
            coun++;
    }
    cout<<coun<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int insert(int *,int,int);
void shell(int *,int);
int main(){
  int i,a[1000000],n;
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&a[i]);
  shell(a,n);
  return 0;
}
int insert(int *a,int n,int g){
  int i,j,v,cnt=0;
  for(i=0;i<n;i++){
    v=a[i];
    j=i-g;
    while(j>=0 && a[j]>v){
      a[j+g]=a[j];
      j=j-g;
      cnt++;
    }
    a[j+g]=v;
  }
  return cnt;
}
void shell(int *a,int n){
  int m,g[100],i,j,array,cnt=0;
  g[0]=1;
  for(m=1;m<100;m++){
    if(g[m-1]*3+1>=n)break;
    g[m]=g[m-1]*3+1;
  }
 
  printf("%d\n",m);
  for(i=m-1;i>=0;i--){
  printf("%d ",g[i]);
  if(i!=0)printf(" ");
   }
  printf("\n");
  for(i=m-1;i>=0;i--)cnt+=insert(a,n,g[i]);
  printf("%d\n",cnt);
  for(i=0;i<n;i++)printf("%d\n",a[i]);
}



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

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int A, B, C, K;
    cin >> A >> B >> C >> K;
    if(A >= K) cout << K << endl;
    else{
        int ans = A;
        K -= A; K -= B;
        if(K > 0) cout << ans - min(K, C) << endl;
        else cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3652
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b;
    while(scanf("%d%d",&a,&b)!=EOF)
    {
        if(a>=0&&b>=0&&a<=1000000&&b<=1000000)
        {
            int n=a+b,count=0;
            while(n)
            {
                count++;
                n/=10;
            }
            printf("%d\n",count);
        }
    }
    return 0;
}


Measured memory_bytes: 1832
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    ll N,K;
    cin >> N >> K;
    ll ans = 0;
    for(ll i=K;i<=N+1;i++){
        ans += i*((2*N-i+1))/2 - (i*(i-1)/2) + 1;
        ans = (ans + MOD)%MOD;
    }
    cout  << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
s = input()
L = []
sigma = 0
def sprit_sum(string, sprit, num):
    global sigma
    for i in range(1,len(string)+num-sprit):
        str_front = string[:i]
        str_back = string[i:]
        L.append(int(str_front)) 
        if num < sprit:
            sprit_sum(str_back, sprit, num+1)
        else:
            L.append(int(str_back))
            for x in L:
                sigma += x
            L.pop()
        L.pop()
        
for j in range(len(s)):
    sprit_sum(s, j+1, 1)
sigma += int(s)
print(sigma)


Measured memory_bytes: 9132
#include <bits/stdc++.h>
using namespace std;
 
typedef unsigned long long  ULL;
typedef long long LL;
 
#define pb push_back
#define mp make_pair
#define reset(a, b) memset(a, b, sizeof(a))
#define rep(i,b) for(int i=0; i<b; i++)
#define F first 
#define S second
 
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    int T;
//    cin>>T;
    T=1;
    while(T--){
       
       int n;
       cin>>n;
       cout<<(2*M_PI*n);
    }
    
    return 0;
}

Measured memory_bytes: 3804
#include<bits/stdc++.h>
using namespace std;
int n, m, x, y, z;
int from1[300000], fromlast[300000];

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

    for(int i = 1; i <= m; i++){
        scanf("%d %d", &x, &y);
        if(x == 1) from1[y] = 1;
        if(x == n) fromlast[y] = 1;
        if(y == 1) from1[x] = 1;
        if(y == n) fromlast[x] = 1;

    }

    for(int i = 2; i <= n - 1; i++){
        if(from1[i] && fromlast[i]){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }

    cout << "IMPOSSIBLE" << endl;



    return 0;
}


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

//#pragma GCC optimize("O3")
//#pragma GCC target("sse4")

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define ITER(it, a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a))

#define SZ(a) (int)((a).size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = (LL)INF * INF;

const int MAX = 1 << 18;

int diam = 0;
int furthest;
vector<int> g[MAX];

void dfs(int v, int p, int d)
{
	if(d > diam)
	{
		diam = d;
		furthest = v;
	}
	for(int to: g[v])
		if(to != p)
			dfs(to, v, d + 1);
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n;
	cin >> n;
	FOR(i, 0, n - 1)
	{
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		g[a].PB(b);
		g[b].PB(a);
	}
	dfs(0, -1, 0);
	dfs(furthest, -1, 0);
	cout << (diam % 3 == 1 ? "Second" : "First") << "\n";
	return 0;
}

Measured memory_bytes: 22016
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
Q = int(input())
B = [list(map(int, input().split())) for _ in range(Q)]

res = sum(A)
A_counter = Counter(A)
for i, j in B:
    if i not in A_counter:
        A_counter[i] = 0
    if j not in A_counter:
        A_counter[j] = 0

    res += (j - i) * A_counter[i]
    print(res)
    
    A_counter[j] += A_counter[i]
    A_counter[i] = 0


Measured memory_bytes: 40336
#include<string>
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>
using namespace std;
int n;
int a[100005];
int b[100005];
int c[100005];
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> b[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	sort(a, a + n);
	sort(b, b + n);
	sort(c, c + n);
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		long long l = upper_bound(a, a + n, b[i] - 1) - a;
		long long r = c + n - lower_bound(c, c + n, b[i] + 1);
		ans += l*r;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1408
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC128A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int A = int.Parse(input[0]);
            int P = int.Parse(input[1]);

            int ans = (A * 3 + P )/ 2;

            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const ll MOD = 1000000007;
const double EPS = 1e-9;
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;


int main(void) {

    int a,b,h;
    cin>>a>>b>>h;
    fin((a+b)*h/2);

}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		int ans = K * (int)Math.pow(K-1, N-1);
		System.out.println(ans);
	}
}

Measured memory_bytes: 21204
N=input()
p=input()
N=int(N.split()[0])
p=p.split()
p=[int(p) for p in p]
numlist=sorted(p)

if numlist==p:
        output="YES"
else: 
    dist=0    
    for s,t in zip(numlist,p):
        if s!=t:
                dist=dist+1
        else:
#                dist=dist+0
            pass
    if dist==2:
        output="YES"
    else :
        output="NO"        
print(output)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

int n, u, v;
vector<vector<int> > G;
vector<int> depth, maxdepth, parent;
int dfs(int s, int p, int d) {
  depth[s] = d;
  parent[s] = p;
  int maxd = d;
  for(const int t : G[s]) if(t != p) {
    chmax(maxd, dfs(t, s, d+1));
  }
  return maxdepth[s] = maxd;
}
void answer() {
  cin >> n >> u >> v;
  u--; v--;
  G.resize(n);
  depth.resize(n);
  maxdepth.resize(n);
  parent.resize(n);
  rep(i, n-1) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    G[a].emplace_back(b);
    G[b].emplace_back(a);
  }
  dfs(v, -1, 0);
  int ans = 0;
  int cur = u;
  while(cur != 0) {
    if(depth[u] - depth[cur] < depth[cur]) {
      chmax(ans, maxdepth[cur] - 1);
    } else {
      chmax(ans, maxdepth[u] - 1);
    }
    cur = parent[cur];
  }
  cout << ans << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 13312
#include <bits/stdc++.h>
using namespace std;
long long i,n,w,a[105],b[105],d[105][100005],c[105][100005],ans;
long long dp(int i,int v){
    if(i==n) {
        if(v==0) return 0;
        return 1e17;
    }
    if(d[i][v]!=-1) return d[i][v];
    d[i][v]=1e17;
    if(v>=b[i]) {d[i][v]=min(d[i][v],a[i]+dp(i+1,v-b[i])); c[i][v]=1;}
    if(dp(i+1,v)<d[i][v]) {
        d[i][v]=dp(i+1,v);
        c[i][v]=2;
    }
    return d[i][v];
}
int dp2(int i,int v){
    if(i==n) return 0;
    if(c[i][v]==1) return b[i]+dp2(i+1,v-b[i]);
    return dp2(i+1,v);
}
int main()
{
    memset(d,-1,sizeof d);
    cin>>n>>w;
    for(i=0;i<n;i++) cin>>a[i]>>b[i];
    ans=1e17;
    for(i=n*1000;i>=0;i--){
        ans=dp(0,i);
        if(ans>w) ans=1e17;
        else break;
    }
    ans=dp2(0,i);
    cout<<ans;
    return 0;
}


Measured memory_bytes: 162176
#include <stdio.h>

int main()
{   int h,w,n;
    scanf("%d%d%d",&h,&w,&n);
    int a[n],t[h*w],p=0;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        while(a[i]>0){
            t[p]=i+1;
            a[i]--;
            p++;
        }
    }
    
    
    int i=0,j=0,k=0,set[h][w];
    while(j<h){
        if(i==0||i==-1){
            for(i=0;i<w;i++,k++){
                set[j][i]=t[k];
            }
        }else{
            for(i=w-1;i>=0;i--,k++){
                set[j][i]=t[k];
            }
        }
        j++;
    }
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            printf("%d ",set[i][j]);
        }
        printf("\n");
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define x first
#define y second
#define ndl '\n'
#define mp make_pair
#define up_b upper_bound
#define low_b lower_bound
#define sz(x) (int)x.size()
#define bit __builtin_popcount
#define all(x) x.begin(),x.end()
#define show(x) cout<<(#x)<<" is "<<(x)<<endl

using namespace std;
using namespace __gnu_pbds;

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

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
typedef vector<vector<int>> matrix;

const ll INF=1e18+123;
const ld EPS=1e-9;
const int inf=1e9+123;
const int MOD=1e9+7;
const int N=5e5+123;
const int M=1e6+123;
const int dx[]={0,0,1,-1};
const int dy[]={1,-1,0,0};

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n,x;
    cin>>n;
    while(n--){
        cin>>x;
        if(x&1){
            cout<<"first";
            return 0;
        }
    }
    cout<<"second";

    return 0;
}


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

using namespace std;
const int mod = 100000;
int n,m,ans;
int d[100005];

int main(){
	scanf("%d%d",&n,&m);
	int sum = 0;
	for(int i = 2;i <= n;i++){
		scanf("%d",&d[i]);
		sum += d[i];
		d[i] = sum;
	}
	int nau = 1;
	while(m--){
		int a;
		scanf("%d",&a);
		if(a < 0){
			ans += d[nau] - d[nau+a];
		}else{
			ans += d[nau+a] - d[nau];
		}
		nau += a;
		ans %= mod;
	}

	printf("%d\n",ans%mod);

	return 0;
}


Measured memory_bytes: 1576
#include <iostream>

#include <cmath>
using namespace std;

int main()
{
    char char1;
    cin >> char1;
    if (char1=='a'|| char1=='b' || char1=='c'|| char1=='d'||
        char1=='e' ||char1=='f'||char1=='g' ||char1=='h' ||
        char1=='i' ||char1=='j' ||char1=='k' ||char1=='l' ||
        char1=='m' ||char1=='n' ||char1=='o' ||char1=='p' ||
        char1=='q' ||char1=='r' ||char1=='s' ||char1=='t' ||
        char1=='u' ||char1=='v' ||char1=='w' ||char1=='x' ||char1=='y' ||char1=='z')
    {
        cout <<"a";
    }else {cout <<"A";}
    return 0;
}



Measured memory_bytes: 3600
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let n: usize = read(&mut stdin_lock, &mut buf, b'\n');
    let mut av = vec![0f64; n];
    for i in 0..n - 1 {
        av[i] = read(&mut stdin_lock, &mut buf, b' ');
    }
    av[n - 1] = read(&mut stdin_lock, &mut buf, b'\n');

    let mut sum = 0f64;
    for i in 0..n {
        sum += 1f64 / av[i];
    }
    let ans = 1f64 / sum;
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<long long>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    cin >> s;
    int n = s.size();
    vi ans(n, 0);

    rep(ri, 2) {
        int cnt = 0;
        rep(i, n) { 
            if (s[i] == 'R') cnt++;
            else {
                ans[i] += cnt/2;
                ans[i-1] += (cnt+1)/2;
                cnt = 0;
            }
        }

        reverse(ans.begin(), ans.end());
        reverse(s.begin(), s.end());
        rep(i, n) {
            if (s[i] == 'R') s[i] = 'L';
            else s[i] = 'R';
        }
    }
    rep(i, n) printf("%d%c", ans[i], i==n-1?'\n':' ');
}

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

int n, cur = 1, ans, sz;
int a[1<<20], p[1<<20];

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    int f = n % 2, l = 0, r = n - 1;
    for (int i = n - 1; i >= 0; i--) {
        if (i % 2 == f) p[r--] = i;
        else p[l++] = i;
    }
    for (int i = 0; i < n; i++) cout << a[p[i]] << ' ';
}

Measured memory_bytes: 4992
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    
    int ans=-1;
    for(int c=10;c<2000;++c){
        int ca=c*0.08;
        int cb=c*0.1;
        if(a==ca&&b==cb){
            ans=c;
            break;
        }
    }
    
    cout<<ans<<endl;
    
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	string s;
	cin >> s;
	int a, b;
	a = stoi(s);
	b = a % 100;
	a = (a - b) / 100;
	if ((a >= 1 && a <= 12) && (b >= 1 && b <= 12))
		cout << "AMBIGUOUS" << endl;
	else if (a >= 1 && a <= 12)
		cout << "MMYY" << endl;
	else if (b >= 1 && b <= 12)
		cout << "YYMM" << endl;
	else
		cout << "NA" << endl;


}


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

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
		
	int n,t;
	vector <int> h;

	cin >> n;

	for(int i=0;i<n;i++)
	{
		cin >> t;
		h.push_back(t);
	}

	int res = 0;
	int cnt = 0;
	int Max = h[n-1];
	for(int i=n-2;i>=0;i--)
	{
		if(Max <= h[i])
		{
			Max = max(Max,h[i]);
			cnt++;
		}
		else
		{
			Max = h[i];
			res = max(res,cnt);
			cnt = 0;
		}
	}

	res = max(res,cnt);

	cout << res << '\n';
	return 0;
}

Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main(){
    ll n; cin>>n;
    ll res=1;
    ll mod=1e9+7;
    for(ll i=1; i<=n; i++){
        res*=i;
        res%=mod;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 256
//セグ木基本
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(ll i = 0;i < n;i++)
#define ll long long
#define MOD 1000000007LL
#define llMAX 9223372036854775807LL
#define llMIN -9223372036854775808LL
using vi = vector<ll>;
using vvi = vector<vi>;

ll n;


class SegTree
{
  public:
  ll n2,ln2;//2のべき乗になる数でn以上の数//n2のlog2値
  vector<pair<ll,ll>> data;//●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
  SegTree(){}
  void Init(ll inn){
    ln2=ceil(log2(inn));
    n2=1<<ln2;
    data.resize(n2*2);
    for(ll i=0;i<n2*2;i++)
      data[i]=Initval(i);//●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
  }
  //配列内初期化●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
  pair<ll,ll> Initval(ll i){
    return make_pair(llMIN,i);
  }
  //min関数的な
  //●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
  pair<ll,ll> SGTfunc(pair<ll,ll> d0,pair<ll,ll> d1){
    if (d0.first>d1.first){
      return d0;
    }else{
      return d1;
    }
    
  }
  //データをセットして内部更新 O(logn)
  void Updata(ll posi,pair<ll,ll> d)
  {
    ll myi=posi+n2;
    data[myi]=d;//葉
    for(ll i=0;i<ln2;i++){//中間要素
      myi/=2;
      data[myi]=SGTfunc(data[myi*2],data[myi*2+1]);
    }
  }
  void Delete(ll posi)//1要素削除して初期化
  {
    Updata(posi,Initval(posi));
  }
  //lを含むrを含まないところまでの区間
  pair<ll,ll> GetMin(ll l,ll r)
  {
    auto ret=data[l];
    ll l_=l;
    ll r_=r;
    for(ll i=0;(l_+r_)>0;i++){
      ll offset=1<<(ln2-i);
      if (r_%2==1){
          if (r_-1>=l_){
            ret=SGTfunc(ret,data[offset+r_-1]);
            r_--;
          }
      }
      if (l_%2==1){
          if (l_<r_){
            ret=SGTfunc(ret,data[offset+l_]);
            l_++;
          }
      }
      r_>>=1;
      l_>>=1;
    }
    return ret;
  }
  pair<ll,ll> GetAll()//0～最後の要素まで
  {
    return GetMin(0,n2);
  }
};




int main(){
  ll ans=0;
  cin >> n;
  vi a(n);
  REP(i,n) cin>>a[i];
  sort(a.begin(), a.end(),greater<ll>());
  
  vector<SegTree> sg(1);
  SegTree segtree=sg[0];
  segtree.Init(n);//nをいれる

  if (n==2){
    cout<<a[0]<<endl;
    return 0;
  }


  ll fd=a[0]+a[1]*1000000001LL;
  segtree.Updata(0,make_pair(fd,0));
  segtree.Updata(1,make_pair(fd,1));
  ans+=a[0];
  for(ll i=2;i<n;i++){
    auto nowmax=segtree.GetAll();
    ll scoremin=nowmax.first/1000000001LL;
    ll scoremax=nowmax.first%1000000001LL;
    ans+=scoremin;
    
    //最大値をつぶす
    segtree.Updata(nowmax.second,make_pair(scoremin+1000000001LL*a[i],nowmax.second));
    //追加
    segtree.Updata(i,make_pair(scoremax+1000000001LL*a[i],i));
  }
  

/*
  cout<<segtree.GetMin(0,6)<<endl;
  cout<<segtree.GetMin(2,4)<<endl;
  cout<<segtree.GetMin(3,7)<<endl;
  cout<<segtree.GetMin(0,3)<<endl;
  cout<<segtree.GetMin(1,5)<<endl;
  cout<<segtree.GetAll()<<endl;
*/


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






Measured memory_bytes: 13328
#include <stdio.h>

int main(){

  int N,i,j,a,flag,count,minj,A[100];
  count=0;
  flag=0;
  
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<=N-1;i++){
    minj=i;
    for(j=i;j<=N-1;j++){
      if(A[j]<A[minj]){
	minj=j;
	flag=1;
      }
    }
    if(flag==1){
      count++;
      flag=0;
    }
    a=A[i];
    A[i]=A[minj];
    A[minj]=a; 
  }
  for(i=0;i<N-1;i++){
    printf("%d ",A[i]);
  }  
  printf("%d\n",A[N-1]);
  printf("%d\n",count);
  return 0;
}

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

using namespace std;

struct Dice {
    int s[6];

    int &top() { return s[0]; }

    int &south() { return s[1]; }

    int &east() { return s[2]; }

    int &west() { return s[3]; }

    int &north() { return s[4]; }

    int &bottom() { return s[5]; }

    void roll(char c) {
        string b("EWNSRL");
        int v[6][4] = {{0, 3, 5, 2},
                       {0, 2, 5, 3},
                       {0, 1, 5, 4},
                       {0, 4, 5, 1},
                       {1, 2, 4, 3},
                       {1, 3, 4, 2}};
        for (int k = 0; k < 6; ++k) {
            if (b[k] != c) continue;
            int t = s[v[k][0]];
            s[v[k][0]] = s[v[k][1]];
            s[v[k][1]] = s[v[k][2]];
            s[v[k][2]] = s[v[k][3]];
            s[v[k][3]] = t;
        }
    }

    bool totally_eq(const Dice &d) const{
        for (int i = 0; i < 6; ++i) if (s[i] != d.s[i]) return 0;
        return 1;
    }

    bool operator==(const Dice &d) const{
        vector<Dice> dices;
        bool ans = false;
        for (int i = 0; i < 6; ++i) {
            Dice t(d);
            if (i == 1) t.roll('N');
            if (i == 2) t.roll('S');
            if (i == 3) t.roll('S'), t.roll('S');
            if (i == 4) t.roll('R');
            if (i == 5) t.roll('L');
            for (int k = 0; k < 4; ++k) {
                dices.push_back(t);
                t.roll('E');
            }
        }
        for (auto e : dices) ans|=totally_eq(e);
        return ans;
    }
};

int main() {
    Dice d1, d2;

    for (int i = 0; i < 6; ++i) cin >> d1.s[i];
    for (int i = 0; i < 6; ++i) cin >> d2.s[i];

    if (d1 == d2) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


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

#define faster  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define sq(x)   (x)*(x)
#define PI      acos(-1.0)
#define all(x) x.begin(),x.end()
#define nl      '\n'

typedef long long int ll;
typedef unsigned long long int  llu;

int main()
{
    int n;
    cin>>n;
    cout<<sq(n)<<nl;
    return 0;
}



Measured memory_bytes: 3596
import std.stdio,std.algorithm,std.range,std.conv,std.string;

void main()
{
    foreach(i;0..readln.chomp.to!int)
    {
        auto input=readln.split;
        real x1=input[0].to!real,y1=input[1].to!real,
             x2=input[2].to!real,y2=input[3].to!real,
             x3=input[4].to!real,y3=input[5].to!real,
             x4=input[6].to!real,y4=input[7].to!real;
        real a=x1-x2,b=y1-y2,c=x4-x3,d=y4-y3;
        writeln(a * d - b * c == 0 ? "YES" : "NO");
    }
}

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

template<typename T> struct cusum {
    int n;
    vector<T> s;
    cusum(vector<T> &a) {
        n = a.size();
        s.resize(n + 1);
        s[0] = 0;
        for (int i = 1; i <= n; i++) {
            s[i] = s[i - 1] + a[i - 1];
        }
    }
    T sum(int a, int b) { // 半開区間[a,b)の和(0-indexed)
        return s[b] - s[a];
    }
};

int main() {
    int n;
    cin >> n;
    char s[n];
    rep(i, n) {
        cin >> s[i];
    }
    vector<int> r(n+1), w(n+1);
    rep(i, n+1) {
        if (i == 0) {
            r[i] = 0;
            w[i] = 0;
        } else {
            r[i] = r[i-1];
            w[i] = w[i-1];
            if (s[i-1] == 'R') r[i]++;
            else if (s[i-1] == 'W') w[i]++;
        }
    }
    int ans = 2e6;
    rep(i, n+1) {
        int x = w[i] - w[0];
        int y = r[n] - r[i];
        ans = min(ans, max(x, y));
    }
    cout << ans << endl;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    vector<int> vec(n);
    for(int i=0;i<n;++i)
    {
        cin>>vec[i];
    }
    
    int count=0;
    int j=1;
    for(int i=0;i<n;++i)
    {
        if(vec[i]==j)
        {
            count++;
            j++;
        }
    }
    
    if(count==0)
    cout<<-1<<"\n";
    else
    cout<<n-count<<"\n";

}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>

int main() {
  int N, K;
  std::cin >> N;
  std::cin >> K;
  std::vector<int> x(N);
  for (int i = 0; i < N; ++i) {
    std::cin >> x[i];
  }

  int d = 0;
  for (int i = 0; i < N; ++i) {
    int da = 2 * x[i];
    int db = 2 * abs(K - x[i]);
    if ( da < db ) d += da;
    else d += db;
  }
  std::cout << d << std::endl;

  return 0;
}


Measured memory_bytes: 256
import queue
import sys
sys.setrecursionlimit(10**7)
n = int(input())

abc = [[] for i in range(n+1)]

for i in range(n-1):
    a,b,c = map(int,input().split())
    abc[a].append([b,c])
    abc[b].append([a,c])

Q,k = map(int,input().split())
xy = [[int(i) for i in input().split()] for j in range(Q)]

q = queue.Queue()

q.put(k)

path = [-1]*(n+1)
path[k] = 0

def dfs(p):
    for i in range(len(abc[p])):
        num = abc[p][i][0]
        if path[num] != -1:
            continue
        else:
            path[num] = path[p] + abc[p][i][1]
            dfs(num)

dfs(k)

for i in range(Q):
    print(path[xy[i][0]]+path[xy[i][1]])

Measured memory_bytes: 156176
#include <stdio.h>
int main()
{
    int n, sum;
    while (1){
        int cnt = 0;
        scanf(" %d %d", &n, &sum);
        if (n == 0 && sum == 0) break;
        for (int i = 1; i <= n - 2; i++){
            for (int j = i + 1; j <= n - 1; j++){
                for (int k = j + 1; k <= n; k++){;
                    if (i + j + k == sum){
                        cnt++;
                    }
                }
            }
        }
        
        printf("%d\n", cnt);
    }
    return 0;
}


Measured memory_bytes: 2100
#include<iostream>
#include<complex>
#include<cmath>
#include<map>
#define fs first
#define sc second
#define EPS (1e-10)
using namespace std;


typedef complex<double> P;
typedef pair<P,double> C;

int cpr(C a,C b){
  double d = abs(a.fs-b.fs);
  if(a.sc+b.sc + EPS < d)return -1;      //no intersection (outside)
  if(d + EPS < a.sc-b.sc)return 1;       //no intersection (inside,B in A)
  if(d + EPS < b.sc-a.sc)return 2;       //no intersection (inside,A in B)
  if(abs(a.sc+b.sc - d) < EPS)return -3; //one cross point (outside)
  if(abs(b.sc+d - a.sc) < EPS)return 3;  //one cross point (inside,B in A)
  if(abs(a.sc+d - b.sc) < EPS)return 4;  //one cross point (inside,A in B)
  return 0;                              //two cross point
}


int main(){
  double ax,ay,ar,bx,by,br;

  int n;
  cin >> n;
  for(int i=0;i<n;i++){
    cin>> ax >> ay >> ar >> bx >> by >> br;
    C a = C(P(ax,ay),ar), b = C(P(bx,by),br);
    int v = cpr(a,b);
    if(v==-1)cout <<  0 << endl;
    else if(v==1)cout << 2 << endl;
    else if(v==2)cout << -2 << endl;
    else cout << 1 << endl;
  }
}

Measured memory_bytes: 0
n,k=int(input()),1
while k*2<=n:k*=2
p=print
if n==k:p("No");exit()
p("Yes",v:=n+1,3)
i=2
while i<n:p(1,i,i,i+1,1,v+i,v+i,n+i);i+=2
if~n&1:p(n,v+k,n+n,n^k)

Measured memory_bytes: 9288
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <iostream>
#include <math.h>
using namespace std;
int main ()
{
	int n,k=1;
	bool b=false;
	scanf("%i",&n);
	int a[n+1];
	for(int i=2;i<=55000;i++)
	{
		for(int j=2;j<i;j++)
		{
			if(i%j==0)
			{
				b=true;
				break;
			}
		}
		if(b==false)
		{
			if(i%5==2)
			{
				a[k]=i;
				k++;
			}
		}
		b=false;
		if(k>n)
		{
			break;
		}
	}
	for(int i=1;i<=n;i++)
	{
		printf("%i ",a[i]);
	}
	return 0;
}


Measured memory_bytes: 256
<?php
list($a, $b, $c) = ints();
if ($b > $a) echo $c > $a && $c < $b ? 'Yes' : 'No';
else echo $c < $a && $c > $b ? 'Yes' : 'No';
function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}


Measured memory_bytes: 16092
s = input()
l, r=0, len(s)-1
ret = 0
while l<r:
  L, R=s[l], s[r]
  if L==R:
    l+=1
    r-=1
  elif L=='x':
    l+=1
    ret+=1
  elif R=='x':
    r-=1
    ret+=1
  else:
    ret=-1
    break
print(ret)

Measured memory_bytes: 3316
#include<iostream>
#define N 32768
long a[N],b[N],c[N]={},n,k,i=N;int main(){for(std::cin>>n>>k;--i;a[i]=i<n?i:n)b[i]=n/i;while(--k){for(;++i<N;)c[i]=c[i-1]+b[i];for(*a=c[n/--i];--i;a[i]=c[i])*a=b[i]=(*a+a[i]*(n/i-n/(i+1)))%0x3B9ACA07;}std::cout<<*a;}


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

using namespace std;

int main(void)
{
    int a[5], k;
    for(int i = 0; i < 5; i++){
        cin >> a[i];
    }
    cin >> k;
    for(int i = 0; i < 5; i++){
        for(int j = 0; j < 5; j++){
            if(abs(a[i] - a[j]) > k){
                cout << ":(" << endl;
                return 0;
            }
        }
    }
    cout << "Yay!" << endl;

}

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

# A.sort()
ans=0 ; kojin=0
# new=[]
from collections import Counter
C=Counter(A)
for i,j in C.items():
    if j>=2:
        if j%2==1:kojin+=1
        else: ans+=1
    else:
        kojin+=1
#print(ans,kojin)
#print(sorted(A))
if ans%2==1:
    ans-=1
print(ans+kojin)

        

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

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

  int n;
  cin >> n;
  unordered_set<char> exist;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    exist.insert(c);
  }
  string ans = (exist.size() == 3) ? "Three" : "Four";
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 384
import numpy as np

N = int(input())
A = list(map(int, input().split()))

colors = np.array([0 for _ in range(9)])
for a in A:
    if 1 <= a <= 399: colors[0] += 1
    elif 400 <= a <= 799: colors[1] += 1
    elif 800 <= a <= 1199: colors[2] += 1
    elif 1200 <= a <= 1599: colors[3] += 1
    elif 1600 <= a <= 1999: colors[4] += 1
    elif 2000 <= a <= 2399: colors[5] += 1
    elif 2400 <= a <= 2799: colors[6] += 1
    elif 2800 <= a <= 3199: colors[7] += 1
    else: colors[8] += 1

if colors[8] == 0:
    ans = len(colors[colors > 0])
    print(ans, ans)
else:
    legend = colors[8]
    colors = colors[:8]
    v = len(colors[colors > 0])
    print(max(1, v), v + legend)


Measured memory_bytes: 12496
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <boost/range/algorithm.hpp>
#include <boost/integer/common_factor_rt.hpp>

using namespace std;

struct Restaurant {
    int index;
    string S;
    int P;

    Restaurant(int i, string s, int p) {
        index = i;
        S = s;
        P = p;
    }

    bool operator<(const Restaurant &another) const {
        if (S == another.S) {
            return P > another.P;
        } else {
            return S < another.S;
        }
    };
};

int N;

int main() {

    while (cin >> N) {
        vector<Restaurant> info;
        for (int i = 1; i <= N; i++) {
            string s;
            int p;
            cin >> s >> p;
            info.push_back(Restaurant(i, s, p));
        }
        boost::sort(info);
        for (int i = 0; i < N; i++) {
            cout << info.at(i).index << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define ll long long
#define mod 1000000007
#define M 1000000
using namespace std;

int isprime(ll n){
    if(n==1) return 0;
    if(n==2 || n==3) return 1;
    for(int i=2;i*i<=n;i++){
        if(n%i==0) return 0;
    }
    return 1;
}

void answer(){
    ll n,ans=0,m,p=1,an=1;
    cin>>n>>m;
    if(n*500>=m) cout<<"Yes";
    else cout<<"No";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q;
    //cin>>q; while(q--)
        answer();
    return 0;
}

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

int N;
int A[2][102];

int cc[2][102];
int dp(int r, int c) {
    int &ret = cc[r][c];
    if(ret != -1) return ret;
    if(r == 1 && c == N - 1) return ret = 0;

    ret = 0;
    if(r == 0) ret = max(ret, A[r + 1][c] + dp(r + 1, c));
    if(c != N - 1) ret = max(ret, A[r][c + 1] + dp(r, c + 1));
    return ret;
}

int main() {
    scanf("%d", &N);

    for(int i = 0; i < 2; i++) {
        for(int j = 0; j < N; j++) {
            scanf("%d", &A[i][j]);
        }
    }

    memset(cc, -1, sizeof(cc));
    printf("%d", A[0][0] + dp(0, 0));
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#define llint long long
#define inf 1e18

using namespace std;
typedef pair<llint, llint> P;

llint n;
vector<P> vec;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n;
	llint x, len;
	for(int i = 1; i <= n; i++){
		cin >> x >> len;
		vec.push_back(P(x+len, x-len));
	}
	sort(vec.begin(), vec.end());
	
	llint ans = 0, r = -inf;
	for(int i = 0; i < vec.size(); i++){
		if(vec[i].second >= r) ans++, r = vec[i].first;
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 2420
#include<iostream>
#include<vector>
#include<string>
#include<cstdlib>
#include<sstream>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#define INF 2147483647
#define lli long long int
#define MOD 1000000007
#define pb push_back
#define max_prime 1299709
using namespace std;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;

bool isPrime(int num){
	if (num == 1) return false;	
	if (num == 2) return true;	
	for (int i = 2; i <= sqrt(num)+1 ; i++){
		if (num % i == 0){
			return false;
		}
	}
	return true;
}

void eratosthenes(vi &v){
	v[0] = 1; v[1] = 1;
	for (int i = 2; i <= max_prime; i++){
		if (v[i] == 0){
			for (int j = 2; j <= max_prime/i; j++){
				v[i*j] = 1;
			}
		}
	}
}
int main() {
	vi primev(max_prime,0);
	eratosthenes(primev);
	while(1){
		int n; cin >> n;
		if (n == 0) break;

		if (isPrime(n)){
			cout << 0 << endl;
		}else{
			int lp;
			int sp;
			for (int i = 0; i < primev.size(); i++){
				if (primev[i] == 0 and n > i){
					sp = i;
				}else if(primev[i] == 0 and n < i){
					lp = i;
					break;
				}
				
			}
			cout << lp - sp << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 7644
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
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; }
const ll INF = 1e9;
const ll MOD = 1e9 + 7;


int main(){
    ll n, m;
    cin >> n >> m;
    vector<ll> v(n);
    rep(i, n){
        ll x; cin >> x;
        v[i] = x/2;
    }

    auto lg2 = [&](int x){
        int cnt = 0;
        while(x > 0 && x%2 == 0){
            x /= 2;
            cnt++;
        }
        return cnt;
    };
    int b = lg2(v[0]);
    rep(i, n){
        if(b != lg2(v[i])){
            cout << 0 << endl;
            return 0;
        }
    }

    ll lcm = 1;
    rep(i, n) lcm = v[i] / __gcd(v[i], lcm) * lcm;
    m /= lcm;
    cout << (m+1)/2 << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  ll n;
  cin >> n;
  vector<ll>a(n);
  rep(i,n) cin >> a[i];
  
  ll sum1=0,res1=0;
  rep(i,n){
    sum1+=a[i];
    if(i%2==0){
      if(sum1>=0){
        res1+=abs(sum1)+1;
        sum1=-1;
      }
    }
    else{
      if(sum1<=0){
        res1+=abs(sum1)+1;
        sum1=1;
      }
    }
  }
  ll sum2=0,res2=0;
  rep(i,n){
    sum2+=a[i];
    if(i%2==0){
      if(sum2<=0){
        res2+=abs(sum2)+1;
        sum2=1;
      }
    }
    else{
      if(sum2>=0){
        res2+=abs(sum2)+1;
        sum2=-1;
      }
    }
  }
  cout << min(res1,res2 ) << endl;
  return 0;
}


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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { -1,0, 1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
// #define mp make_pair
//#define endl '\n'



int main () {
  int n, k;
  cin >> n >> k;
  if (k > (n - 1) * (n - 2) / 2) {
    cout << -1 << endl;
    return 0;
  }
  vector<pii> e;
  rep (u, n) {
    for (int v = u + 1; v < n; v++) {
      e.push_back(pii(u, v));
    }
  }

  int use = n * (n - 1) / 2 - k;
  cout << use << endl;
  rep (i, use) {
    cout << e[i].first + 1 << " " << e[i].second + 1 << endl;
  }
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int n=gi();
        

	    //System.out.print(nr*2*Math.PI);
	    if (n%10==3) {
	    	System.out.print("bon");
	    }else if(n%10==0 || n%10==1 || n%10==6 || n%10==8){
	    	System.out.print("pon");
	    } else {
	    	System.out.print("hon");
	    }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

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


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

  cout << n * (n - 1) / 2 << endl;
  return 0;
}


Measured memory_bytes: 3616
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solve():
    r = II()
    print(2 * 3.141592 * r)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 9188