akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

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

using ll = long long;
using Graph = vector<vector<int>>;

vector<int> dp;
vector<bool> memo;

int f(Graph &g, int x) {
  int s = g.at(x).size();
  for(int i = 0; i < s; i++) {
    if(memo[g.at(x).at(i)]) {
      chmax(dp[x], dp[g.at(x).at(i)]+1);
    }
    else {
      chmax(dp[x], f(g, g.at(x).at(i))+1);
    }
  }
  memo[x] = true;
  return dp[x];
}

int main() {
  int N, M;
  cin >> N >> M;
  dp.assign(N+1,0);
  memo.assign(N+1,false);
  Graph g(N+1);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    g.at(a).push_back(b);
  }
  int ans = 0;
  for (int i = 1; i <= N; i++) {
    chmax(ans,f(g,i));
  }
  cout << ans << endl;
}

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

int main()
{
  int a, b;
  cin >> a >> b;
  for (int i = 1; i <= 1000; i++) {
    if (int(i * 0.08) == a and int(i * 0.1) == b) {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}


Measured memory_bytes: 256
/* Generated by powerful Codeforces Tool
 * You can download the binary file in here https://github.com/xalanq/cf-tool (win, osx, linux)
 * Author: step_by_step
 * Time: 2020-03-19 17:35:03
**/

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
  
#include <iostream>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <assert.h>
#include <memory.h>
#include <time.h>
#include <bitset>

#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define repb(i, r, l) for (int i = (r); i > (l); i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
#define rank qwertyuio
#define next dfghjk
#define prev fhsgfhjf
#define plus fsghsf
#define minus ytryr
  
using namespace std;
  
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(ll &x, ll y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(ll &x, ll y) { return (y > x) ? x = y, 1 : 0; }
  
const int N = 10;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
//const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const int MOD = 998244353;
const ld eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    cout << fixed;
    //ll TL = 10.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    string s;
    cin >> s;
    string t = s;
    reverse(t.begin(), t.end());
    string s1 = s.substr(0, sz(s) / 2);
    string t1 = s1;
    reverse(t1.begin(), t1.end());
    if (s == t && s1 == t1) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define lb lower_bound
#define ub upper_bound

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

//head
int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
    ll x;
    cin >> x;
    cout << (ll)ceil((-1+sqrt(1+8*x))/2.0);
    cout << endl;
	return 0;
}


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

using namespace std;

#define MAXN 300001

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

	int n, west[MAXN]={}, east[MAXN] = {};
	cin >> n;
	string s;
	cin >> s;

	int cur = 0;
	for (int i=0; i<n; ++i) {
		west[i] = cur;
		if (s[i] == 'W') west[i] = cur++;
	}
	cur = 0;
	for (int i=n-1; i>=0; --i) {
		east[i] = cur;
		if (s[i] == 'E') east[i] = cur++;
	}

	int ans = n;

	for (int i=0; i<n; ++i) {
		ans = min(ans, east[i]+west[i]);
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  int x, y, z;
  cin >> x >> y >> z;

  swap(x, y);
  swap(x, z);
  cout << x << " " << y << " " << z << ln;

  return 0;
}

Measured memory_bytes: 256
/*
 *Author - Bhanu Pratap
 */
#include <bits/stdc++.h>
#define endl '\n'
#define F first
#define S second
#define all(c) c.begin(), c.end()
 
using namespace std;
 
typedef long long int ll;
typedef long double ld;
 
const ll mod = 1e9 + 7;
const ld PI = 3.141592653589793;
const ll MAXN=2e5+10;

vector <ll> v[MAXN],cnt(MAXN,0),ans(MAXN,0);
vector <bool> x(MAXN,true);
void dfs(ll src,ll to_add) {
	ans[src]+=to_add;
	x[src]=false;
	for (int i=0; i<v[src].size(); i++) {
		if (x[v[src][i]]) dfs(v[src][i],to_add+cnt[v[src][i]]);
	}
}

void solve () {
	ll n,q;
	cin>>n>>q;
	for (int i=0; i<n-1; i++) {
		ll a,b;
		cin>>a>>b;
		a--; b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	while (q--) {
		ll a,b;
		cin>>a>>b;
		a--;
		cnt[a]+=b;
	}
	dfs(0,cnt[0]);
	for (int i=0; i<n; i++) cout<<ans[i]<<' ';
}
main(){
    ios_base::sync_with_stdio(false); cin.tie(0);
    
    solve();
    return 0;
    }

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

long long N;
long long x[105];
long long y[105];
long long h[105];

bool check(long long cx, long long cy, long long ch){
	for(long long i = 0; i < N; i++){
		long long pointh = max(ch - abs(x[i] - cx) - abs(y[i] - cy), (long long)0);
		if(h[i] != pointh){
			return false;
		}
	}
	return true;
}

int main(){
	cin >> N;
	long long maxh = 0;
	for(long long i = 0; i < N; i++){
		cin >> x[i] >> y[i] >> h[i];
		maxh = max(maxh, h[i]);
	}

	for(long long cx = 0; cx <= 100; cx++){
		for(long long cy = 0; cy <= 100; cy++){
			for(long long ch = maxh; ch <= maxh + 200; ch++) {
				if(check(cx,cy,ch)){
					cout <<  cx << " " << cy << " " << ch << endl;
					return 0;
				}
			}
		}
	}
}

Measured memory_bytes: 256
use std::io::*;

fn read<T: std::str::FromStr>() -> T {
    let stdin = stdin();
    let mut buf = String::new();
	stdin.lock().read_line(&mut buf);
	buf.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
	read::<String>().trim().split_whitespace()
        .map(|w| w.parse().ok().unwrap()).collect()
}

fn main() {
    let v = read_vec::<usize>();
    let (n,m) = (v[0],v[1]);
    let ans = (100 * (n-m) + 1900 * m) << m;
    println!("{}",ans);
}


Measured memory_bytes: 4352
#include <iostream>
#define fast ios_base::sync_with_stdio(NULL);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	fast
	int t;
	cin>>t;
	if(t==1)
	{
		cout<<"1"<<endl;
	}
	else if(t==2)
	{
		cout<<"8"<<endl;
	}
	else if(t==3)
	{
		cout<<"27"<<endl;
	}
	else if(t==4)
	{
		cout<<"64"<<endl;
	}
	else if(t==5)
	{
		cout<<"125"<<endl;
	}
	else if(t==6)
	{
		cout<<"216"<<endl;
	}
	else if(t==7)
	{
		cout<<49*7<<endl;
	}
	else if(t==8)
	{
		cout<<64*8<<endl;
	}
	else if(t==9)
	{
		cout<<81*9<<endl;
	}
	
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define PP pair<P,int>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define mod (int)(1000000007)
#define pie 3.141592653589793238462643383279
#define Bpri priority_queue
#define Spri priority_queue<P,vector<P>,greater<P>>
using namespace std;
int dp[100010],x[100000];
bool bo[100000];
signed main(){
	int n,m;
	cin>>n>>m;
	f(i,m){
		cin>>x[i];
		bo[x[i]]=true;
	}
	dp[0]=1;
    dp[n]=0;
	f(i,n){
		dp[i]%=mod;
		if(!bo[i]){
			dp[i+2]+=dp[i];
			dp[i+1]+=dp[i];
		}
	}
	cout<<dp[n]%mod<<endl;
}


Measured memory_bytes: 1920
def ABC_111_A():
    n = input()
    n = list(n)

    for i in range(len(n)):
        if n[i] == '1':
            n[i] = '9'
        else:
            n[i] = '1'

    n = ''.join(n)
    print(n)

    

if __name__ == '__main__':

    ABC_111_A()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,s,e) for(int i = s; i < e; i++)
#define test(t) int t; cin >> t; while(t--) 
#define iterate(it,s) for(auto it = s.begin(); it != s.end(); ++it)
#define MOD 1000000007

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef set<int> si;
typedef long long ll;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n,k;
  cin >> n >> k;
  int h[n],m[n];
  rep(i,0,n) {
    cin >> h[i];
  }
  m[0] = 0;
  rep(i,1,n) {
    int c = 2;
    m[i] = m[i-1] + abs(h[i] - h[i-1]);
    for(int j = i-2; c <= k && j >= 0; c++,j--) {
      m[i] = min(m[i],m[j] + abs(h[i] - h[j]));
    }
  }
  cout << m[n-1] << endl;
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<string.h>
#include<vector>
#include<algorithm>
using namespace std;

#define ld long double
#define ll long long int
#define pb push_back
#define mp make_pair
#define f(i,a,b) for(int i=a;i<b;i++)

struct hash_pair{
	template <class T1, class T2>
	size_t operator()(const pair<T1, T2>& p) const{
		auto hash1 = hash<T1>{}(p.first);
		auto hash2 = hash<T2>{}(p.second);
		return hash1 ^ hash2;
	}
};

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

	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif

	int n,a;
	cin>>n;
	bool check = true;
	for(int i=0;i<n;i++){
		cin>>a;
		if(a%3 != 0 && a%5 != 0 && a%2 == 0) check = false;
	}
	check ? cout<<"APPROVED" : cout<<"DENIED";

	return 0;
}


Measured memory_bytes: 256
K = gets.chomp.to_i
A, B = gets.chomp.split(" ").map(&:to_i)

d1, m1 = A.divmod(K)
d2, m2 = B.divmod(K)

if m1.zero? || m2.zero? || d1 < d2
  puts "OK"
else
  puts "NG"
end


Measured memory_bytes: 14292
#include <stdio.h>

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

Measured memory_bytes: 580
#include <bits/stdc++.h>
using namespace std;
 
#define clr(i, j)     memset(i, j, sizeof(i))
#define pb            push_back
 #define PI acos(-1)
typedef long long     ll;
 
//-*-*-*-*-*-*-*-*-
 
 

 
const int N=2e5+100;
//ll a[200000];
 
 
map<int,int>mr[1200],mc[1200];
#define lop(i,n) for(int i=0;i<n;++i)
//ll n,m,mod;

int dx[4] = {1 , 0 , 0 , -1} ;
int dy[4] = {0 , 1 , -1 , 0} ;
ll vis[70][60];

void finis(){cout<<-1;}
ll aa[1000];
int main()
{  ios::sync_with_stdio(0);
    cin.tie(0);
  
     ll a[1000];ll x,y,n;
     cin>>x>>n; for(int i=0;i<n;i++){cin>>a[i];aa[a[i]]=1;}
     for(int i=0;i<n;i++){cin>>a[i];aa[a[i]]=1;}
       
   for(int i=0;i<=100;i++){
      if(aa[x-i]==0){cout<<x-i;return 0;}else if(aa[x+i]==0){cout<<x+i;return 0;}
   }

      
   
  
 
 
 
 
 
 
}


Measured memory_bytes: 3816
#include <iostream>
using namespace std;
int h,count,sum;
bool flag;
int puz[11][5];
int main(){
	while(1){
		cin >>h;
		if(h==0)break;
		for(int i=0;i<h;i++){
			for(int j=0;j<5;j++){
				cin >>puz[i][j];
			}
		}

		sum=0;
		while(1){
			flag=false;
			count=0;

			for(int i=0;i<h;i++){
				if(puz[i][0]==puz[i][1]&&puz[i][1]==puz[i][2]&&puz[i][0]!=0){
					sum+=puz[i][0]*3;
					if(puz[i][0]==puz[i][3]){
						sum+=puz[i][0];
						if(puz[i][0]==puz[i][4]){
							sum+=puz[i][0];
							puz[i][4]=0;
						}
						puz[i][3]=0;
					}
					puz[i][0]=puz[i][1]=puz[i][2]=0;
					flag=true;
					count++;
				}else if(puz[i][1]==puz[i][2]&&puz[i][2]==puz[i][3]&&puz[i][1]!=0){
					sum+=puz[i][1]*3;
					if(puz[i][1]==puz[i][4]){
						sum+=puz[i][1];
						puz[i][4]=0;
					}
					puz[i][1]=puz[i][2]=puz[i][3]=0;
					flag=true;
					count++;
				}else if(puz[i][2]==puz[i][3]&&puz[i][3]==puz[i][4]&&puz[i][2]!=0){
					sum+=puz[i][2]*3;
					puz[i][2]=puz[i][3]=puz[i][4]=0;
					flag=true;
					count++;
				}
			}

			if(!flag)break;
			for(int k=0;k<count;k++){
				for(int i=h-2;i>=0;i--){
					for(int j=0;j<5;j++){
						if(puz[i+1][j]==0){
							puz[i+1][j]=puz[i][j];
							puz[i][j]=0;
						}
					}
				}
			}

		}
		cout<<sum<<endl;
	}
}

Measured memory_bytes: 3048
#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>;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x%mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	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+(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; }
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const { return pow(mod - 2); }
	mint& operator/=(const mint a) { return *this *= a.inv(); }
	mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
	vector<mint> fact, ifact;
	combination(int n) :fact(n + 1), ifact(n + 1) {
		assert(n < mod);
		fact[0] = 1;
		for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
		ifact[n] = fact[n].inv();
		for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
	}
	mint operator()(int n, int k) {
		if (k < 0 || k > n) return 0;
		return fact[n] * ifact[k] * ifact[n - k];
	}
}c(200005);


//m^n
mint f(int m, int n) {
	if (0 == n) {
		return 1;
	}
	mint x = f(m, n / 2);
	x *= x;
	if (1 == n % 2) {
		x *= (mint)m;
	}
	return x;
}
// nCa
mint choose(int n, int a) {
	mint x = 1;
	mint y = 1;
	for (int m = 0; m < a; ++m) {
		x *= (mint)(n - m);
		y *= (mint)(a - m);
	}
	return x / y;
}
// nPk
mint nPk(int n, int a) {
	mint ret = choose(n, a);
	for (int n = 1; n <= a; ++n) {
		ret *= n;
	}
	return ret;
}


int main() {
	int N;
	cin >> N;
	vector<int>A(N, -1);
	int x = 0;
	int y = 0;
	for (int i = 0; i <= N; ++i) {
		int n;
		cin >> n;
		n--;
		if (-1 == A[n]) {
			A[n] = i;
		}
		else {
			x = min(i, A[n]);
			y = max(A[n], i);
		}
	}
	for (int i = 1; i <= N + 1; ++i) {
		mint ans = c(N + 1, i);
		if ((N + 1 - (y - x + 1)) >= (i - 1)) {
			ans -= c((N + 1 - (y - x + 1)), i - 1);
		}
		cout << ans << endl;
	}
	return 0;
}

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

const int MAXS = 1e5+10;
const int MAXN = 222;
const ll M = 1e9+7;
int n, x;

ll mem[MAXN][MAXS], s[MAXN];

ll dp(int tot, int x) { // total number chosen nodes , last x
  ll & ans = mem[tot][x];
  if (ans!=-1) return ans;
  if (tot==n) return x;
  ans = 0;
  int i;
  for(i=0;s[i]<=x && i<n;i++) {
    ans = (ans+dp(tot+1, x%s[i]))%M;
  }
  if (n-i>tot) {
    ans = (ans+(n-i-tot)*dp(tot+1,x))%M;
  }
  return ans;
}

int main(){
  cin.tie(0); ios_base::sync_with_stdio(0);
  cin >> n >> x;
  memset(mem,-1, sizeof mem);
  for(int i=0;i<n;i++) cin >> s[i];
  sort(s, s+n);
  cout << dp(0, x) <<endl;
}


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

long conb(long n) { return n * (n - 1) / 2; }

int main() {
  long n;
  cin >> n;
  vector<long> a(n);
  map<int, long> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  long tot = 0;
  for (auto mm : m) {
    tot += conb(mm.second);
  }
  for (int i = 0; i < n; i++) {
    auto nn = m[a[i]];
    auto ans = tot - conb(nn) + conb(nn - 1);
    cout << ans << endl;
  }
}


Measured memory_bytes: 11008
A, B, K = map(int, input().split())

# A, B, K = [8, 12, 2]
# A, B, K = [100, 50, 4]
# A, B, K = [1, 1, 1]

ans = []

for i in range(min(A, B)+1, 0, -1):
    if (A % i == 0) and (B % i == 0):
        ans.append(i)
        if len(ans) == K:
            break

# print(ans)
print(ans[K-1])


Measured memory_bytes: 2940
import java.util.Scanner;

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

    private static void bubbleSort(int[] a, int n) {
        int sum = 0;
        boolean flag = true;
        while (flag) {
            flag = false;
            for (int i = n - 1; i > 0; i--) {
                if (a[i] < a[i - 1]) {
                    int emp = a[i];
                    a[i] = a[i - 1];
                    a[i - 1] = emp;
                    sum++;
                    flag = true;
                }
            }
        }
        for (int i = 0; i < a.length-1; i++) {
            System.out.print(a[i] + " ");
        }
        System.out.print(a[n-1]+"\n" + sum+"\n");
    }
}



Measured memory_bytes: 26324
n = int(input())
a = list(map(int, input().split()))
l = [i+a[i] for i in range(n)]
r = [i-a[i] for i in range(n)]
lc = {}
rc = {}
for i in range(n):
    lc[l[i]] = 0
    lc[r[i]] = 0
    rc[r[i]] = 0
    rc[l[i]] = 0
for i in range(n):
    lc[l[i]] += 1
    rc[r[i]] += 1
ans = 0
for i in set(lc.keys()):
    ans += rc[i]*lc[i]
print(ans)

Measured memory_bytes: 104852
n=int(input())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
d=[abs(s-t)for s,t in zip(x,y)]
f=lambda n:sum([s**n for s in d])**(1/n)
print(f(1),f(2),f(3),max(d),sep='\n')


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

#define N 100
#define A_IN 100

int main(){
  int i,j,flag,A[N],n,tmp,count=0;

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

  for(i=0;i<n;i++){
    for(j=n-1;j>i;j--){
      if(A[j]<A[j-1]){
	tmp=A[j];
	A[j]=A[j-1];
	A[j-1]=tmp;
	count++;
      }
    }
  }
  for(i=0;i<n;i++){
    if(i==n-1)printf("%d\n%d\n",A[i],count);
    else printf("%d ",A[i]);
  }

  return 0;
}



Measured memory_bytes: 2140
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<list>
#include<string>
#include<algorithm>
#define ll long long

using namespace std;

int main(){
  int N;
  cin >> N;
  ll ans=0;
  for(int i=1;i<N+1;i++){
    if(i % 3 != 0 && i % 5 != 0){
      ans += i;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3164
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

int main (int argc, char const *argv[])
{
    int64_t N, H;
    int64_t max = 0, ans = 0;

    scanf("%"PRId64, &N);
    for (int i = 0; i < N; i++) {
        scanf("%"PRId64, &H);
        if (H >= max) {
            max = H;
            ans++;
        }
    }

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

    return 0;
}


Measured memory_bytes: 128
/*#include <iostream>
using namespace std;

int main(){
	double a[8];
	while(cin >>a[0]>>a[1]>>a[2]>>a[3]>>a[4]>>a[5]>>a[6]>>a[7]){
		if((a[3]-a[1])*(a[7]-a[5])==-1*(a[2]-a[0])*(a[6]-a[4]))cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}*/
#include<iostream>
#include<cmath>
using namespace std;
 
int main(){
    double x1,x2,x3,x4,y1,y2,y3,y4,EPS=1e-12;
    while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4){
        if(fabs(((x2-x1)*(x4-x3))+((y2-y1)*(y4-y3)))<=EPS)cout<<"YES";
        else cout<<"NO";
        cout<<endl;
    }
}

Measured memory_bytes: 3064
#include <bits/stdc++.h>
 
using namespace std;
#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i< (int) n; i++)
 
 
int main () {
    string s, t;

    cin >> s;

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

    cin >> t;

    sort(t.begin(),t.end());
    reverse(t.begin(),t.end());

    if(s<t)cout << "Yes" << endl;
    else cout << "No" << endl;


}

    


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	long n,h,w,ans=0,a,b;scanf("%ld%ld%ld",&n,&h,&w);
	int i;
	for(i=0;i<n;i++){
		scanf("%ld%ld",&a,&b);
		if(h<=a&&w<=b)ans++;
	}
	printf("%ld",ans);
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

/**
 * @author shengboxu
 */

public class Main {
    public static void main(String [] args)
    {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int ans = 111;
        for (int i = N; i < 1000; i++) {
            String[] str = String.valueOf(i).split("");
            if (str[0].equals(str[1]) && str[1].equals(str[2])) {
                ans = i;
                break;
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 22608
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int flag = 0;
	int a[n],y=0;
	for(int i = 0; i<n;i++) cin>>a[i], a[i]--;
	for(int i = 0; i<n; i++)
	{
		flag++;
		y = a[y];
		if(y==1)
			break;
	}
	if(y==1)
		cout<<flag<<endl;
	else
		cout<<-1<<endl;
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef double db;
#define fi first
#define se second
#define pb push_back
#define vi vector<int>
#define SZ(x) (int)(x.size())
#define sci(x) scanf("%d",&(x))
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
ll modpow(ll x,ll n,ll mod){ll res=1;for(;n;n>>=1,x=x*x%mod)if(n&1)res=res*x%mod;return res;}
const db eps=1e-8,PI=acos(-1.0);
const int N=2e3+10,M=1e6+10,INF=0x3f3f3f3f,mod=1e9+7;//998244353
char s[10];
int main(){
	scanf("%s",s+1);
	puts(s[3]==s[4]&&s[5]==s[6]?"Yes":"No");
    return 0;
}

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;

int fac[200001];

#define pow __pow

int pow(int a, int b) {
  if (b == 0) return 1;
  int t = pow(a, b / 2);
  (t *= t) %= MOD;
  if (b % 2) return (t * a) % MOD;
  return t;
}

int inverse_mod(int n) {
  return pow(n, MOD - 2);
}

int cnt(int a, int b) {
  return (fac[a + b - 2] * inverse_mod((fac[a - 1] * fac[b - 1]) % MOD)) % MOD;
}

void solve() {
  fac[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    fac[i] = (fac[i - 1] * i) % MOD;
  }
  int h, w, a, b;
  cin >> h >> w >> a >> b;
  int ans = 0;
  for (int i = 1; i <= w - b; i++) {
    (ans += (cnt(h - a, b + i) * cnt(a, w - b - i + 1)) % MOD) %= MOD;
  }
  cout << ans << '\n';
}

signed main() {
#ifdef _DEBUG
  freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  // ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


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

/* 
 * */
int main() {
    int T, X;
    cin >> T >> X;
    double ans = (double)T / X;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    map <string,bool> cnt;
    string c="";
    c += (char)('z'+1);
    string res[6]={c,c,c,c,c,c};
    string s; int k;
    cin >> s >> k ;
    for (int i=0;i<sz(s);i++){
        string h="";
        for (int j=i;j<sz(s);j++){
            //sort(res.begin(),res.end());
            h += s[j];
            if (h > res[5]) break;
            if (!cnt[h]) {
                for (int k=0;k<6;k++){
                    if (h<res[k]){
                        for (int ii=5;ii>k;ii--)
                          swap(res[ii],res[ii-1]);
                        res[k] = h;
                        break;
                    }
                }
            }
            cnt[h] = true;
        }
    }
    cout << res[k-1] << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Measured memory_bytes: 3648
#include<stdio.h>
#include<string.h>

typedef long long ll;

int main(){
	char x[10005];
	int n;
	scanf("%d",&n);
	getchar();
	scanf("%s",x);
	int len = strlen(x);
	for(int i=0;i<len;i++){
		if(x[i]+n>90)
			x[i]-=26;
		printf("%c",x[i]+n);
	}
}

Measured memory_bytes: 1640
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
 
int main() {
  int N;
  int a[1000000];
  cin >> N;
  std::vector<int> v;
  for(int i = 0; i < N; ++i)
    cin >> a[i];
  
  if(N % 2 == 0){
    for(int i = 0; i < N; ++i){
      if(i % 2 == 0)
        v.push_back(a[i]);
      else 
        v.insert(v.begin(), a[i]);
    }
  }else{
    for(int i = 0; i < N; ++i){
      if(i % 2 == 1)
        v.push_back(a[i]);
      else 
        v.insert(v.begin(), a[i]);
    }
  }
  
  for(int i = 0; i < N; ++i)
    cout << v[i] << ' ';    
}

Measured memory_bytes: 5876
program cut
  implicit none
  integer(8) :: equality
  double precision :: w, h, x, y
  read *, w, h, x, y
  equality = 0
  if (w/2 == x .and. h/2 == y) equality = 1 
  print '(f0.6,a,i0)', w*h/2," ", equality
  stop
end program cut


Measured memory_bytes: 256
h, w, k = map(int, input().split())
c = [
    input().rstrip()
    for _ in range(h)
]

ans = 0
for yb in range(2 ** h):
    for xb in range(2 ** w):
        n = 0
        for y in range(h):
            for x in range(w):
                if yb & (1 << y) != 0 and xb & (1 << x) != 0 and c[y][x] == '#':
                    n += 1
        if n == k:
            ans += 1
print(ans)

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

void sort(int l[], int N)
{
	int i, j, v;
	for (i = 1; i < N; ++i) {
		v = l[i];
		j = i- 1;
		while (j >= 0 && l[j] > v) {
			l[j + 1] = l[j];
			j--;
		}
		l[j + 1] = v;
	}
}

int main()
{
	int N, K, l[50];
	int sum = 0;
	cin >> N >> K;

	for (int i = 0; i < N; i++) cin >> l[i];

	sort(l, N);


	for (int i = N-1; i >= N - K; --i) {
		sum += l[i];
	}
	cout << sum << endl;
    return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<ll, pair<ll, ll> > P3;

const ll MOD = ll(1e9 + 7);
const ll LLINF = LLONG_MAX;
const int IINF = INT_MAX;
const int MAX_N = int(1e5) + 5;
const double EPS = 1e-8;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define ALL(v) ((v).begin(), (v).end())

int main() {
    ll n,k;
    cin >> n >> k;
    ll ans = 0;
    ans += (n/k)*(n/k)*(n/k);
    if(k%2==0){
        ll t = n+k/2;
        ans += (t/k)*(t/k)*(t/k);
    }
    cout << ans << endl;
    return 0;
}


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

int main(void){
    int N, K;
    string S;

    cin >> N >> K;
    cin >> S;

    char bufC = ' ';
    int defHappy = 0;

    for(char C: S){
        if(bufC == C)defHappy++;
        bufC = C;
    }

    cout << min(defHappy + 2 * K, N - 1) << endl;

    return 0;
}

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

int main() {
  int a,b;
  float t;
  cin >> a >> b >> t;
  
  int cnt = 0;
  
  for (int i=1; i<=20; i++){
    if (a*i <= t+0.5){
      cnt += b;
    }
  }
  
  cout << cnt << endl;
}


Measured memory_bytes: 256
// Sasageyo! Sasageyo! Shinzou wo Sasageyo !
// https://goo.gl/IwJzbx

#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int> II;
typedef vector<II> VII;
typedef vector<int> VI;
typedef vector< VI > VVI;

typedef long long int LL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define si(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define sll(n) scanf("%lld",&n)
#define lldout(n) printf("%lld\n",n)

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)

#define endl '\n'

int main()
{
	fast_io;
  int n;
  cin >> n;
  LL sum = 0;
  VI x(n);
  for(int i=0;i<n;i++)
    cin >> x[i], sum += x[i];
  LL csum = 0;
  LL ans = LLONG_MAX;
  for(int i=0;i<n;i++) {
    if(i)ans = min(ans, abs(sum-2*csum));
    csum += x[i];
  }
  cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

ll dp[2003][2003];

int main()
{
    int n, m;
    cin >> n >> m;
    int s[2003], t[2003];
    for(int i = 0; i < n; i++) cin >> s[i];
    for(int i = 0; i < m; i++) cin >> t[i];
    dp[0][0] = 1;
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= m; j++){
            if(i == 0 || j == 0) dp[i][j] = 1;
            else if(s[i - 1] == t[j - 1]) dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
            else dp[i][j] = (dp[i - 1][j] + dp[i][j - 1] + MOD - dp[i - 1][j - 1]) % MOD;
        }
    }
    cout << dp[n][m] << endl;
}


Measured memory_bytes: 34872
#include <iostream>

using namespace std;

int a, b;
int k;

int main(void)
{
	cin >> a >> b >> k;
	if(b-a+1 <= 2*k){
		for(int i = a; i <= b; i++) cout << i << endl;
		return 0;
	}
	for(int i = a; i < a+k; i++) cout << i << endl;
	for(int i = b-k+1; i <= b; i++) cout << i << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<stdio.h>
using namespace std;
long long a,b;
int main()
{
	scanf("%lld%lld",&a,&b);
	if(a>0) 
	{
		printf("Positive\n");
		return 0;
	}
	if(a<0&&b<0&&(b-a+1)%2==1)
	{
		printf("Negative\n");
		return 0;
	}
	if(a<=0&&b>=0)
	{
		printf("Zero\n");
		return 0;
	}
	printf("Positive\n");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}
int main() {
  string N;
  cin>>N;
  if(N[0]==N[1]&&N[1]==N[2]){cout<<"Yes"<<endl;}
  else if(N[1]==N[2]&&N[2]==N[3]){cout<<"Yes"<<endl;}
  else {cout<<"No"<<endl;}
  return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <cstring>


int main()
{
	int a, b, res;
	while(~scanf("%d%d", &a, &b)){
		res = a + b;
		res = std::max(res, a -b);
		res = std::max(res, a * b);
		printf("%d\n", res);
		
	}
	return 0;
}


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

// A utility function that returns maximum of two long long integers 
long long int max(long long int a, long long int b) { return (a > b)? a : b; } 
  
// Returns the maximum value that can be put in a knapsack of capacity W 
long long int knapSack(long long int W, long long int wt[], long long int val[], long long int n) 
{ 
   long long int i, w; 
   long long int K[n+1][W+1]; 
  
   // Build table K[][] in bottom up manner 
   for (i = 0; i <= n; i++) 
   { 
       for (w = 0; w <= W; w++) 
       { 
           if (i==0 || w==0) 
               K[i][w] = 0; 
           else if (wt[i-1] <= w) 
                 K[i][w] = max(val[i-1] + K[i-1][w-wt[i-1]],  K[i-1][w]); 
           else
                 K[i][w] = K[i-1][w]; 
       } 
   } 
  
   return K[n][W]; 
} 
  
int main() 
{ 
    long long int n,W,i;
    cin >> n >> W;
    long long int val[n],wt[n];

    for(i=0;i<n;i++)
    {
        cin >> wt[i];
        cin >> val[i];
    }
    
    // long long int val[] = {60, 100, 120}; 
    // long long int wt[] = {10, 20, 30}; 
    // long long int  W = 50; 
    // long long int n = sizeof(val)/sizeof(val[0]); 
    printf("%lld\n", knapSack(W, wt, val, n)); 
    return 0; 
} 

Measured memory_bytes: 79104
s = input()
num = 0
for bit in range(2**(len(s)-1)):
    before = 0
    for g in range(len(s)-1):
        if bit >> g & 1:
            num += (int(s[before:g+1]))
            before = g+1
    num += int(s[before:])
print(num)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int t = sc.nextInt();
		sc.close();
		if(t >= X) {
			System.out.println(0);
		}else {
			System.out.println(X - t);
		}
	}
}

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

int main(){
  int N;
  vector<long> A;
  cin >> N;
  for(int i=0; i<N; i++){
    long a; cin >> a;
    A.push_back(a);
  }
  vector<long> l(N,0);
  l[0]=A[0];
  for(int i=1; i<N; i++){
    l[i]=l[i-1]+A[i];
  }
  vector<long> r(N,0);
  r[N-1]=A[N-1];
  for(int i=N-2; i>=0; i--){
    r[i]=A[i]+r[i+1];
  }
  long ans=1e18;
  for(int i=0; i<N-1; i++){
    ans = min(ans, abs(l[i]-r[i+1]));
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 5104
//
//  main.cpp
//  AC
//
//  Created by makinofuya on 2019/07/08.
//  Copyright © 2019 makinofuya. All rights reserved.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
typedef long long ll;
using namespace std;
#define mod 1000000007

int main(){
    string s;cin >> s;
    int a_index=0,z_index=0;
    int cnt=0;
    for(char c:s){
        if(c=='A'){
            a_index=cnt;
            break;
        }
        cnt++;
    }
    for(int i=s.length()-1;i>=0;i--){
        if(s[i]=='Z'){
            z_index=i;
            break;
        }
    }
    
    cout << z_index-a_index+1 << endl;
}



Measured memory_bytes: 640
import sys
input = sys.stdin.readline

N, M, Q = map(int, input().split())
A = [[0]*(N+1) for _ in range(N+1)]

for _ in range(M):
    L, R = map(int, input().split())
    L -= 1
    R -= 1
    A[0][R] += 1
    A[0][N] -= 1
    A[L+1][R] -= 1
    A[L+1][N] += 1

for i in range(N+1):
    for j in range(N):
        A[i][j+1] += A[i][j]

for i in range(N):
    for j in range(N+1):
        A[i+1][j] += A[i][j]

for _ in range(Q):
    p, q = map(int, input().split())
    p -= 1
    q -= 1
    print(A[p][q])

Measured memory_bytes: 55260
from collections import deque
K = int( input())
V = [0]*K
d = deque([(1,1)])
while 1:
    w, v = d.popleft()
    if v == 0:
        ans = w
        break
    if V[v] == 1:
        continue
    V[v] = 1
    if V[ (v+1)%K] == 0:
        # if (v+1)%K == 0:
        #     ans = w+1
        #     break
        d.append((w+1 ,(v+1)%K))
    if V[ (v*10)%K] == 0:
        d.appendleft((w, (v*10)%K))
        # if (v*10)%K == 0:
        #     ans = w
        #     break
print(ans)

Measured memory_bytes: 9784
#include <stdio.h>
#pragma warning(disable : 4996)
int n, m, d, ret, a[6], b[6], c[6], e, f, g;
int digit(int x) {
	if (x < 10) return 1;
	return digit(x / 10) + 1;
}
int power(int a, int b) {
	if (b == 0) return 1;
	return power(a, b - 1) * a;
}
int main() {
	while (true) {
		scanf("%d%d", &n, &m);
		if (n == 0 && m == 0) break;
		d = digit(m); g = 0;
		for (int i = 0; i < d; i++) {
			a[i] = (m / power(10, d - i - 1) ) % 10;
		}
		ret = 0;
		for (int i = 0; i < (1 << (d - 1)); i++) {
			e = 0; f = a[0];
			for (int j = 1; j < d; j++) {
				if (i & (1 << (j - 1))) {
					c[e++] = f; f = a[j];
				}
				else {
					f = f * 10 + a[j];
				}
			}
			c[e++] = f;
			int sum = 0;
			for (int j = 0; j < e; j++) {
				sum += c[j];
			}
			if (g <= sum && sum <= n) {
				if (g < sum) ret = 1;
				else ret++;
				g = sum;
				for (int j = 0; j < 6; j++) {
					if (j >= e) {
						b[j] = -1;
					}
					else {
						b[j] = c[j];
					}
				}
			}
		}
		if (ret == 0) {
			printf("error\n");
		}
		else if (ret >= 2) {
			printf("rejected\n");
		}
		else {
			printf("%d", g);
			for (int i = 0; i < 6; i++) {
				if (b[i] != -1) {
					printf(" %d", b[i]);
				}
			}
			printf("\n");
		}
	}
	return 0;
}

Measured memory_bytes: 2724
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int K = scan.nextInt();
		int cnt = 0;
		int ans = 1;
		
		for (int i = 100; i > 0; i--) {
			if (cnt < K) {
				if (A % i == 0 && B % i == 0) {
					cnt += 1;
					ans = i;
					//System.out.println("cnt" + cnt);
					//System.out.println("ans" + ans);
				}else {
					//System.out.println("no");
				}
			}else {
				break;
			}
		}
		System.out.println(ans);
	}
}

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


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


int main() {
    ll N,M;
    cin >>N>>M;
    vector<ll> X(M);

    rep(i,M){
        cin>>X[i];
    } 

    sort(all(X));
    ll ans = X[M-1]-X[0];
    vector<ll> d(M-1);
    rep(i,M-1){
        d[i] = X[i+1]-X[i];
    }
    sort(all(d));
    reverse(all(d));

    rep(i,N-1){
        if(i==M-1)break;
        ans-=d[i];
    }
    cout << ans << endl;


    return 0;
    

}

Measured memory_bytes: 4812
#include<iostream>
#include<vector>
#include<algorithm>
#include<stdio.h>

using namespace std;

int main(){
	int n,ans;
	cin >> n;
	int a[100];
	//vector <int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}

	//sort(a.begin(),a.end());

	for (int j =  n-1; j >= 0; j--){
		cout << a[j];
		if(j!=0){
		    cout<<" ";
		}
		


	}
	
	cout<<endl;


}


Measured memory_bytes: 3108
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long LL;

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

Measured memory_bytes: 256
a, b, c = map(int, input().split())
k = int(input())

if a >= b:
    x = a // b
    x_ = len(bin(x)) - 2
else:
    x_ = 0

b *= 2 ** x_

if b >= c:
    y = b // c
    y_ = len(bin(y)) -2
else:
    y_ = 0

if (x_ + y_) <= k:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9188
N,K=map(x->parse(Int,x),split(readline()))
A=Array{Int}(0)
now=0
nc=0
for c=chomp(readline())
	c=parse(Int,c)
	if now==c
		nc+=1
	else
		push!(A,nc)
		now=c
		nc=1
	end
end
push!(A,nc)
ans=0
now=0
for i=1:length(A)
	now+=A[i]
	if i-2K>=1
		now-=A[i-2K]
	end
	ans=max(ans,now+(i%2==0&&i-2K>=1 ? A[i-2K] : 0))
end
println(ans)


Measured memory_bytes: 136844
n = int(input())
h = list(map(int,input().split()))
ans = "Yes"
if n == 1:
    print(ans)
else:
    if h[0] == h[1]:
        h[0] -= 1
    
    for i in range(1,n):
        if h[i] > h[i-1]:
            h[i] -= 1
        if h[i] < h[i-1]:
            ans = "No"
            break
    print(ans)
    

Measured memory_bytes: 14252
#include <iostream>

using namespace std;

int main()
{
	int a,b, c,i,count;
	bool ret;
	scanf("%d",&count);
	for(i = 0; i < count; i++ ) {
		cin >> a >> b >> c;
		a *= a;
		b *= b;
		c *= c;
		ret = false;
		if( a + b == c ){
			ret = true;
		}
		else if( a + c == b ) {
			ret = true;
		}
		else if ( b + c == a ) {
			ret = true;
		}
		
		if( ret == true ) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}	
	}

	return 0;
}

Measured memory_bytes: 0
//AtCoder 
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;

int main() {
    ll N,Y;
    cin>>N>>Y;
    for(ll a=0;a<=Y/10000;++a){
        for(ll b=0;b<=Y/5000;++b){
            ll c=N-a-b;
            if (c<0)break;;
            ll cy=a*10000+b*5000+c*1000;
            if(cy==Y){
                cout<<a<<" "<<b<<" "<<c<<endl;
                return 0; //終了
            }
        }
    }
    cout<<"-1 -1 -1"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int N=2e5+10;

int n,m;
LL d[N],a[N],sum;

int main() {
	cin>>n;
	for (int i=1;i<=n;i++) scanf("%lld",&a[i]);
	a[0]=0; a[n+1]=0;
	for (int i=0;i<=n;i++) d[i]=abs(a[i+1]-a[i]);
	for (int i=0;i<=n;i++) sum+=d[i];
	for (int i=1;i<=n;i++) {
		LL ans=sum;
		ans-=d[i-1]+d[i];
		ans+=abs(a[i+1]-a[i-1]);
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 2816
def selectionSort(A,N,cnt=0):
    for i in range(N):
        minj = i
        for j in range(i,N):
            if A[j] < A[minj]:
                minj = j
        A[i] , A[minj] = A[minj] , A[i]
        if A[i] != A[minj]:
            cnt += 1
    return A , cnt

N = int(input())
A = list(map(int,input().split()))
X , cnt = selectionSort(A,N)
print(*X)
print(cnt)

Measured memory_bytes: 7784
import copy

n = int(input())
def calc(N):
    n_ = (N - N%10)//10
    c = 1
    s = copy.deepcopy(n_)
    while n_//(5**c) >= 1:
        c +=1
    c -= 1
    for i in range(1,c+1):
        s += n_//5**i
    return s

if n%2 == 1 or n == 0:
    print(0)
else:
    print(calc(n))







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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin>>N;
    vi A(N),B(N),C(N);
    rep(i,N) cin>>A[i];
    rep(i,N) cin>>B[i];
    rep(i,N) cin>>C[i];
    sort(all(A));
    sort(all(B));
    sort(all(C));
    ll ans=0;
    rep(i,N){
        int a = lower_bound(all(A),B[i])-A.begin();
        int c = C.end()-upper_bound(all(C),B[i]);
        ans += (ll)a*c;
    }
    cout<<ans<<"\n";
    return 0;
}


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

using namespace std;
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	bool ok = false;
	for(int  i = 1 ; i < 4;  i++){
		if((a * b * i) & 1)
			ok = true;
	}
	if(ok)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 256
/**
 * @brief AtCoder Beginner Contest 076<br>
 * C - Dubious Document 2
 *
 * @see https://abc076.contest.atcoder.jp/tasks/abc076_c
 */
#include <iostream>
using namespace std;

int main() {
  string S, T;
  cin >> S >> T;

  for (int i{static_cast<int>(S.length() - T.length())}; i >= 0; --i) {
    bool restored{true};
    for (int j{}; j < T.length(); ++j) {
      if (S[i + j] == '?') {
        continue;
      } else if (S[i + j] != T[j]) {
        restored = false;
        break;
      }
    }
    if (restored) {
      size_t j{};
      for (; j < i; ++j) {
        cout << (S[j] != '?' ? S[j] : 'a');
      }
      cout << T;
      j += T.length();
      for (; j < S.length(); ++j) {
        cout << (S[j] != '?' ? S[j] : 'a');
      }
      return 0;
    }
  }

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


Measured memory_bytes: 256
import sys
from math import atan2, pi

n = int(input())
angles = []
engines = []
pi2 = 2 * pi
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    angle = atan2(y, x)
    angles.append((angle, i))  # -pi~pi
    angles.append((angle + pi2, i))  # pi~3pi
    engines.append(x + y * 1j)
angles.sort()

r = 0
tmp = 0
total = sum(engines)
ans = 0
for l in range(n):
    angle, i = angles[l]
    limit = angle + pi
    while angles[r][0] < limit:
        tmp += engines[angles[r][1]]
        r += 1
    ans = max(ans, abs(tmp), abs(total - tmp))
    tmp -= engines[i]
print(ans)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define IN(n) cin>>n
#define OUT(n) cout<<n
#define CAL1(a,b) a*b
#define CAL2(a,b) floor(a/b)
#define CAL3(a,b) a-b
using namespace std;
int n; 
int x,y;
int main(){
	IN(n);
	x=CAL1(n,800);
	y=CAL1(CAL2(n,15),200);
	OUT(CAL3(x,y)),OUT(endl);
	return 0;
}

Measured memory_bytes: 256
y = int(input())
k = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(k[y-1])

Measured memory_bytes: 3060