akhauriyash/Code-Regression huggingface dataset:
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <iomanip>

typedef long double ld;
typedef long long ll;

using namespace std;


/* TEMPLATE ENDS HERE */

#define MAXN (1 << 21)

int a[MAXN];

int main() {
	cout << fixed << setprecision(12);	
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	a[n] = MAXN - 1;
	int j = 0;
	ll ret = 0;
	int x = 0;
	for (int i = 0; i < n; i++) {
		while ((a[j] & x) == 0 && (j < n)) {
			x |= a[j];
			j++;
		}
		ret += j - i;
		x &= ~a[i];
	}
	cout << ret << endl;

	return 0;
}


ll MOD = ((ll)1e9 + 7);

struct mod {
	ll x;

	mod(ll tx = 0) {
		x = tx;
		x %= MOD;
	}
	
	mod& operator=(const ll & tx) {
		x = tx % MOD;
		return *this;
	}
	
	mod& operator=(const mod & m2) {
		x = m2.x;
		return *this;
	}

	mod operator+(const mod& m2) const {
		return mod((x + m2.x) % MOD);
	}

	mod& operator+=(const mod& m2) {
		x += m2.x;
		x %= MOD;
		return *this;
	}

	mod operator-(const mod & m2) const {
		return mod((x - m2.x + MOD) % MOD);
	}

	mod& operator-=(const mod & m2) {
		x -= m2.x;
		x = (x + MOD) % MOD;
		return *this;
	}

	mod operator*(const mod & m2) const {
		return mod((x * m2.x) % MOD);
	}

	mod& operator*=(const mod & m2) {
		x *= m2.x;
		x %= MOD;
		return *this;
	}

	mod mypow(ll k) const {
		mod ret = 1;
		mod cur = x;
		while (k) {
			if (k & 1) {
				ret *= cur;
			}
			cur *= cur;
			k >>= 1;
		}
		return ret;
	}

	mod inv() const {
		return mypow(MOD - 2);
	}

	mod operator/(const mod & m2) const {
		return (*this) * m2.inv();
	}

	mod& operator/=(const mod & m2) {
		x *= m2.inv().x;
		x %= MOD;
		return *this;
	}

	bool operator<(const mod & m2) const {
		return x < m2.x;
	}
};

ostream &operator<<(ostream & os, const mod & m) {
	return os << m.x;
}



Measured memory_bytes: 4344
import java.util.Scanner;


class Main {

    
    public static void main(String[] args) {
     
        Scanner in = new Scanner(System.in);
        int b = in.nextInt();
        String a=in.next();
        String str="";
        for(int i=0;i<a.length();i++) {
            int asc = (int) a.charAt(i);
            if((asc+b)<=90) {
                char as = (char) (asc+b);
                str+=as;
            } 
            else{
                char as = (char) ((asc-26) + b);
                str+=as;
            }
        }
        System.out.println(str);   
        
        
    }
    
   
}
   

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

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

int main() {
	int a,b; cin>>a>>b;	
	cout<<6-a-b<<endl;
	return 0;
}

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

const int MAXN = 100000 + 15 ;

bool noSolution;
int N, K;
pair <int, int> pnt[MAXN];
struct node
{
    int l, r, oe;
}rng[MAXN];
vector <int> Adj[MAXN];

void UpdateNode(int toUpdate, int evidence)
{
    int l = rng[evidence].l-1, r = rng[evidence].r+1;
    if(rng[evidence].oe != -1)
    {
        if(rng[toUpdate].oe == -1)
            rng[toUpdate].oe = rng[evidence].oe ^ 1;
        else if(rng[toUpdate].oe == rng[evidence].oe)
            noSolution = true ;
    }
    rng[toUpdate].l = max(rng[toUpdate].l, l), rng[toUpdate].r = min(rng[toUpdate].r, r);

    if(rng[toUpdate].l > rng[toUpdate].r)
        noSolution = true ;
}

void DFSPushUp(int x, int fa)
{
    if(noSolution)
        return ;
    for(int & to : Adj[x])
        if(to != fa)
            DFSPushUp(to, x),   UpdateNode(x, to);
}

void DFSPushDown(int x, int fa)
{
    if(noSolution)
        return;
    if(fa)
        UpdateNode(x, fa);
    for(int & to : Adj[x])
        if(to != fa)
            DFSPushDown(to, x);
}

int main()
{
    int u, v, w;
    cin >> N ;

    for(int i = 1; i < N; i++)
        cin >> u >> v , Adj[u].push_back(v), Adj[v].push_back(u);

    cin >> K ;
    for(int i = 1; i <= N; i++)
        rng[i].l = 0x80808080, rng[i].r = 0x7F7F7F7F, rng[i].oe = -1;
    for(int i = 1; i <= K; i++)
        cin >> pnt[i].first >> pnt[i].second, rng[pnt[i].first].l = pnt[i].second, rng[pnt[i].first].r = pnt[i].second, rng[pnt[i].first].oe = pnt[i].second & 1;

    DFSPushUp(1, 0);
    DFSPushDown(1, 0);

    if(noSolution)
        puts("No");
    else
    {
        puts("Yes");
        for(int i = 1; i <= N; i++)
            cout << rng[i].l << endl ;
    }

    return 0;
}


Measured memory_bytes: 12800
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include <vector>
#include <cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
 const int MAX = 510000;
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;
    }
}
 
ll combi(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;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  st s;
  	ci(s);
  SORT(s);
  if(s[0]==s[1]&&s[1]!=s[2]&&s[2]==s[3]) co("Yes")
    else co("No")
    }

Measured memory_bytes: 256
# Your code here!
 #R=gets.to_i
#puts 2.0000*3.141592*R

N = gets.chomp.split(" ")
A = gets.chomp.split(" ")
B = A.length
sum = 0

#p N
#p A
#p B

(1..(B.to_i)).each do |i|
   sum += 1
end
#puts sum

kosuu = 0
(0..(sum.to_i-1)).each do |i|
    kosuu += A[i].to_i
end
#puts kosuu


    if N[0].to_i < kosuu.to_i
        puts -1
    else 
        puts (N[0].to_i - kosuu.to_i)
    end
     
#end

Measured memory_bytes: 14604
/*A - We Love Golf*/
#include <bits/stdc++.h>
using namespace std;

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int K, A, B;

	cin >> K >> A >> B;

	bool can = false;

	for (int i = A; i <= B; ++i)
	{
		if(i % K == 0)
			can = true;
	}

	if(can)
		cout << "OK";
	else
		cout << "NG";

	return 0;	
}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(N), B(N);
  
  for (int i = 0; i < N; ++i) {
    cin >> A[i] >> B[i];
  }
  
  // ペアにしたいんだな
  vector<pair<int, int>> AB(N);
  for (int i = 0; i < N; ++i) {
    AB[i] = make_pair(A[i], B[i]);
  }
  sort(AB.begin(), AB.end());  // ソートアルゴリズム
  
  long long ans = 0;
  for (int i = 0; i < N; ++i) {
    int buy = min(M, AB[i].second);	// 残り本数か、店で買える上限
    
    ans += (long long)buy * AB[i].first;
    M -= buy;		// 残り本数を減らす
  }
  
  cout << ans << endl;
  
}    

Measured memory_bytes: 1792
N,X = map(int,input().split())
x = list(map(int,input().split()))
def GCD(x,y):
    while y!=0:
        x,y = y,x%y
    return x
ans = 0
for i in range(N):
    ans = GCD(ans,abs(x[i]-X))
print(ans)


Measured memory_bytes: 14252
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5,M=2e4+5,inf=0x3f3f3f3f,mod=1e9+7;
#define mst(a,b) memset(a,b,sizeof a)
#define lx x<<1
#define rx x<<1|1
#define reg register
#define PII pair<int,int>
#define fi first
#define se second
#define pb push_back
#define il inline
int n,a[N];
ll fac[N];
int vis[N],d;
ll ksm(ll a,ll n){
	ll ans=1;
	while(n){
		if(n&1) ans=ans*a%mod;
		a=a*a%mod;
		n>>=1;
	}
	return ans;
}
ll C(int n,int k){
	if(n<k) return 0;
	return fac[n]*ksm(fac[k]*fac[n-k]%mod,mod-2)%mod;
}
int main(){
	scanf("%d",&n);
	fac[0]=1;
	for(int i=1;i<=n+1;i++){
		scanf("%d",&a[i]);
		if(vis[a[i]]) d=(i-vis[a[i]]);
		vis[a[i]]=i;
		fac[i]=fac[i-1]*i%mod;
	}
	for(int i=1;i<=n+1;i++){
		printf("%lld\n",((C(n+1,i)-C(n-d,i-1))%mod+mod)%mod);
	}
	return 0;
}

Measured memory_bytes: 5244
import java.util.*;
class Main {
	public static void main (String[] args) throws java.lang.Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a < b) {
			System.out.println("a < b");
		} else if(a > b){ 
			System.out.println("a > b");
		} else {
			System.out.println("a == b");
		}
	}
}



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

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF             2e9
#define INF_LL          1LL<<60
#define ll              long long
#define Ceil(x, n)      (((((x))+((n)-1))/n))
#define CeilN(x, n)     (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)    ((x)-(x)%(n))
#define ALL(x)          (x).begin(),(x).end()
typedef pair<ll, ll>    P;

int main() {
    int n, k;
    cin >> n >> k;
    int start = -1;
    REP(i, k) {
        start += 2;
        if(n < start) {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair<int,string> P;

static const double eps = 1e-8;

int trainTime[101][101];
int trainCost[101][101];

int main(){
	int n,m;
	while(~scanf("%d %d",&n,&m)){
		if(n==m && m==0) break;
		memset(trainTime,0x3,sizeof(trainTime));
		memset(trainCost,0x3,sizeof(trainCost));
		for(int i=0;i<n;i++){
			int a,b,cost,time;
			scanf("%d %d %d %d",&a,&b,&cost,&time);
			trainTime[a][b] = trainTime[b][a] = min(trainTime[a][b],time);
			trainCost[a][b] = trainCost[b][a] = min(trainCost[a][b],cost);
		}

		for(int k=1;k<=m;k++){
			for(int i=1;i<=m;i++){
				for(int j=1;j<=m;j++){
					trainTime[i][j] = min(trainTime[i][k]+trainTime[k][j],trainTime[i][j]);
					trainCost[i][j] = min(trainCost[i][k]+trainCost[k][j],trainCost[i][j]);
				}
			}
		}

		int k;
		scanf("%d",&k);
		for(int i=0;i<k;i++){
			int a,b,r;
			scanf("%d %d %d",&a,&b,&r);
			printf("%d\n", r == 0 ? trainCost[a][b] : trainTime[a][b]);
		}

	}

}

Measured memory_bytes: 968
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <set>
using namespace std;

#define int long long

signed main() {
    int n, l; cin >> n >> l;
    string tmp = "";
    vector<string> s(n);

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

    sort(s.begin(), s.end());

    for(int i = 0; i < n; i++) cout << s[i];
    cout << endl;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var (
		character string
	)

	fmt.Scan(&character)

	if character == "a" || character == "i" || character == "u" || character == "e" || character == "o" {
		fmt.Print("vowel")
	} else {
		fmt.Print("consonant")
	}
}


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

using namespace std;

int n, m, a, b;

int main(){
  //  freopen("input.txt","r",stdin);
    cin >> n >> m;

    vector< vector<int> > v(n+1);

    for(int i = 0; i < m; i++){
        cin >> a >> b;
        v[a-1].push_back(b);
        v[b-1].push_back(a);
    }

    for(int i = 0; i < v.size()-1; i++){
        cout << v[i].size() << endl;
    }


}

//g++ -std=c++14 comp.cpp -o b; ./b.exe
//g++ -std=c++14 comp.cpp && ./a.out


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

const int N = 1e6 + 100;

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s;
    int n = s.size();
    s.push_back('?');
    vector<int> dp(n+1), occ;
    occ.push_back(n);
    long long ans = 0;
    for(int i = n-1; i >= 0; i--) {
        if(s[i] == 'A') {
            ans += dp[occ.back()];
        }
        else {
            occ.push_back(i);
            if(s[occ.back()] == 'B' && s[occ[occ.size()-2]] == 'C' && occ.back()+1 == occ[occ.size()-2]) {
                dp[i] = 1+dp[occ[occ.size()-3]];
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 2448
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) x.size()
#define all(x) x.begin(),x.end()
using namespace std;
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
typedef long long ll;
typedef unsigned long long ull;
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDD pair<double,double>
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-6;
const int MAX=1e5+10;
const ll mod=1e9+7;
int main()
{
	char s[55],a[]="AKIHABARA";
	int len,i,j,flag;
	while(~scanf("%s",s))
	{
		len=strlen(s);
		j=0;
		flag=0;
		for(i=0;i<len;i++)
		{
			if(a[j]=='\0')
			{
				flag=1;
				break;
			}
			if(s[i]!=a[j])
			{
				if(a[j]=='A') j++;
				else
				{
					flag=1;
					break;
				}
				if(s[i]!=a[j])
				{
					flag=1;
					break;
				}
			}
			j++;
	//		cout<<i<<endl;
		}
		if(a[j]=='A') j++;
		if(!flag&&a[j]=='\0') puts("YES");
		else puts("NO");
	}
	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;

		while ((n = scan.nextInt()) != 0) {

			int m = scan.nextInt();

			short[][] cost = new short[100][100];
			short[][] time = new short[100][100];

			init(cost);
			init(time);

			for (int i = 0; i < n; i++) {
				int a = scan.nextInt()-1;
				int b = scan.nextInt()-1;
				cost[a][b] = cost[b][a] = scan.nextShort();
				time[a][b] = time[b][a] = scan.nextShort();
			}

			for (int i = 0; i < m; i++) {
				for (int j = 0; j < m; j++) {
					for (int j2 = 0; j2 < m; j2++) {
						cost[j][j2] = (short) Math.min(cost[j][j2], cost[j][i]
								+ cost[i][j2]);
						time[j][j2] = (short) Math.min(time[j][j2], time[j][i]
								+ time[i][j2]);
					}
				}
			}

			int k = scan.nextInt();

			for (int i = 0; i < k; i++) {
				int p = scan.nextInt()-1;
				int q = scan.nextInt()-1;
				int r = scan.nextInt();
				System.out.println(r==0 ? cost[p][q] : time[p][q]);
			}

		}

	}

	public static void init(short[][] a){
		for (int i = 0; i < 100; i++) {
			for (int j = 0; j < 100; j++) {
				a[i][j] = Short.MAX_VALUE/2;
			}
		}
		for (int i = 0; i < 100; i++) {
			a[i][i]=0;
		}
	}
}

Measured memory_bytes: 65712
// dile a la jardinera que traigo flores
// corner cases // int vs ll // cin vs scanf
#include <bits/stdc++.h>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define sz(x) int(x.size())
#define fill(x,v) memset(x,v,sizeof(x))
#define FER(i,a,b) for(int i = int(a); i < int(b); ++i)
#define trace(x) cout << #x << " = " << x << endl
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define N 3050
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;

int dp[N][N];

int main(){

	string s,t;
	cin >> s >> t;

	fill(dp,0);
	for(int i = 1; i <= sz(s); ++i){
		for(int j = 1; j <= sz(t); ++j){
			dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
			if(s[i-1] == t[j-1]) dp[i][j] = dp[i-1][j-1] + 1;
		}
	}

	string ans;
	int i = sz(s), j = sz(t);
	while(dp[i][j]){
		if(s[i-1] == t[j-1]) ans = s[i-1] + ans, --i, --j;
		else (dp[i-1][j] > dp[i][j-1]) ? --i : --j;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 36608
#include <bits/stdc++.h>
#define cntbit __builtin_popcountll
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;

struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%MOD+MOD)%MOD){}
  mint& fix() { x = (x%MOD+MOD)%MOD; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint& operator+=(const mint& a){ if((x+=a.x)>=MOD) x-=MOD; return *this;}
  mint& operator-=(const mint& a){ if((x+=MOD-a.x)>=MOD) x-=MOD; return *this;}
  mint& operator*=(const mint& a){ (x*=a.x)%=MOD; return *this;}
  mint operator^(int b) {mint res = 1;while(b > 0) {if(b&1) {res = (res*(*this));}*this=(*this)*(*this);b>>=1;} return res;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
};
  
int main() {
  int N;
  cin >> N;
  vvi A(N,vi(N));
  rep(i,N) {
    rep(j,N) {
      cin >> A[i][j];
    }
  }
  v(mint) dp(1<<N);
  dp[0] = 1;
  rep(k,1<<N) {
    int s = cntbit(k);
    rep(i,N) {
      if((~k)>>i&1 && A[s][i]) {
        dp[(1<<i)|k] += dp[k];
      }
    }
  }
  cout << dp[(1<<N)-1].x << endl;
  return 0;
}

Measured memory_bytes: 16640
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>
 
#define PB push_back
#define all(a)  (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a)  (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
 
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int INF = (int)1e9;
const ll inf = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;
 
int main() {
	int n, m, K;
	cin >> n >> m >> K;
	
	for (int k = 0; k <= n; k++) {
		for (int l = 0; l <= m; l++) {
			if (k * (m - l) + (n - k) * l == K) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
 
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#if __has_include("D:/dhiraj/Programming/debug.h")
    #include "D:/dhiraj/Programming/debug.h"
#else
    #include <bits/stdc++.h>
    using namespace std;
    #define d(...) 11
#endif

// Data Type ----------------------------------------------------------------

#define ull                 unsigned long long int
#define ll                  long long int
#define ld                  long double

// Loops --------------------------------------------------------------------

#define loop(i,s,e)         for(ll i=(s); i<(e); i++)
#define rloop(i,s,e)        for(ll i=(s); i>=(e); i--)
#define iter(it,var)        for(auto it=var.begin(); it!=var.end(); it++)
#define riter(it,var)       for(auto it=var.rbegin(); it!=var.rend(); it++)

// Stl ----------------------------------------------------------------------

#define ff                  first
#define ss                  second
#define pb                  push_back
#define eb                  emplace_back
#define vll                 vector<ll>
#define vvl                 vector<vll>
#define pll                 pair<ll,ll>
#define all(x)              x.begin(),x.end()
#define rall(x)             x.rbegin(),x.rend()

// Extra --------------------------------------------------------------------

#define fast                ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define print(any)          for(auto &i:any) cout<<i<<" "; nl;
#define precise(a)          cout<<fixed<<setprecision(a)
#define nl                  std::cout<<'\n'
#define INF                 LLONG_MAX
#define endl                '\n'

// Template -----------------------------------------------------------------

template <typename T> 
inline bool inrange(T a, T l, T r) {
    if(l>r) swap(l,r);
    return (a>=l and a<=r);
}
template <typename T, typename U> 
inline bool exist(T val, U &any) {
    return (any.find(val) != any.end());
}
// multiple input
template <typename T> 
inline void inp(T &any) {
    cin >> any;
}
template <typename T, typename... U> 
inline void inp(T &a,U &...b) {
    cin >> a; inp(b...);
}
// scan vector
template <typename T> 
inline istream& operator >> (istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream& operator >> (istream &in, pair<T,U> &a) {
    in >> a.ff >> a.ss; 
    return in;
}

// Solve --------------------------------------------------------------------

void solve(ll &T)
{
    ll n, k;
    std::cin>>k>>n;

    vll a(n);
    std::cin>>a;

    vll ans(n);
    ans[0] = a[0] + k - a[n-1];
    loop(i,1,n)
        ans[i] = a[i] - a[i-1];

    sort(all(ans));
    std::cout<<accumulate(all(ans),0LL)-ans.back();
}

// Main ---------------------------------------------------------------------

int main()
{
    #ifdef Dhiraj
        freopen("D:/dhiraj/Programming/i1.txt","r",stdin);
        freopen("D:/dhiraj/Programming/o1.txt","w",stdout);
    #endif
    
    fast;
    int t = 1;
    loop(i,1,t+1)
    solve(i);
    return 0;
}

Measured memory_bytes: 3328
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let N: usize = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    };

    const P: usize = 55555;
    let mut p = vec![true; P + 1];
    p[0] = false;
    p[1] = false;
    for i in 2..(P + 1) { for j in 2..(P / i + 1) { p[i * j] = false; } }

    let ans = (2..P)
        .filter(|&i| p[i] && i % 5 == 2)
        .map(|i| i.to_string())
        .take(N)
        .collect::<Vec<_>>()
        .join("\n");

    println!("{}", ans);
}

Measured memory_bytes: 4352
#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 n;
    cin >> n;
    int a[n];
    rep(i,n) {
        cin >> a[i];
    }
    int64_t m[n] = {0};
    int standard;
    rep(i,n) {
        if (i%2 == 0) standard += a[i];
        else standard -= a[i];
    }
    m[0] = standard;
    cout << standard;
    rep(i,n-1) {
        m[i+1] = (a[i] - m[i]/2) * 2;
        cout << " " << m[i+1];
    }
    cout << endl;
}

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


int main(){
    string s;
    cin >> s;
    bool ans = false;
    rep(i,s.size()){
        rep(jj, s.size()){
            if(i<jj && s.at(i) == 'C' && s.at(jj) == 'F') ans = true;
        }
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}   

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,ll>
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 100009;
ll a,b,n;
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n>>a>>b;
    cout<<min(a,b)<<" "<<max(0LL,a + b - n);
    return 0;
}

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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long ll;
typedef pair<int, int> P;
const int M = 1e9 + 7;
const int INF = 1e9;
const int MAX_V = 100 + 5;
const int MAX_N = 1e5 + 5;

int main() {
    ll n, m;
    cin >> n >> m;
    ll numOfS = n;
    ll numOfC = m / 2;
    ll diff = numOfC - numOfS;
    if (diff < 0) {
        cout << numOfC << endl;
    } else {
        cout << diff / 2 + numOfS << endl;
    }
}


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

int main()
{
  int N;
  cin>>N;
  int ans=0;
  while(true){
    for(int i=1;i<N;i++){
      if(N%i==0)ans++;
    }
    if(ans==1){
      cout<<N<<endl;
      break;
    }
    ans=0;
    N++;
  }
}


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

int main()
{
    int a,b;cin>>a>>b;
    if(a>0)cout<<"Positive"<<endl;
    else if(a<0&&b>0)cout<<"Zero"<<endl;
    else{
        if((b-a)%2==0)cout<<"Negative"<<endl;
        else cout<<"Positive"<<endl;
    }
}

Measured memory_bytes: 256
N, P = map(int, input().split())
lst_A = list(map(int, input().split()))
lst_odd_even = [x%2 for x in lst_A]

if 1 in lst_odd_even:
    ans = 2 ** (N-1)
else:
    if P == 0:
        ans = 2 ** N
    else:
        ans = 0

print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
using namespace std;
#define MOD 1000000007
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;

int main(){
    ll a,b,c; cin >> a >> b >> c;
    if((a < c && c < b) || (b < c && c < a)) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(ll i = 0; i < (ll)(x); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
const ll INF = LLONG_MAX/4;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll n,m; cin >> n >> m;
    const int m_max = 30;
    bitset<m_max> bs((1LL << m)-1);
    rep(i,n){
        ll k; cin >> k;
        bitset<m_max> temp(0);
        rep(j,k){
            ll a; cin >> a;
            a--;
            temp[a] = 1;
        }
        bs &= temp;
    }

    cout << bs.count() << endl;
}

Measured memory_bytes: 256
n, a, b = map(int, input().split())
h = [int(input()) for i in range(n)]

left = 0
right = 10**10
mid = (left + right) // 2
while right - left > 1:
    mid = (left + right) // 2
    count = 0
    for i in range(n):
        if h[i] - mid * b > 0:
            if (h[i] - mid * b) % (a - b) == 0:
                count += (h[i] - mid * b) // (a - b)
            else:
                count += (h[i] - mid * b) // (a - b) + 1
    if mid - count >= 0:
        right = mid
    else:
        left = mid
print(right)

Measured memory_bytes: 7112
/**
 *      ABc 66 C
 *      author  : kyomukyomupurin
 *      created : 2018-09-08 08:56:37
**/

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios::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 start = n / 2;
    int b[n] = {};
    b[start] = a[0];

    if (n % 2 == 0){
        for (int i = start + 1; i < n; ++i) {
            b[i] = a[2 * (i - start)];
        }
        for (int i = start - 1; i >= 0; --i) {
            b[i] = a[2 * (start - i) - 1];
        }
    }
    else {
        for (int i = start + 1; i < n; ++i) {
            b[i] = a[2 * (i - start) - 1];
            
        }
        for (int i = start - 1; i >= 0; --i) {
             b[i] = a[2 * (start - i)];           
        }
    }

    for (int i = 0; i < n; ++i) {
        cout << b[i] << " ";        
    }

    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;

bool dp[100][100][60000];
lint a[100][100], b[100][100], field[100][100];

int main() {
    lint h, w;
    cin >> h >> w;

    for(lint i=0; i<h; i++)
    for(lint j=0; j<w; j++)
        cin >> a[i][j];

    for(lint i=0; i<h; i++)
    for(lint j=0; j<w; j++)
        cin >> b[i][j];

    for(lint i=0; i<h; i++)
    for(lint j=0; j<w; j++)
        field[i][j] = abs(a[i][j] - b[i][j]);


    dp[0][0][field[0][0]] = true;
    for(lint i=0; i<h; i++)
    for(lint j=0; j<w; j++)
    for(lint s=0; s<60000; s++) {
        dp[i+1][j][s + field[i+1][j]] |= dp[i][j][s];
        dp[i+1][j][abs(s - field[i+1][j])] |= dp[i][j][s];
        dp[i][j+1][s + field[i][j+1]] |= dp[i][j][s];
        dp[i][j+1][abs(s - field[i][j+1])] |= dp[i][j][s];
    }

    lint ans = 1e18;
    for(lint s=0; s<60000; s++) {
        if(dp[h-1][w-1][s])  ans = min(ans, s);
    }
    cout << ans << endl;
}

Measured memory_bytes: 475264
N, M = map(int, input().split())
p_list=[1 for _ in range(N)]
e_list = list(map(int, input().split()))

for _ in range(M):
  a,b = map(int, input().split())
  if e_list[a-1] <= e_list[b-1]:
    p_list[a-1]=0
  if e_list[b-1] <= e_list[a-1]:
    p_list[b-1] = 0
print(sum(p_list))


Measured memory_bytes: 20892
import java.util.*;

public class Main {
  	static Scanner scanner = new Scanner(System.in);

	public static void main(String[] args) {
      	int a = scanner.nextInt();
      	int b = scanner.nextInt();
      	int c = scanner.nextInt();
    	System.out.println(a < c && c < b || b < c && c < a ? "Yes" : "No");
    }
}

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

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

using namespace std;

using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int m = (int)1e9, ans = 0;
  while (n--) {
    int p;
    cin >> p;
    if (p <= m) ans++;
    m = min(m, p);
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 3660
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) {
    
    new Main().run();
  }

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      String op;
      String[] words;
      Tree tree = new Tree();

      for(int i=0,k=0; i<n; i++,k=0){
        words = br.readLine().split(" ");
        op  = words[k++];
        if ( op.equals("insert") ) { 
          tree.insert(Integer.parseInt(words[k++]));
        }
        else {
          tree.dispRoundPath();
        }
      }

    }
    catch(IOException e) {
      System.out.println("IOException!");
    }
  }
}

class Tree {

  static final BTreeNode NIL = new BTreeNode(-1);
  BTreeNode root;
  StringBuilder buf;

  public Tree() {
    root = NIL;
    buf = new StringBuilder();
  }

  public void insert(int val) {
    BTreeNode y = NIL;
    BTreeNode x = root;
    BTreeNode z = new BTreeNode(val);

    while( !x.equals(NIL) ) {
      y = x;
      if( z.key < x.key )
        x = x.left;
      else
        x = x.right;
    }
    z.parent = y;

    if( y.equals(NIL) ){
      root = z;
    }
    else if( z.key < y.key )
      y.left = z;
    else
      y.right = z;
  } 
  void preParse(BTreeNode u) {
    if( !u.equals(NIL) ) {
      buf.append(" ").append(u.key);
      preParse(u.left);
      preParse(u.right);
    }
  }
  void inParse(BTreeNode u) {
    if( !u.equals(NIL) ) {
      inParse(u.left);
      buf.append(" ").append(u.key);
      inParse(u.right);
    }
  }

  void dispRoundPath() {

    inParse(root);
    buf.append("\n");
    preParse(root);
    buf.append("\n");

    System.out.print(buf);
    buf.setLength(0);
  }
}

class BTreeNode {
  final int key;
  BTreeNode parent,left,right;

  public BTreeNode(final int key) {
    this.key = key;
    this.parent =
    this.left =
    this.right = Tree.NIL;
  }

  @Override
  public boolean equals(Object o) {
    if(o == this) return true;
    if(o == null) return false;
    if(!(o instanceof BTreeNode)) return false;

    BTreeNode node = (BTreeNode)o;
    if(!(this.key == node.key)) return false;

    return true;
  }
}


Measured memory_bytes: 125688
import java.util.*;

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

    int count = 0;

    boolean flg = true;

    while(flg) {
      count += k;

      if(a <= count && count <= b) {
        flg = true;
        break;
      }

      if(count > b) {
        flg = false;
        break;
      }
    }

    if(flg) {
      System.out.println("OK");
    } else {
      System.out.println("NG");
    }

    sc.close();
  }
}

Measured memory_bytes: 35608
#include<iostream>
#include<algorithm>
using namespace std;
int main(void)
{
  int n,a[100],i,j,k;
  cin>>n;
  for(i=0;i<n;i++){cin>>a[i];}
  sort(a,a+n);
  int ans;
  ans=a[n-1]-a[0];
  cout<<ans;
  return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define EB emplace_back
#define MP make_pair
#define all(o) (o).begin(), (o).end()
#define mset(m,v) memset(m,v,sizeof(m))
#define fr(i,n) for(lli i=0;i<n;++i)
#define rep(i,a,b) for(lli i=a;i<=b;++i)
#define per(i,a,b) for(lli i=a;i>=b;i--)
#define remin(a,b) (a=min((a),(b)))
#define remax(a,b) (a=max((a),(b))) 
#define sz(x) (lli)(x).size()
#define endl '\n'
typedef long long lli;        typedef long double ld;
typedef pair<lli,lli> ii;     typedef vector<lli> vi;
typedef vector<ii> vii;       typedef vector<vi> graph;
long long MOD=1000000007;     long double EPS=1e-9;
#define debarr(a,n) cout<<#a<<" : ";for(int i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define debmat(mat,row,col) cout<<#mat<<" :\n";for(int i=0;i<row;i++) {for(int j=0;j<col;j++) cerr<<mat[i][j]<<" ";cerr<<endl;}
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const unordered_set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const unordered_map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const multiset<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ","; dbs(str.substr(idx + 1), s...);}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
lli binpow(lli b,lli p,lli mod){lli ans=1;b%=mod;for(;p;p>>=1){if(p&1)ans=ans*b%mod;b=b*b%mod;}return ans;}

void pre(){

}

void solve(){
	lli n;
	cin>>n;
	lli arr[n+1];
	fr(i,n)cin>>arr[i];
	lli dp[n+1];
	fr(i,n+1)dp[i]=MOD*MOD;
	dp[0]=0;
	rep(i,0,n-1){
		remin(dp[i+1],dp[i]+abs(arr[i]-arr[i+1]));
		remin(dp[i+2],dp[i]+abs(arr[i]-arr[i+2]));
	}
	cout<<dp[n-1]<<endl;
}

signed main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//freopen("in.txt","r",stdin);//freopen("out.txt","w",stdout);
	pre();lli t=1;//cin>>t;
	for(lli i=1;i<=t;i++){
		//cout<<"Case #"<<i<<": ";
		solve();
	}
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int mod = 1e9 + 7;

int main() {
    ll X;
    cin >> X;
    
    map<int,ll> m;
    int mx = 1000;
    int A, B;

    //1~mxまで5乗を事前に計算
    for(int i = 0; i <= mx; ++i){
        m.insert(make_pair(i, pow(i,5)));
    }

    //差分で探索
    for(int i = 0; i <= mx; ++i){
        for(int j = 0; j <= mx; ++j){
            if(X == m[i] - m[j]){
                A = i; B = j;
                break;
            }else if(X == m[i] + m[j]){
                A = i; B = -j;
                break;
            }
        }
    }
    
    cout << A << " " << B << endl;
}

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

int main()
{
	double a, b, c, d, e, f;
	double x, y;

	while (cin >> a >> b >> c >> d >> e >> f){
		y = (d * c - a * f) / (d * b - a * e);
		x = (c - b * y) / a;
		printf("%.3f %.3f\n", x, y);
	}

	return (0);
}

Measured memory_bytes: 1236
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    syorui = list(map(int, input().split()))

    even_nums = list(filter(lambda x: x % 2 == 0, syorui))
    result_list = list(filter(lambda x: x % 3 == 0 or x % 5 == 0, even_nums))

    result = "DENIED"
    if len(even_nums) == len(result_list):
        result = "APPROVED"

    return result


if __name__ == '__main__':
    print(main())


Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include <algorithm>
#include<cmath>
#include <iomanip>
#define _USE_MATH_DEFINES
using namespace std;
int main() {
	int n, k,h=1;
	double ans=0;
	cin >> n >> k;
	std::cout << std::fixed;
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= 17; j++) {
			if (h*i >= k) {
				break;
			}
			h *= 2;
		}
		ans += 1 / (double)(n*h);
		h = 1;
	}
	cout << std::setprecision(9) << ans << endl;

}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
 int x,a,b;
  scanf("%d %d %d", &x,&a,&b);
  x=(x-a);
    do{
      x=x-b;
    }while(x>=0);
  if(x<0)
  x=x+b;
    printf("%d",x);
  return 0;
}

Measured memory_bytes: 128
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[] h = new int[N];
        for(int i = 0; i < N; i++){
            h[i] = sc.nextInt();
        }

        int count = 0;
        for(int i = 0; i < N; i++){
            if(h[i] >= K) count++;
        }

        System.out.println(count);
    }
}

Measured memory_bytes: 49272
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<int,int> ii;
typedef pair<ii,int> iii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
#define eb emplace_back
#ifdef cold66
#define debug(...) do{\
    fprintf(stderr,"LINE %d: (%s) = ",__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<", ";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // cold66
//}
template<class T> inline bool chkmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool chkmin(T &a, const T &b) { return b < a ? a = b, true : false; }

const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=0x3f3f3f3f;

ll d[MAXn],dif[MAXn],a[MAXn],id[MAXn];
vector<ll> e[MAXn];
vector<ll> cycle[MAXn];
ll ans[MAXn];
bool vis[MAXn];
void dfs(int x,int cnt){
    vis[x] = true;
    cycle[cnt].eb(x);
    for (auto i:e[x]) {
        if (!vis[i]) dfs(i,cnt);
    }
}
int main(){
    IOS();
    ll n;
    cin >> n;
    for (int i=0;i<n;++i) {
        cin >> d[i];
    }
    ll m,k;
    cin >> m >> k;
    for (int i=0;i<m;++i) {
        cin >> a[i];
        a[i]--;
    }
    for (int i=0;i<n-1;++i) {
        dif[i] = d[i+1] - d[i];
        id[i] = i;
    }

    for (int i=0;i<m;++i) {
        swap(id[a[i]],id[a[i]-1]);
    }
    for (int i=0;i<n-1;++i) {
        e[i].eb(id[i]);
    }
    int cnt = 0;
    for (int i=0;i<n-1;++i) {
        if (!vis[i]) dfs(i,cnt++);
    }
    for (int i=0;i<cnt;++i) {
        ll sz = SZ(cycle[i]);
        ll curk = k % sz;
        debug(cycle[i],curk);
        for (int j=0;j<sz;++j) {
            ll cur = cycle[i][j];
            ans[cur] = cycle[i][(j+curk)%sz];
        }
    }
    cout << d[0] << endl;;
    for (int i=1;i<n-1;++i) {
        d[i] = d[i-1] + dif[ans[i-1]];
        cout << d[i] << endl;
    }
    cout << d[n-1] << endl;
}


Measured memory_bytes: 22152
C1 = list(map(int,input().split()))
C2 = list(map(int,input().split()))
C3 = list(map(int, input().split()))

if C1[1] - C1[0] == C2[1] - C2[0] == C3[1] - C3[0] and C1[2] - C1[1] == C2[2] - C2[1] == C3[2] - C3[1] :
  if C2[0] - C1[0] == C2[1] - C1[1] == C2[2] - C1[2] and C3[0] - C2[0] == C3[1] - C2[1] == C3[2] - C2[2]:
    print("Yes")
  else:
    print("No")
  
else:
  print("No")

Measured memory_bytes: 3064
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

constexpr ll infl = 1000000000000000007LL;
constexpr int inf = 1000000007;

int main() {
    ll n; cin >> n;
    if (n % 2 == 1) cout << 0 << endl;
    else {
        ll two = 0, five = 0;
        ll t = n;
        while (t > 0) {
            two += t / 2;
            t /= 2;
        }
        t = n / 2;
        while (t > 0) {
            five += t / 5;
            t /= 5;
        }
        cout << min(two, five) << endl;
    }
    return 0;
}

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

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)

using namespace std;


/*long C(long n, long r){
    if(n < r) return 0;
    long p[n+1][n+1];
    p[0][0] = 1;
    for(int i = 1; i <= n; i++){
        p[i][0] = 1;
        p[i][i] = 1;
        for(int j = 1; j <= i-1; j++){
            p[i][j] = p[i-1][j] + p[i-1][j-1];
        }
    }
    return p[n][r];
}*/

/*long long gcd(long long a, long long b){
    if(a < b) swap(a, b);
    if(a % b == 0) {
        return b;
    }
    else{
        return gcd(b, a % b);
    }
}*/

/*long long lcm(long long a, long long b){
    return (max(a, b) / gcd(a, b)) * min(a, b);
}*/
 

void solve() {
    int x, a, b;
    cin >> x >> a >> b;
    if(abs(x - a) <= abs(x - b)){
        cout << "A" << endl;
    }
    else{
        cout << "B" << endl;
    }
}
 
int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
import java.io.*;
class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String input[] = ((br.readLine()).trim()).split("\\s+");
    int a = Integer.parseInt(input[0]);
    int b = Integer.parseInt(input[1]);
    if(a >= 1 && a <= 9 && b >= 1 && b <= 9) {
      System.out.println(a * b);
    }
    else {
      System.out.println(-1);
    }
  }
}

Measured memory_bytes: 22612