akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

class Main {
    int N;
    vector<ll> x, y;
    void input() {
        cin >> N;
        x.resize(N);
        y.resize(N);
        REP(i, N) { cin >> x[i] >> y[i]; }
    }
    void output() {
        vector<ll> z(N), w(N);
        REP(i, N) {
            z[i] = x[i] + y[i];
            w[i] = x[i] - y[i];
        }
        ll res =
            *max_element(z.begin(), z.end()) - *min_element(z.begin(), z.end());
        res = max(res, *max_element(w.begin(), w.end()) -
                           *min_element(w.begin(), w.end()));
        cout << res << endl;
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    return 0;
}


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

using namespace std;

typedef long long ll;

const ll MOD = 1000000007;

int main()
{
    ios_base::sync_with_stdio(0);
    int n;
    cin >> n;
    vector<int> a;
    for (int i = 0; i < n; ++i)
    {
        int c;
        cin >> c;
        --c;
        if (a.size() == 0)
            a.push_back(c);
        else
            if (a.back() != c)
                a.push_back(c);
    }
    n = a.size();
    vector<ll> dp(n);
    vector<ll> przed(200000, 0);
    for (int i = 0; i < n; ++i)
    {
        if (przed[a[i]] == 0)
        {
            if (i != 0)
                dp[i] = dp[i - 1];
            else
                dp[i] = 1;
        }
        else
            dp[i] = (przed[a[i]] + dp[i - 1]) % MOD;
        if (i != 0)
            przed[a[i]] = (przed[a[i]] + dp[i - 1]) % MOD;
        else
            przed[a[i]] = 1;
    }
    cout << dp[n - 1];
    return 0;
}


Measured memory_bytes: 4340
#include <stdio.h>

int main(void) {
    int a,b,c,max,min,medium;
    scanf("%d %d %d",&a,&b,&c);
    if (a>=c){
        if (a>=b){
            max = a;
            if (b>=c){
                min = c;
                medium = b;
            }
            else {
                min = b;
                medium = c;
            }
        }
        else {
            max = b;
            min = c;
            medium = a;
        }
    }
    else {
        if (c>=b){
            max = c;
            if (b>=a){
                min = a;
                medium = b;
            }
            else{
                min = b;
                medium = a;
            }
        }
        else {
            max = b;
            min = a;
            medium = c;
        }
    }
    printf("%d %d %d\n",min,medium,max);
    return 0;
}

Measured memory_bytes: 596
c = [list(map(int, input().split())) for _ in range(3)]
for i in range(3):
  for j in range(i+1, 3):
    if (c[i][0]-c[j][0])==(c[i][1]-c[j][1])==(c[i][2]-c[j][2]):
      pass
    else:
      print("No")
      exit()
print("Yes")

Measured memory_bytes: 3060
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)


int n, A[50];

int solve(int i, int m){
	if (m == 0){
		return 1;
	}
	if (i >= n){
		return 0;
	}
	int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
	return res;
}

int main(){
	int q, M;
	scanf("%d", &n);
	REP(i, n){
		scanf("%d", &A[i]);
	}
	scanf("%d", &q);
	REP(i, q){
		scanf("%d", &M);
		if (solve(0, M)){
			printf("yes\n");
		}
		else{
			printf("no\n");
		}
	}

	return 0;
}


Measured memory_bytes: 2688
def main():
    n = int(input())
    M = [[0] * n for _ in range(n)]

    for i in range(n):
        line = input()
        inputs = [int(x) for x in line.split(' ')]
        u = inputs.pop(0)
        u -= 1                  # 0 オリジンへ変換
        _ = inputs.pop(0)
        for v in inputs:
            v -= 1              # 0 オリジンへ変換
            M[u][v] = 1

    for row in M:
        print(' '.join([str(x) for x in row]))


if __name__ == '__main__':
    main()



Measured memory_bytes: 5672
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define dd double
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep1(i,b) for(ll i=1;i<=b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define vi vector<ll>
#define all(v) v.begin(), v.end()

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

	string sq, num1, num2;
	cin >> num1 >> num2;
	sq = num1 + num2;

	long double que = strtod(sq.c_str(), NULL);
	long double srt = sqrt(que);
	if(sqrt(que) - floor(srt) == 0)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	
	//cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



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

#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);

int main() {
    string s, t;
    cin >> s >> t;
    int n = s.size(), m = t.size(), i, f = 1;
    for (i = 0; i < n; i++) {
        if (s[i] != t[i]) {
            f = 0;
            break;
        }
    }
    if (n == m - 1 && i == n);
    else f = 0;

    cout << (f ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 3588
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new
					InputStreamReader(System.in));
		}

		String next()
		{
			while (st == null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch (IOException  e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}
	public static boolean yikes(int a, int b, int c, int d) {
		if (a<0 || b<0 || c<0 || d<0) {
			return true; 
		}
		return false; 
	}
	public static boolean solve(int K) {
		if (K<0) {
			return true; 
		}
		else if (vis[K]) {
			return dp[K]; 
		}
		else {
			for (int i=0; i<a.length; i++) {
				if (!solve(K-a[i])) {
					vis[K] = true; 
					return dp[K] = true; 
				}
			}
			vis[K] = true; 
			return dp[K] = false; 
		}
	}
	public static int[] a; 
	public static boolean[] dp, vis; 
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int N = sc.nextInt(), K = sc.nextInt();
		a = new int[N]; 
		for (int i=0; i<N; i++) {
			a[i] = sc.nextInt();
		}
		dp = new boolean[K+10]; 
		vis = new boolean[K+10]; 
		if (solve(K)) {
			System.out.println("First");
		}
		else {
			System.out.println("Second");
		}
	}

}


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

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, avg = 0;
    cin >> n;
    vector<int> x(n);
    for (int &y : x)
        cin >> y, avg += y;
    avg /= n;
    ll ans2 = 1e9 + 5;
    for (int i : {0, 1})
    {
        ll ans = 0;
        for (int y : x)
        {
            ans += (y - avg - i) * (y - avg - i);
        }
        ans2 = min(ans, ans2);
    }
    cout << ans2 << "\n";
    return 0;
}

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

using namespace std;

int main () {
    int n; cin >> n;
    bool flag = false;

    for (int i = 1; i < 10; i++) {
        if (n % i == 0) {
            int a = n / i;
            if (a < 10) {
                flag = true;
                break;
            }
        }
    }
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

using namespace std;

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

    int Apos=0, Zpos=0;
    int res=0;
           
    Apos = s.find('A');
    Zpos = s.rfind('Z');

    cout << Zpos-Apos+1 << endl;


    return 0;

}

Measured memory_bytes: 640
#include<stdio.h>

int main(){
		int n,i,ans,k=0;
		char s[101],t[101];
		scanf("%d",&n);
		ans=n*2;
		scanf("%s",s);
		scanf("%s",t);
		for(i=0;i<n;i++){
				int j;
				for(j=n-i-1;j<n;j++){
						if(s[j]!=t[j-n+i+1])break;
				}
				if(j==n)k=i+1;
		}
		printf("%d\n",ans-k);
		return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>

using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)

int main() {
	int A, B, C, X; cin >> A >> B >> C >> X;
	int sum = 0;
	int count = 0;
	rep(i, 0, A + 1) {
		rep(j, 0, B + 1) {
			rep(k, 0, C + 1) {
				if ((i * 500 + j * 100 + k * 50) == X)count++;
			}
		}
	}
	cout << count << endl;

	return 0;
}

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

#define pb     push_back
#define mp     make_pair
#define all(v) v.begin() , v.end()
#define allr(v) v.rbegin(), v.rend()
const ll INF =  0x3f3f3f3f;
const int MOD = 1e9+7;
const int MAX = 2e5+5;

int n, d;
vector<int> v(MAX);

int main(int argc, char const *argv[])
{
  // ios_base::sync_with_stdio(false);
  
  // #ifndef ONLINE_JUDGE
  // freopen("in","r",stdin);
  // freopen("out","w",stdout);
  // #endif

  scanf("%d" , &n);

  for(int i = 1 ; i <= n ; i++){
  	scanf("%d" , &d);
  	v[i] = d;
  }

  int indx;

  if(n%2 == 0){
  	indx = n;
  	while(indx > 1){
  		printf("%d " , v[indx]);
  		indx -= 2;
  	}
  	indx = 1;
  	while(indx < n){
  		printf("%d " , v[indx]);
  		indx += 2;
  	}
  }
  else{
  	indx = n;
  	while(indx >= 1){
  		printf("%d " , v[indx]);
  		indx -= 2;
  	}
  	indx = 2;
  	while(indx < n){
  		printf("%d " , v[indx]);
  		indx += 2;
  	}
  }

  return 0;
}  

Measured memory_bytes: 2944
#include<bits/stdc++.h>
#define reg register
typedef long long ll;
using namespace std;
namespace IO{
    char buf[1<<15],*S,*T;
    inline char gc(){
        if(S==T){
            T=(S=buf)+fread(buf,1,1<<15,stdin);
            if(S==T)return EOF;
        }
		return *S++;
    }
    inline int read(){
        reg int x;reg char c;
        for(;(c=gc())<'0'||c>'9';);
        for(x=c^'0';(c=gc())>='0'&&c<='9';x=x*10+c-'0');
        return x;
    }
    const int _outlim=1<<20;
    char outbuf[_outlim+5];int cnt;
    inline void pc(char c){
        outbuf[cnt++]=c;
        if(cnt==_outlim)
            fwrite(outbuf,1,cnt,stdout),cnt=0;
    }
    inline void write(int x){
        if(x>9)write(x/10);pc(x%10^'0');
    }
    inline void end(){
        if(cnt)fwrite(outbuf,1,cnt,stdout);
		fclose(stdin);fclose(stdout);
    }
}
using IO::read;
using IO::write;
using IO::pc;
const int MN=2<<18|5;
const int MM=65;
int n,m,V[MN],W[MN],v[25],w[25];
int f1[MM],f2[MM],f3[MM],g1[MM],g2[MM],g3[MM],id1[MM],id2[MM],id3[MM];
int main(){
	n=read();
	for(reg int i=1;i<=n;i++)V[i]=read(),W[i]=read();
	m=read();
	while(m--){
		static int x,y,tot,lmid,rmid,cnt1,cnt2,cnt3,i,j,k,U,res,cost,Ans;
		x=read();y=read();tot=0;
		while(x){
			if(W[x]<=y)v[++tot]=V[x],w[tot]=W[x];
			x/=2;
		}
		lmid=tot/3,rmid=tot*2/3,cnt1=cnt2=cnt3=0;
		for(i=0,U=1<<lmid;i<U;i++){
			res=0,cost=0;
			for(j=1;cost<=y&&j<=lmid;j++)
				if((i>>(j-1))&1)res+=v[j],cost+=w[j];
			if(cost<=y)f1[++cnt1]=res,g1[cnt1]=cost;
		}
		for(i=0,U=1<<(rmid-lmid);i<U;i++){
			res=0,cost=0;
			for(j=lmid+1;cost<=y&&j<=rmid;j++)
				if((i>>(j-lmid-1))&1)res+=v[j],cost+=w[j];
			if(cost<=y)f2[++cnt2]=res,g2[cnt2]=cost;
		}
		for(i=0,U=1<<(tot-rmid);i<U;i++){
			res=0,cost=0;
			for(j=rmid+1;cost<=y&&j<=tot;j++)
				if((i>>(j-rmid-1))&1)res+=v[j],cost+=w[j];
			if(cost<=y)f3[++cnt3]=res,g3[cnt3]=cost;
		}
		for(i=1;i<=cnt1;i++)id1[i]=i;
		for(i=1;i<=cnt2;i++)id2[i]=i;
		for(i=1;i<=cnt3;i++)id3[i]=i;
		sort(id1+1,id1+1+cnt1,[](int a,int b){
			return g1[a]<g1[b];
		});
		sort(id2+1,id2+1+cnt2,[](int a,int b){
			return g2[a]<g2[b];
		});
		sort(id3+1,id3+1+cnt3,[](int a,int b){
			return g3[a]<g3[b];
		});
		Ans=0;
		for(i=1;i<=cnt3;i++)
			f3[id3[i]]=max(f3[id3[i]],f3[id3[i-1]]);
		for(i=1;i<=cnt1;i++)
			for(j=1,k=cnt3;j<=cnt2;j++){
				while(k&&g1[id1[i]]+g2[id2[j]]+g3[id3[k]]>y)k--;
				if(!k)break;
				Ans=max(Ans,f1[id1[i]]+f2[id2[j]]+f3[id3[k]]);
			}
		write(Ans);pc('\n');
	}
	IO::end();
	return 0;
}

Measured memory_bytes: 6252
<?php
$N = trim(fgets(STDIN));
$A = explode(" ", trim(fgets(STDIN)));

$up = $A[0] < $A[1];
$eq = $A[0] == $A[1];

$count = 1;

for ($i = 1; $i < $N; $i++) {
    if($eq){
        if (isset($A[$i + 1])) {
            $up = $A[$i] < $A[$i + 1];
            $eq = $A[$i] == $A[$i + 1];
        }
    }else {
        if ($up && $A[$i - 1] > $A[$i]) {
            $count++;

            if (isset($A[$i + 1])) {
                $up = $A[$i] < $A[$i + 1];
                $eq = $A[$i] == $A[$i + 1];
            }
        }

        if (!$up && $A[$i - 1] < $A[$i]) {
            $count++;

            if (isset($A[$i + 1])) {
                $up = $A[$i] < $A[$i + 1];
                $eq = $A[$i] == $A[$i + 1];
            }
        }
    }
}

echo $count;

Measured memory_bytes: 12792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll n,k,a[500];
	cin>>n>>k;
	ll sum1=0;
	for(ll i=0;i<n;i++){
		cin>>a[i];
		sum1+=a[i];
	}
//	cout <<sum1<<endl;
	vector<ll>sq;
	for(ll i=1;i<=sqrt(sum1);i++){
		if(sum1%i==0){
			sq.push_back(i);
			sq.push_back(sum1/i);
		}
	}
	sort(sq.begin(),sq.end());
	reverse(sq.begin(),sq.end());
	for(ll i=0;i<sq.size();i++){
		ll now=sq[i];
//		cout <<now<<endl;
		vector<ll>b;
		ll sum2=0;
		for(ll j=0;j<n;j++){
			b.push_back(abs(now-a[j]%now));
			sum2+=b[j];
			//cout << b[j]<<" ";
		}
		sort(b.begin(),b.end());
		reverse(b.begin(),b.end());
//		cout <<endl;
		ll sum3=0;
		for(ll j=0;j<n;j++){
			sum2-=b[j];
			sum3+=abs(now-b[j]);
			if(now==7){
		//		cout << sum2<<" "<<sum3<<endl;
			}
			if(max(sum3,sum2)<=k){
				cout <<now;
				return 0;
			}
		}
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (a : b : c : _) <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  putStrLn $ if a + b < c && 4 * a * b < (c - a - b) ^ 2 then "Yes" else "No"

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n


Measured memory_bytes: 508
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] matrix = new int[n][3];
        int[][] used = new int[3][101];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < 3; j++) {
                matrix[i][j] = sc.nextInt();
                used[j][matrix[i][j]]++;
            }
        }
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int point = 0;
            for (int j = 0; j < 3; j++) {
                if (used[j][matrix[i][j]] == 1) {
                    point += matrix[i][j];
                }
            }
            sb.append(point).append("\n");
        }
        System.out.print(sb);
    }
}



Measured memory_bytes: 27956
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
using namespace std;
using ll = unsigned long long;
using p = pair<int, int>;

int main()
{
    double r;
    cin >> r;

    cout << 2.0 * M_PI * r << endl;

    return 0;
}


Measured memory_bytes: 3796
#include<iostream>
#include<map>
#include<utility>
#include<string>
#include<vector>
#include<cstdio>
using namespace std;

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

    for(int i=0;i<k;i++){
        if(s[i]!='1'){
            cout<<s[i]<<endl;
            return 0;
        }
    }
    cout<<'1'<<endl;
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 1;
		int ans = 0;
		while(i <= n) {
			String num = Integer.toString(i);
			if(num.length() % 2 == 1) {
				ans++;
			}
			i++;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 26324
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const double PI = acos(-1);
const double EPS = 1e-8;

using pi = pair<int,int>;
using P = pair<double,pi>;

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

    vector<P> v;
    rep(i,n){
        int x,y;
        scanf(" %d %d", &x, &y);
        double t = atan2(y,x);
        if(t<0) t = 2*PI+t;

        v.pb({t,{x,y}});
        v.pb({t+2*PI,{x,y}});
    }
    sort(all(v));

    int V = v.size();
    ll ans = 0;

    int j = 0;
    ll x = 0, y = 0;
    rep(i,V){
        while(j<V && v[j].fi - v[i].fi < PI+EPS){
            x += v[j].se.fi;
            y += v[j].se.se;

            ans = max(ans, x*x+y*y);
            ++j;
        }

        x -= v[i].se.fi;
        y -= v[i].se.se;
        ans = max(ans, x*x+y*y);
    }

    printf("%.15f", sqrt(ans));
    return 0;
}


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

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

    map<string, ll> s;
    string st[n];

    rep(i, n){
        string tmp;
        cin >> tmp;

        s[tmp]++;
        st[i] = tmp;
    }

    rep(i, n - 1){
        if(s[st[i]] == 2){
            cout << "No" << endl;
            return 0;
        }
        if(st[i][st[i].size()-1] != st[i+1][0]){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
using System;

namespace CSharp
{
    class Program
    {
        public static void Main()
        {
            var N = int.Parse(Console.ReadLine());

            var result = false;
            for (int i = 1; i <= 9; i++)
            {
                for (int j = 1; j <= 9; j++)
                {
                    if (i * j == N)
                    {
                        result = true;
                        break;
                    }
                }
            }
            Console.WriteLine(result ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
 
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF 1e9
// #define ll long long ll
 
typedef long long ll;
ll mod = 1e9 + 7;
 
long long fast_exp(long long a, long long b)
{
	if(b <= 0)
	   return 1;
	else
	{
	   long long res = 1;
	   res = fast_exp(a,b/2);
	   res = (res*res)%mod;
	   if(b%2 == 1)
		  res = (res*a)%mod;
	   return res;
 
	}
}
typedef long double ld;



int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
    int n;
    cin>>n;
    int a[n];
    for(int i = 0; i<n ; i++)
        cin>>a[i];
    int chk = 1;
    for(int i = 0; i<n ; i++)
    {   
        if(a[i]%2 != 0)
            continue;
        if(a[i]%3 != 0 && a[i]%5 != 0)
            chk=0;

    }
    if(chk)
        cout<<"APPROVED\n";
    else
        cout<<"DENIED\n";


    return 0; 
}

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

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true){
            final int n = Integer.parseInt(br.readLine());
            if (n == 0) { break; }
             
            Map<String, Long> data = new HashMap<>(n);
            Map<String, Long> out = new HashMap<>(n);
            for (int i=1; i <= n; i++) {
                StringTokenizer st = new StringTokenizer(br.readLine());
                String e = st.nextToken();
                Long p = Long.parseLong(st.nextToken());
                Long q = Long.parseLong(st.nextToken());
                Long total = data.getOrDefault(e, 0L) + p * q;
                data.put(e, total);
                if (total >= 1_000_000L) {
                    if (out.containsKey(e) == false) {
                        System.out.println(e);
                        out.put(e, total);
                    }
                }
            }
            if (out.isEmpty()) {
                System.out.println("NA");
            }
        }
    }
}

Measured memory_bytes: 25824
#include <bits/stdc++.h>
#define forn(i,b) for(int i=0 ; i< b ;i++)
#define for1(i,b) for(int i=1 ; i<=b ;i++)
#define reps(i,a,b) for(int i=a ; i< b.length() ;i++)
typedef long long ll;
#define MOD 1000000007

using namespace std;




int main()
{

  int n,k,res=0,val;
  cin>>n>>k;
  for(int i=0;i<n;i++){
    cin>>val;
    if(val>=k)res++;
  }
cout<<res;
  return 0 ;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define DUMP(v) for(auto& x : v) cerr << x << " "; cerr << endl;
using namespace std;

using ll = long long;

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; }
constexpr int INF = 1e9+5;
constexpr long long INFLL = 1LL<<60;
constexpr double eps = (1e-9);

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

  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  int ma = -INF, ma_i, mi = INF, mi_i;
  rep(i, n) {
    if (chmax(ma, a[i])) ma_i = i;
    if (chmin(mi, a[i])) mi_i = i;
  }

  if (ma == mi) {
    cout << 0 << endl;
    return 0;
  }

  vector<pair<int, int>> ans;

  int t = 0;
  if (mi >= 0) {   // 最初から全部非負
    t = 1;
  } else if (ma < 0) {  // 最初から全部非正
    t = 0;
  } else if (abs(ma) >= abs(mi)) {  // 全部正にする
    t = 1;
    rep(i, n) {
      if (a[i] < 0) {
        a[i] += ma;
        ans.push_back({ma_i, i});
      }
    }
  } else {  // 全部負にする
    t = 0;
    rep(i, n) {
      if (a[i] > 0) {
        a[i] += mi;
        ans.push_back({mi_i, i});
      }
    }
  }

  if (t == 1) {
    for (int i = 0; i < n-1; i++) {
      ans.push_back({i, i+1});
    }
  } else {
    for (int i = n-1; i >= 1; i--) {
      ans.push_back({i, i-1});
    }
  }

  cout << ans.size() << endl;
  for (auto& p : ans) {
    cout << p.first + 1 << " " << p.second + 1 << endl;
  }

  return 0;
}


Measured memory_bytes: 256
# ABC113C - ID
def main():
    N, M, *PY = map(int, open(0).read().split())
    P = [[] for _ in range(N + 1)]  # prefectures
    # classify cities by prefectures
    for num, (pref, year) in enumerate(zip(*[iter(PY)] * 2)):
        P[pref] += [(year, num)]
    ans = [""] * M
    P = [sorted(p) for p in P]  # sort by year
    for pref_idx, pref in enumerate(P):
        for city_idx, (_, num) in enumerate(pref, 1):
            x = "{:06}{:06}".format(pref_idx, city_idx)
            ans[num] = x
    print("\n".join(map(str, ans)))

if __name__ == "__main__":
    main()

Measured memory_bytes: 46300
import java.util.Scanner;
public class Main{
    int S;
    int h=0;
    int m=0;
    int s=0;
    
    public void solve(){
        Scanner sc = new Scanner(System.in);
        S=sc.nextInt();
        h=S/3600;
        m=(S-h*3600)/60;
        s=S-(h*3600)-(m*60);
        System.out.println(h+":"+m+":"+s);
    }
    
    public static void main(String[] args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 17164
#include<stdio.h>



int main(void)
{
  int a,b,c,num=0;
scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);

  num=a;
  a=c;
  c=b;
  b=num;
  
  printf("%d %d %d",a,b,c);
 
return 0;
}

Measured memory_bytes: 1728
/* Preprocess */
#include <bits/stdc++.h>

#define pow(n) (n)*(n)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()


/* Field */
using namespace std;

/* Function */

int main (void) 
{

  /* Variable_Proclamation */
  int now_rate;     // input R
  int target_rate;  // input G
  int per;          // output performance


  /* Input, Initialize */
  cin >> now_rate;
  cin >> target_rate;


  /* Calculation */
  // 計算式は方程式の変形で導出
  per = target_rate *2 - now_rate;


  /* Output */
  cout << per << endl;


  return 0;

}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
template <typename T> inline T LB(vector<T>& v, T a) { return *lower_bound(ALL(v),a); }
template <typename T> inline int LBP(vector<T>& v, T a) { return lower_bound(ALL(v),a) - v.begin(); }
template <typename T> inline T UB(vector<T>& v, T a) { return *upper_bound(ALL(v),a); }
template <typename T> inline int UBP(vector<T>& v, T a) { return upper_bound(ALL(v),a) - v.begin(); }
template <typename T1, typename T2> ostream& operator<< (ostream& os, const pair<T1,T2>& p) { os << p.first << " " << p.second; return os; }
template <typename T1, typename T2> istream& operator>> (istream& is, pair<T1,T2>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator<< (ostream& os, const vector<T>& v) { REP(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator>> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for(auto &e : t) fill_v(e,v); }
const lint MOD = 1000000007;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;

int N, K;
pii ps[100010];

void _main() {
    cin >> N >> K;
    REP(i, N) {
        cin >> ps[i];
    }
    sort(ps, ps + N);
    REP(i, N) {
        K -= ps[i].second;
        if (K <= 0) {
            cout << ps[i].first << endl;
            return;
        }
    }
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i'))
            freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o'))
            freopen("output.txt", "w", stdout);
    }
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
typedef long long ll;
const int mod = 1e9 + 7;

bool month(int a)
{
  return a >= 1 && a <= 12;
}

int main()
{
  string s;
  cin >> s;
  for(int i = 0 ; i < sz(s) ; i++)
    s[i] -= '0';
  int a = s[0] * 10 + s[1];
  int b = s[2] * 10 + s[3];
  if(!month(a) && !month(b)){
    cout << "NA" << endl;
  }else if(!month(a) && month(b)){
    cout << "YYMM" << endl;
  }else if(month(a) && !month(b)){
    cout << "MMYY" << endl;
  }else{
    cout << "AMBIGUOUS" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    string s;
    cin>>s;
    int le=s.size();
    int n=le;
    for(int i=1;i<n;i++)
        if(s[i]!=s[i-1])
            le=min(le,max(n-i,i));
    cout<<le<<endl;
    return 0;
}


Measured memory_bytes: 512
x=0
y=0
b=[]
t=[]
dir=[[1,0],[0,1],[-1,0],[0,-1]]
ans=0

def dfs(p_x,p_y):
  global b,t,ans
  if t[p_y][p_x] or not b[p_y][p_x]: return
  ans+=1
  t[p_y][p_x]=True
  for i in dir:
    dfs(p_x+i[0],p_y+i[1])

while True:
  x=0
  y=0
  w,h=map(int,input().split())
  if w==0 and h==0: break
  b=[[False]*(w+2) for i in range(h+2)]
  t=[[False]*(w+2) for i in range(h+2)]
  ans=0
  for i in range(1,h+1):
    tmp=list(input())
    for j in range(1,w+1):
      b[i][j]=(tmp[j-1] in {'.','@'})
      if tmp[j-1]=='@': x=j;y=i
  dfs(x,y)
  print(ans)


Measured memory_bytes: 5760
n = int(input())
h = list(map(int, input().split()))
threshold = 0
answer = 'Yes'
if n >= 2:
    for i in range(n-1):
        if h[i] > h[i+1]:
            if (threshold > h[i+1]) or (h[i] > h[i+1] +1):
                answer = 'No'
                break
            elif h[i] == h[i+1] + 1:
                threshold = h[i+1]
print(answer)

Measured memory_bytes: 14396
from collections import deque

def dfs(x):
    INF = 10**9
    q = deque()
    q.append(x)
    d = [INF] * n
    d[x] = 0
    while q:
        f = q.pop()
        now = d[f]
        for ce in e[f]:
            if d[ce] == INF:
                d[ce] = now + 1
                q.append(ce)
    return d    


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

    
d0 = dfs(0)
dn = dfs(n-1)
f = 0
for i in range(n):
    if d0[i] <= dn[i]:
        f += 1
s = n - f
print('Fennec') if f > s else print('Snuke')

Measured memory_bytes: 33924
a = int(input())
b = int(input())
c = int(input())
x = int(input())

sums = []
sum = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            sums.append(500*i + 100*j + 50*k)

print(sums.count(x))

Measured memory_bytes: 8404
#include<cstdio>
#include<cstring>
char s[200050];
int main(){
	int n,a,b,c,d,i;
	scanf("%d%d%d%d%d%s",&n,&a,&b,&c,&d,s+1);
	for(i=b+1;i<d-1;++i)if(s[i]=='#'&&s[i+1]=='#'){
		puts("No");
		return 0;
	}
	if(c<d){
		for(i=a+1;i<c-1;++i)if(s[i]=='#'&&s[i+1]=='#'){
			puts("No");
			return 0;
		}
		puts("Yes");
	}else{
		bool ok=0;
		for(i=a;i<c-1;++i)if(s[i]=='#'&&s[i+1]=='#'){
			puts("No");
			return 0;
		}else if(s[i]=='.'&&s[i+1]=='.'&&s[i+2]=='.'&&i+1>=b&&i+1<=d)ok=1;
		puts(ok?"Yes":"No");
	}
	return 0;
} 

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

int n, k, v[100010], dp[100010];

int recur(int pos) {
	if(pos == n-1)
		return 0;
	if(pos >= n)
		return INF;

	if(dp[pos] != -1)
		return dp[pos];

	int ret = INF;
	for(int i = 1; i <= k; ++i)
		ret = min(ret, recur(pos+i) + abs(v[pos] - v[pos+i]));

	dp[pos] = ret;
	return ret;
}

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

	for(int i = 0; i < n; ++i)
		cin >> v[i];

	memset(dp, -1, sizeof dp);
	cout << recur(0) << endl;
	return 0;
}

Measured memory_bytes: 5760
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <iomanip>
#include <cassert>
#include <random>
#include <tuple>

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

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


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

    ll ans = 0;
    ll num = 0;
    rep(i, n) {
        if (i % 2 == 0 && a[i] + num <= 0) {
            ans += abs(a[i] + num) + 1;
            num = 1;
        } else if (i % 2 == 1 && a[i] + num >= 0) {
            ans += abs(a[i] + num) + 1;
            num = -1;
        } else {
            num += a[i];
        }
    }
    
    ll ans2 = 0;
    ll num2 = 0;
    rep(i, n) {
        if (i % 2 == 0 && a[i] + num2 >= 0) {
            ans2 += abs(a[i] + num2) + 1;
            num2 = -1;
        } else if (i % 2 == 1 && a[i] + num2 <= 0) {
            ans2 += abs(a[i] + num2) + 1;
            num2 = 1;
        } else {
            num2 += a[i];
        }
    }

    cout << min(ans, ans2) << endl;


    return 0;
}


Measured memory_bytes: 1024
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_C main
#include "bits/stdc++.h"
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions
bool second_greater(const pll& left, const pll& right) {
    return left.second > right.second;
}
#endif


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

    int N; cin >> N;
    vi A(N), B(N);
    REP(i, N) cin >> A[i] >> B[i];
    vi C(N), D(N);
    REP(i, N) cin >> C[i] >> D[i];


    vector<pii> red, blue;
    REP(i, N) {
        red.push_back(pii(A[i], B[i]));
        blue.push_back(pii(C[i], D[i]));
    }

    sort(blue.begin(), blue.end());
    sort(red.begin(), red.end(), second_greater);

    vb used(N, false);
    REP(i,N){
        REP(j,N) {
            if (!used[j] && red[j].first < blue[i].first &&
                red[j].second < blue[i].second) {
                used[j] = true;
                break;
            }
        }
    }

    int ans = 0;
    REP(i, N) {
        if (used[i]) ans++;
    }

    cout << ans << endl;

    return 0;
}

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

int main() {
  int n;
  string s;
  cin >> n >> s;
  long long r=0, g=0, b=0;
  for (char c: s) {
    if (c=='R') ++r;
    else if (c=='G') ++g;
    else ++b;
  }
  long long ans=r*g*b;
  for (int i=0; i<n; ++i) {
    for (int d=0;; ++d) {
      int j=i+d, k=j+d;
      if (k>=n) break;
      if (s[i]!=s[j] && s[j]!=s[k] && s[k]!=s[i]) --ans;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3592
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s,t;
  cin>>s;
  cin>>t;
  int ans=t.size();
  for(int i=0;i<=s.size()-t.size();i++){
    int diff=0;
    for(int j=0;j<t.size();j++){
       if(t[j]!=s[i+j]) diff++;
    }
    ans=min(diff,ans);
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3600
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

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;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y){
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
/*逆元計算*/
long long int  modinv(long long a, long long m) {
	long long int b = m, u = 1, v = 0;
	while (b) {
		long long int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
// index が条件を満たすかどうか
vector<long long int >meguru;
bool isOK(int index, int key) {
	if (meguru[index] >= key) return true;
	else return false;
}
// 汎用的な二分探索のテンプレ
int binary_search(int key) {
	int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = (int)meguru.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, key)) right = mid;
		else left = mid;
	}
	/* left は条件を満たさない最大の値、right は条件を満たす最小の値になっている */
	return right;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

int main() {
	int h, w;
	cin >> h >> w;
	char meiro[60][60] = {};
	int sum = 0;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			char a;
			cin >> a;
			meiro[i][j] = a;
			if (a == '.') {
				sum++;
			}
		}
	}
	int xdp[4] = { 1,-1,0,0 };
	int ydp[4] = { 0,0,1,-1 };
	queue<pair<int, int>> q;
	int seen[60][60] = {};
	seen[0][0] = 1;
	q.push(make_pair(0, 0));
	while (q.size()) {
		pair<int, int>now = q.front();
		q.pop();
		for (int i = 0; i < 4; i++) {
			int y = now.first + ydp[i];
			int x = now.second + xdp[i];
			if (y >= 0 && y <= h - 1 && x >= 0 && x <= w - 1) {
				if (meiro[y][x] == '.' && seen[y][x] == 0) {
					seen[y][x] = seen[now.first][now.second] + 1;
					q.push(make_pair(y, x));
				}
			}
		}
	}
	if (meiro[0][0] == '.' && meiro[h - 1][w - 1] == '.') {
		if (seen[h - 1][w - 1] == 0) {
			cout << -1;
		}
		else {
			cout << sum-seen[h - 1][w - 1];
		}
	}
	else {
		cout << -1;
	}
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void)
{
  while(true)
    {
      int n,x,count=0;
      cin>>n;
      cin>>x;
      if(n==0 && x==0)break;
      for(int i=1;i<=n;i++)
	{
	  for(int j=i+1;j<=n;j++)
	    {
	      for(int k=j+1;k<=n;k++)
		{
		  
		  if(i+j+k==x)
		    {
		     
count++;
		    }
		}
	    }
	}
      cout<<count<<endl;
    }
  return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  if(c >= min(a,b) && c <= max(a,b)) cout << "Yes\n";
  else cout << "No\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
double h[100000];
int main()
{
	int n,t,a,b,i;
	scanf("%d",&n);
	scanf("%d%d",&t,&a);
	for(i=0;i<n;i++)
	{       
			scanf("%lf",&h[i]);
		    h[i]=t-h[i]*0.006;
	}
	double min=10000000000.0;
	for(i=0;i<n;i++)
	{
		if(fabs(h[i]-a)<=min)
		{
			min=fabs(h[i]-a);
			b=i;	
		}
	}
	printf("%d\n",b+1);
	return 0;
}

Measured memory_bytes: 128
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    ll n,p,o=0,e=0,ans=1; cin>>n>>p;
    rep(i,n){
        ll a; cin>>a;
        if(a%2) o++;
        else e++;
    }
    rep(i,n-1) ans*=2;
    if(o==0){
        if(p==1) ans=0;
        else ans*=2;
    }

    cout<<ans<<endl;
}

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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll) 1e9 + 7;
constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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;
}

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}


void solve(){
    double r;
    cin>>r;
    cout<<fixed<<setprecision(10)<<r*6.28318530717958623200<<en;
}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}


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


int main(){
    string s;
    cin >> s;
    int n = s.size();
    long long ans = 0;
    for(int bit = 0; bit < (1 << n-1); bit++){
        int l = 0;
        for(int r = 0; r < n; r++){
            if(r == n-1){
                ans += stoll(s.substr(l, r-l+1));
            }
            else if(bit & (1 << r)){
                ans += stoll(s.substr(l, r-l+1));
                l = r+1;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void) {
	int x, y;
	scanf("%d %d", &x, &y);
	if (y&1)
		printf("No");
	else if (2*x <= y && y <= 4*x)
		printf("Yes");
	else
		printf("No"); 
	return 0;
}

Measured memory_bytes: 1728
import java.util.Scanner;

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

        String s = sc.next();
        if (s.length() % 2 == 0)
            s = s.substring(0, s.length()-1);

        int ans = 0;
        for (int i = 1; i < s.length(); i += 2) {
            int index = s.length() - i;
            String s1 = s.substring(0, index/2);
            String s2 = s.substring(index/2, index);
            if (s1.equals(s2)) {
                ans = index;
                break;
            }
        }

        System.out.println(ans);
    }
}



Measured memory_bytes: 23764
n,m,x,y = map(int,input().split())
xlis = list(map(int,input().split()))
ylis = list(map(int,input().split()))

z = min(min(xlis),min(ylis),x,y)
while (z <= max(max(xlis),max(ylis),x,y)):
    if x < z <= y and max(xlis) < z and z <= min(ylis):
        print('No War')
        exit()
    z +=1

print('War')


Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main(){
	int N;
	int a[1000];
	int max=0;
	int min=1000;
	int i,j,k;
	
	cin>>N;
	for(i=0;i<N;i++){
		cin>>a[i];
		if(a[i]<min){
			min=a[i];
		}
		if(a[i]>max)
			max=a[i];
	}
	cout<<max-min;
}
	
	

Measured memory_bytes: 256
A=abs
_,*p=[list(map(int,t.split()))for t in open(0)]
x,y,h=[t for t in p if t[2]][0]
for I in range(10201):j,i=I//101,I%101;H=h+A(x-j)+A(y-i);print(*(j,i,H)*all(u==max(H-A(s-j)-A(t-i),0)for s,t,u in p))

Measured memory_bytes: 3700
S = int(input())
MOD = 10**9 + 7

class Combination:
    #クラス外にMODの宣言をする必要がある。
    def __init__(self, N):
        self.fac = [1] * (N + 1)
        for i in range(1, N + 1):
            self.fac[i] = (self.fac[i - 1] * i) % MOD
        self.invmod = [1] * (N + 1)
        #逆元?
        self.invmod[N] = pow(self.fac[N], MOD - 2, MOD)
        for i in range(N, 0, -1):
            self.invmod[i - 1] = (self.invmod[i] * i) % MOD

    def calc(self, n, k):  # nCk
        return self.fac[n] * self.invmod[k] % MOD * self.invmod[n - k] % MOD


N = S // 3
com = Combination(10**6)
ans = 0
for n in range(1,N+1):
    s = S - 3*n
    ans = (ans+com.calc(s+n-1,n-1))%MOD
print(ans)

Measured memory_bytes: 79976
from itertools import combinations as cb   
n = int(input())

k = 0
for i in range(1,1000):
    if i*(i-1)//2 == n:
        k = i
if k == 0:
    print("No")
    exit()

print("Yes")
print(k)
x = list(cb([i for i in range(k)], 2))
dp = [[] for i in range(k)]
for i,(a,b) in enumerate(x):
    dp[a].append(i+1)
    dp[b].append(i+1)
for r in dp:
    print(len(r), *r)

Measured memory_bytes: 24200
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define pb push_back
#define pi pair<int, int>
#define l first
#define r second
#define all(x) x.begin(), x.end()
#define fori(a, b, step) for (int i = a; i < b; i += step)
#define forj(a, b, step) for (int j = a; j < b; j += step)
#define int long long

const int maxn = 1e6 + 1, mod = 1e9 + 7;

using namespace std;

int a[maxn];

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n; string s;
    cin >> n >> s;
    int cwi = 0, ans = 0;
    for (int i = n - 1; i >= 0; i--) {
        if (s[i] == 'W') continue;
        while (cwi < i && s[cwi] == 'R') ++cwi;
        if (cwi >= i) continue;
        ++ans; swap(s[i], s[cwi]);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3776
#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() {
  int a, b, c;
  cin >> a >> b >> c;
  swap(a,b);
  swap(a,c);
  printf("%d %d %d\n", a, b, c);
  return 0;
}

Measured memory_bytes: 256