akhauriyash/Code-Regression huggingface dataset:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0):
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    s = input()
    t = sorted(s)
    if ''.join(t) == 'abc':
        print('Yes')
    else:
        print('No')
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 38636
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://atcoder.jp/contests/abc077/tasks/arc084_a

int main() {
    int N; cin >> N;
    vector<int> A; REP(i, N) {int a; cin >> a; A.push_back(a);};
    REP(i, N) A[i] = -A[i];
    vector<int> B; REP(i, N) {int a; cin >> a; B.push_back(a);};
    vector<int> C; REP(i, N) {int a; cin >> a; C.push_back(a);};

    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());

    ll cnt = 0;
    REP(j, N) {
        int b = B[j];

        auto IterA = upper_bound(A.begin(), A.end(), -b);
        ll cntA = (A.end() - IterA);

        auto IterC = upper_bound(C.begin(), C.end(), b);
        ll cntC = (C.end() - IterC);

        cnt += (cntC*cntA);
    }

    cout << cnt << "\n";

    return 0;
}

Measured memory_bytes: 1784
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]C - Poll
            int N = int.Parse(Console.ReadLine());
 
            var words = new Dictionary<string, int>();
 
            for (int i = 0; i < N; i++)
            {
                var s = Console.ReadLine();
 
                if (words.ContainsKey(s))
                {
                    words[s]++;
                }
                else
                {
                    words.Add(s, 1);
                }
            }
 
            int max = words.Max(x => x.Value);
 
            //var ans = words.Where(x => x.Value == max)
            //               .ToDictionary(x => x.Key, x => x.Value).Keys.ToList();
 
            var ans = new List<string>();
 
            foreach (var w in words)
            {
                if (w.Value == max)
                {
                    ans.Add(w.Key);
                }
            }
 
            ans.Sort(StringComparer.Ordinal);
 
            foreach (var a in ans)
            {
                Console.WriteLine(a);
            }
        }
    }
}

Measured memory_bytes: 40284
let rec gcd n m =
  if m = 0 then n
  else gcd m (n mod m)
  
let () = Scanf.scanf "%d\n" @@ fun n ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  let acc = Array.make (n + 1) 0 in
  let acc' = Array.make (n + 1) 0 in
  for i = 0 to n - 1 do
    acc.(i + 1) <- gcd acc.(i) as_.(i)
  done;
  for i = n - 1 downto 0 do
    acc'.(i) <- gcd acc'.(i + 1) as_.(i)
  done;
  Printf.printf "%d\n" @@
  Array.fold_left max min_int @@
  Array.init n @@ fun i -> gcd acc.(i) acc'.(i + 1)



Measured memory_bytes: 6400
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const long double EPS = 1e-9;

#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<char> &o) {
    string a;
    in >> a;
    for (char c : a) o.insert(c);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<char> &s, char a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;

int main() {
int h1 , m1, h2, m2, k;
cin >> h1>>m1>>h2>>m2>>k;

int start = h1 * 60 + m1;
int end = h2 * 60 + m2;
int diff = end - start;

int ans = diff - k;
cout<<ans<<endl;


}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;

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

        int a;
        vi value;
        int it;
        for(int i = 0; i < n; i++){
                cin >> a;
                if(value.size() == 0){
                        value.push_back(a);
                        continue;
                }
                it = lower_bound(value.begin(), value.end(), a) - value.begin();
                if(it == value.size()){
                        value.push_back(a);
                        continue;
                }
                if(value[it] == a) value.erase(value.begin() + it);
                else value.insert(value.begin() + it, a);
        }

        cout << value.size() << endl;

        return 0;
}

Measured memory_bytes: 892
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 1000;
        for (int i = 0; i + 3 <= s.length(); i++) {
            String sub = s.substring(i, i + 3);
            int num = Integer.parseInt(sub);
            ans = Math.min(ans, Math.abs(753 - num));
        }
        System.out.println(ans);
    }
}

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

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

  for (int i = 0; i < (1 << N) - 1; ++i) {
    for (int j = 0; j < (1 << M) - 1; ++j) {
      int t = 1;
      int k = (i & j);
      while (k & 1) {
        t = 1 - t;
        k = (k >> 1);
      }
      cout << t;
    }
    cout << endl;
  }

  return 0;
}



Measured memory_bytes: 1280
#include <stdio.h>
int main(){
  int H,W;
  int h,w;
  int a;
  int ans;
  int h1,w1;
  
  scanf("%d",&H);
  scanf("%d",&W);
  scanf("%d",&h);
  scanf("%d",&w);
  
  w1 = W-w;
  h1 = H-h;
    
    ans = w1*h1;
  printf("%d",ans);
  return 0;
}

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

#define int long long
#define ff first
#define ss second
int32_t main()
{
    int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    vector<pair<int,int>> aa;
    
    for(int i=0;i<a;i++)
    {
        int t;
        cin>>t;
        aa.push_back({t,1});
    }
    
    for(int i=0;i<b;i++)
    {
        int t;
        cin>>t;
        aa.push_back({t,2});
    }
    
    for(int i=0;i<c;i++)
    {
        int t;
        cin>>t;
        aa.push_back({t,3});
    }
    
    sort(aa.begin(),aa.end(),greater<pair<int,int>>());
  //  cout<<aa[0].ff;
    int i=0;
    int j=0;
    int k=0;
    int q=0;
    
    int ans=0;
    while(j+k+q!=x+y)
    {
        if(aa[i].ss==1)
        {
            if(j<x)
            {
                ans=ans+aa[i].ff;
                j++;
            }
        }
        else if(aa[i].ss==2)
        {
            if(k<y)
            {
                ans=ans+aa[i].ff;
                k++;
            }
        }
        else
        {
            q++;
            ans=ans+aa[i].ff;
        }
       // cout<<j<<" "<<k<<" "<<q<<" "<<x<<" "<<y<<"\n";
        i++;
        
    }
    cout<<ans;
}


Measured memory_bytes: 10476
n=int(input())
ans=0
if n==1 or n==2:
    print(0)
    exit()

for i in range(n):
    if i**2>=n:
        x=i
        break

for i in range(1,x):
    if n%i==0:
        if n//i>i+1:
            ans+=n//i-1

print(ans)

Measured memory_bytes: 40684
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    
    let mut result = String::new();
    for c in buf.chars() {
        if c == 'B' {
            result.pop();
        } else {
            result.push(c);
        }
    }
    
    println!("{}", result);
}

Measured memory_bytes: 4352
#include <stdio.h>

bool isLeapYear(int year)
{
    if (year % 4 == 0) {
        if (year % 100 == 0) {
            if (year % 400 == 0) {
                return true;
            }
            return false;
        }
        return true;
    }
    return false;
}
        

int main(void)
{
    int year, from, until, num_leap_year, flag = 0;
    while (1) {
        num_leap_year = 0;
        scanf("%d %d", &from, &until);
        if (from == 0 && until == 0) {
            break;
        } else {
            if ( flag != 0) {
                printf("\n");
            }
        }
        for (year = from; year <= until; year++) {
            if (isLeapYear(year) == true) {
                num_leap_year++;
                printf("%d\n", year);
            }
        }
        if (num_leap_year == 0) {
            printf("NA\n");
        }
        flag++;
        //printf("\n");
    }
    return 0;
}

Measured memory_bytes: 1044
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,n) for(ll i=1, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
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; }
#define INF 1e9
#define PI (acos(-1))
#define mod (int)1e9+7
#define NMAX 15
ll func(ll a){
    if(a==0)return 0;
    else return 1;
}
int main() {
    ll N;
    cin>>N;
    vector<ll> A(N);
    ll x[NMAX][NMAX],y[NMAX][NMAX];
    REP(i,N){
        cin>>A[i];
        REP(j,A[i]){
            cin>>x[i][j]>>y[i][j];
        }
    }
    bool f;
    ll ans=0,sum;
    REP(i,(1<<N+1)-1){
        f=true,sum=0;
        REP(j,N){
            if(func(i&(1<<j))==1)sum++;
            REP(k,A[j]){
                if(func(i&(1<<j))==1){
                    if(func(i&(1<<(x[j][k]-1)))!=y[j][k]){
                        f=false;
                    }
                }
            }
        }
        if(f)chmax(ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}

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

int main()
{
	int m = 0;
	int d = 0;
	int count = 0;

	cin >> m >> d;

	for (int i = 1; i <= m; i++) {
		for (int j = 1; j <= d; j++) {
			if ((j % 10 >= 2) && (j / 10 >= 2) && ((j % 10) * (j / 10) == i)) {
				count++;
			}
		}
	}
	cout << count;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
string str = "MARCH";
ll march[5];

int main() {
    int n;
    cin >> n;
    string s;
    for (int i = 0; i < n; i++) {
        cin >> s;
        for (int j = 0; j < 5; j++) {
            if (s[0] == str[j]) {
                march[j]++;
                break;
            }
        }
    }
    ll ans = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = i + 1; j < 5; j++) {
            for (int k = j + 1; k < 5; k++) {
                ans += march[i] * march[j] * march[k];
            }
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#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(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;

//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

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

	int x = 0;
	int max = 0;

	REP(i, n){
		if (s[i] == 'I') x++;
		else x--;
		if (x > max) max = x;
	}

	cout << max << endl;
}


Measured memory_bytes: 256
/*{{{*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
using namespace std;
typedef pair<int, int> PP;
typedef long long LL;
#define pb push_back
#define fr first
#define sc second
#define bitcnt __builtin_popcount
#define all(x) x.begin(), x.end()
inline int ri() {int x; scanf("%d", &x); return x;}
#define rep2(i, n, ...) for (int i = 0; i < (n); i ++) 
#define rep3(i, a, b, ...) for (int i = (a); i < (b); i ++)
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define drep2(i, n, ...) for (int i = (n) - 1; i >= 0; i --)
#define drep3(i, a, b) for (int i = (a) - 1; i >= (b); i --)
#define drep(...) GET_MACRO(__VA_ARGS__, drep3, drep2)(__VA_ARGS__)
template<typename T>inline bool smax(T&a, T b){if(a<b){a=b;return true;}return false;} 
template<typename T>inline bool smin(T&a, T b){if(a>b){a=b;return true;}return false;} 
/*}}}*/

int n, l, p[100000];

int main() {
  #ifdef _TEST_
  freopen("input.txt", "r", stdin);
  //freopen("out.txt", "w", stdout);
  #endif
  cin >> n >> l;
  rep(i, n) cin >> p[i];
  rep(i, n - 1) if (p[i] + p[i + 1] >= l) {
    cout << "Possible" << endl;
    rep(j, 1, i + 1) cout << j << endl;
    drep(j, n, i + 2) cout << j << endl;
    cout << i + 1 << endl;
    return 0;
  }
  cout << "Impossible" << endl;
  return 0;
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
#define PI 3.141592653589
#define ll long long
using namespace std;

template<typename T_char>
T_char ToUpper(T_char cX){return toupper(cX);}

int  main(){
  ll h, w;
  cin >> h >> w;
  
  if(h==1 || w==1){
    cout << 1 << endl;
    return 0;
  }
  ll masu = h*w;
  ll res = masu / 2;

  cout << masu - res << endl;
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<queue>
#include<vector>
#define ll long long
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define inf 0x7fffffff
#define mod 998244353
#define eps 1e-20
ll read()
{
    ll tmp=0; char c=getchar(),f=1;
    for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
    for(;'0'<=c&&c<='9';c=getchar())tmp=tmp*10+c-'0';
    return tmp*f;
}
using namespace std;
int a[3][110],f[3][110];
int main()
{
	int i,j,n=read();
	for(i=1;i<=2;i++)
		for(j=1;j<=n;j++)
		a[i][j]=read(),f[i][j]=max(f[i-1][j],f[i][j-1])+a[i][j]; 
	printf("%d\n",f[2][n]);
	return 0; 
} 

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

#ifdef LOCAL
#define debug(var) cerr << #var << " = " << var << endl;
#else
#define debug(var)
#endif

void init() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

void solve() {
	string s; cin >> s;
	s[3] = '8';
	cout << s;
}

int main() {
	init();
	int t = 1; //scanf("%d", &t);
	while (t--) {
		solve();
	}
	return 0;
}


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

def main():
    n, m = map(int, input().split())
    h_list = list(map(int, input().split()))
    arry = [0 for _ in range(n)]
    ans = 0

    for i in range(m):
        a, b = map(int, input().split())
        arry[a-1] = max(arry[a-1], h_list[b-1])   
        arry[b-1] = max(arry[b-1], h_list[a-1])  

    for i in range(n):
        if h_list[i] > arry[i]:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 20128
#include <queue>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <map>
#include <functional>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define MAX(a, b) (((a) < (b)) ? (b) : (a))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))



using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
const ll inf = (1LL << 60);
const ll mod = 1000000007;


ll N, M;

ll indeg[100005], outdeg[100005], par[100005];

vector<pint> indeglist, outdeglist;
vector<ll> inedge[100005], outedge[100005];

int main() {
	ll A, B;
	cin >> N >> M;
	rep(i, N - 1 + M) {
		cin >> A >> B;

		inedge[B].push_back(A);
		outedge[A].push_back(B);
		indeg[B] += 1;
		outdeg[A] += 1;
	}
	
	queue<ll> q;
	ll root = 0;
	rep(i, N) {
		if (indeg[i + 1] == 0) {

			root = i + 1;
		}

		if (outdeg[i + 1] == 0) {
			q.push(i + 1);
		}
	}
	

	ll cur = 0, t = 0;
	while (q.size() != 0) {
		cur = q.front();
		q.pop();



		rep(i, inedge[cur].size()) {
			t = inedge[cur][i];
			outdeg[t]--;
			if (outdeg[t] == 0) {
				q.push(t);
				rep(j, outedge[t].size()) {
					if (par[outedge[t][j]] == 0) par[outedge[t][j]] = t;
				}
			}

		}




	}

	rep(i, N) {

		cout << par[i + 1] << endl;
	} 

	return 0;
}

Measured memory_bytes: 14080
#include<iostream>

using namespace std;

int main(){
	int n;
	cin>>n;
	int a[n];

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

	int max=0;
	int min=1000;

	for(int i=0;i<n;i++){
		if(max<a[i]){
			max=a[i];
		}
	}

	for(int i=0;i<n;i++){
		if(min>a[i]){
			min=a[i];
		}
	}

	cout<<max-min<<endl;
}

Measured memory_bytes: 256
import itertools

N = int(input())
b = [False] * 101
prime = []
b[1] = True

for i in range(2, 101):
    if b[i]:
        continue
    k = i + i
    while k < 101:
        b[k] = True
        k += i

    prime.append(i)

p = [[0] * len(prime) for i in range(N + 1)]

for i in range(1, N + 1):
    n = i
    for j in range(len(prime)):
        while n % prime[j] == 0:
            p[i][j] += 1
            n //= prime[j]

pp = [0] * len(prime)

for i in range(len(prime)):
    for j in range(1, N + 1):
        pp[i] += p[j][i]

ans = 0

for x in pp:
    if x >= 74:
        ans += 1

for a in list(itertools.combinations(range(len(prime)), 2)):
    if pp[a[0]] >= 24 and pp[a[1]] >= 2:
        ans += 1
    if pp[a[0]] >= 2 and pp[a[1]] >= 24:
        ans += 1
    if pp[a[0]] >= 14 and pp[a[1]] >= 4:
        ans += 1
    if pp[a[0]] >= 4 and pp[a[1]] >= 14:
        ans += 1

for a in list(itertools.combinations(range(len(prime)), 3)):
    if pp[a[0]] >= 2 and pp[a[1]] >= 4 and pp[a[2]] >= 4:
        ans += 1
    if pp[a[0]] >= 4 and pp[a[1]] >= 2 and pp[a[2]] >= 4:
        ans += 1
    if pp[a[0]] >= 4 and pp[a[1]] >= 4 and pp[a[2]] >= 2:
        ans += 1

print(ans)

Measured memory_bytes: 3192
#include<iostream>
#include<cstdio>
#include<cmath>
#include<stdio.h>
using namespace std;
int main(){
    int n;
    double sum1 = 0, sum2 = 0, sum3 = 0, max = 0;
    cin >> n;
    double x[n];
    double y[n];
    
    for(int l = 0; l < n; l++){
        x[l] = 0;
        y[l] = 0;
    }
    
    for(int i = 0; i < n; i++){
        double X;
        cin >> X;
        x[i] = X;
    }
    
    for(int j = 0; j < n; j++){
        double Y;
        cin >> Y;
        y[j] = Y;
    }
    
    for(int k = 0; k < n; k++){
        //p=1
        sum1 += fabs(x[k] - y[k]);
        sum2 += pow(fabs(x[k] - y[k]), 2);
        sum3 += pow(fabs(x[k] - y[k]), 3);
        
        if(fabs(x[k] - y[k]) > max){
            max = fabs(x[k] - y[k]);
        }
    }
    
    double ans2 = sqrt(sum2);
    double ans3 = pow(sum3, 0.3333333333333333333);
    
    printf("%.6f\n%.6f\n%.6f\n%.6f\n", sum1, ans2, ans3, max);
    
    return 0;
}


Measured memory_bytes: 3384
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <vector>
#include <numeric>
#include <bits/stdc++.h>
#include <atcoder/all>

#define int long long

struct edge {
    int to;
    int cost;
};

using namespace std;
using namespace atcoder;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vb = vector<bool>;
using qi = queue<int>;
using P = pair<int, int>;
using graph = vector<vector<edge>>;
// using graph = vector<vector<int>>;
using mint = modint1000000007;


#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define REP(i,n) for(int i=0;i<n;i++)
#define delim(i, n) cout << (i == n-1 ? "\n" : " ")
#define print1(v) cout << fixed << setprecision(10) << v << "\n"
#define print2(v1, v2) cout << fixed << setprecision(10) << v1 << " " << v2 << "\n"
#define printvi(v, n) REP(iiii, n) { cout << v[iiii]; delim(iiii, n); }
#define printvii(v, h, w) REP(iiiii, h) { printvi(v[iiiii], w); }

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int inf = 1LL << 60;
// const int inf = 100000000;
const int mod = 1000000007;

const int maxn = 2e5+1;
int n, m, k;

vi dx = {-1, 0, 0, 1};
vi dy = {0, -1, 1, 0};

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

    cin >> n;
    REP(i, n) {
        cout << "ACL";
    }
    cout << "\n";
}

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

int main()
{
    int str[905];
    int i,j,k,shu=1;
    str[shu]=10001;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=20002;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=30003;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=40004;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=50005;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=60006;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=70007;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=80008;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    str[shu]=90009;
    for(j=1; j<=10; j++)
    {
        for(k=1; k<=9; k++)
        {
            shu++;
            str[shu]=str[shu-1]+100;
        }
        shu++;
        str[shu]=str[shu-1]-900+1000+10;
    }
    int a,b;
    while(scanf("%d %d",&a,&b)!=EOF)
    {
        for(i=1; i<901; i++)
            if(str[i]>=a)break;
        for(j=900;j>=1;j--)
            if(str[j]<=b)break;
        printf("%d\n",j-i+1);
    }


    return 0;
}

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

int main()
{
    int H, W;
    cin >> H >> W;
    string a[H];
    bool row[H] = {};
    bool column[W] = {};

    for (int i = 0; i < H; i++)
    {
        cin >> a[i];
        for (int j = 0; j < W; j++)
        {
            if (a[i][j] == '#')
            {
                row[i] = true;
                column[j] = true;
            }
        }
    }

    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            if (row[i] && column[j])
            {
                cout << a[i][j];
            }
        }
        if (row[i])
        {
            cout << endl;
        }
    }
}


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

int main()
{
   int k,x;
   scanf("%d %d",&k,&x);
   int p=x-k+1;
   int q=x+k-1;
   int i=0;
   for(i=p;i<=q;i++)
   {
       printf("%d ",i);
   }

return 0;

}




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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

constexpr int64 P = 1000000007;

struct FiniteField {
 private:
  int64 x;
  static inline int64 Normalize(int64 x) {
    if (0 <= x && x < P) return x; x %= P; if (x < 0) x += P; return x;
  }
 public:
  FiniteField(int64 x) : x(Normalize(x)) {}
  FiniteField() : x(0) {}
  int64 Value() const { return x; }
  inline FiniteField operator+(FiniteField o) const {
    FiniteField r(*this); r += o; return r;
  }
  inline FiniteField operator-(FiniteField o) const {
    FiniteField r(*this); r -= o; return r;
  }
  inline FiniteField operator* (FiniteField o) const {
    FiniteField r(*this); r *= o; return r;
  }
  inline FiniteField operator/ (FiniteField o) const {
    FiniteField r(*this); r /= o; return r;
  }
  inline void operator+= (FiniteField o) { x = (x + o.x) % P; }
  inline void operator-= (FiniteField o) { x = (x + P - o.x) % P; }
  inline void operator*= (FiniteField o) { x = (x * o.x) % P; }
  void operator/=(FiniteField o) {
    int64 p = P - 2; while (p) { if (p % 2) { *this *= o; } o *= o; p /= 2; }
  }
};

ostream& operator<<(ostream& s, const FiniteField& v) { s << v.Value(); return s; }

tuple<vector<FiniteField>, vector<FiniteField>> MakeFactorialTables(int n) {
  vector<FiniteField> factorials(n + 1);
  vector<FiniteField> inverse_factorials(n + 1);
  factorials[0] = 1;
  for (int i = 1; i <= n; i++) {
    factorials[i] = factorials[i - 1] * i;
  }
  inverse_factorials[n] = FiniteField(1) / factorials[n];
  for (int i = n; i >= 1; i--) {
    inverse_factorials[i - 1] = inverse_factorials[i] * i;
  }
  return make_tuple(factorials, inverse_factorials);
}

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

  int b, w;
  cin >> b >> w;

  FiniteField half = FiniteField(1) / 2;

  vector<FiniteField> fs, i_fs;
  tie(fs, i_fs) = MakeFactorialTables(b + w + 1);
  auto c_fn = [&](int a, int b) -> FiniteField {
    if (a < 0) return 0;
    if (b < 0 || b > a) return 0;
    return fs[a] * i_fs[b] * i_fs[a - b];
  };

  FiniteField x = 0;
  FiniteField y = 0;
  FiniteField unit = 1;
  for (int k = 0; k < b + w; k++) {
    x += unit * c_fn(k - 1, w - 1);
    y += unit * c_fn(k - 1, b - 1);
    FiniteField r = x + (FiniteField(1) - x - y) * half;
    cout << r << endl;

    unit *= half;
  }
}

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

#define rep(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ROF(i,a,b) for(int i=(a);i>(b);i--)
#define all(a) (a).begin(),(a).end()
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef pair<int,int> pii;

main(){
  int n,m; cin >> n >> m;
  vi a(n),b(n); rep(i,n) cin >> a[i] >> b[i];
  vi c(m),d(m); rep(i,m) cin >> c[i] >> d[i];

  long long min,p;
  rep(i,n){
    min = 1000000000;
    rep(j,m){
      if(abs(a[i]-c[j])+abs(b[i]-d[j])<min){
	min = abs(a[i]-c[j])+abs(b[i]-d[j]);
	p = j;
      }
    }
    cout << p+1 << endl;
  }
}


Measured memory_bytes: 256
N=int(input())
S=list(input())
data=[0 for i in range(N)]
data[0]=S[1:].count("E")
for i in range(N-1):
    if S[i]=="W":
        data[i+1]+=1
    if S[i+1]=="E":
        data[i+1]-=1
    data[i+1]+=data[i]
print(min([i for i in data]))


Measured memory_bytes: 21072
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

int main(){
  int n = in();
  int m = in();
  rep(i,(m+1)/2){
    cout << i+1 <<" "<< m-i+1 << endl;
  }
  rep(i,m/2){
    cout << m+i+2 << " " << m*2+1-i << endl;
  }
}

//1 2 3
//6 5 4

//


Measured memory_bytes: 3768
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<string>
#include<iostream>
#include<cmath>
#include<map>
#include<set>
#include<climits>
using namespace std;
typedef vector<string>vs;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef vector<double>vd;
typedef pair<int,int>pii;
typedef long long ll;
typedef pair<ll,ll>pll;
typedef vector<ll>vl;
typedef pair<int,pii>piii;
#define rrep(i,x,n) for(int i=(x);i<(n);++i)
#define rep(i,x) rrep(i,0,(x))
#define fi first
#define se second
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define maxs(a,b) (a)=max(a,b)
#define mins(a,b) (a)=min(a,b)
///#include<sstream>
///#include<cstring>
///#include<stack>
///#include<complex>

int N,K;
int x[100000];

int solve(){
    vector<int>dif;
    int sum=0;
    rep(i,N-1){
        dif.pb(x[i+1]-x[i]);
        sum+=x[i+1]-x[i];
    }
    sort(all(dif),greater<int>());

    for(int i=0;i<min(K-1,(int)dif.size());i++)sum-=dif[i];

    return sum;
}

int main(){
    int M;
    scanf("%d",&M);
    while(M--){
        scanf("%d%d",&N,&K);
        rep(i,N)scanf("%d",&x[i]);
        printf("%d\n",solve());
    }

    return 0;
}

Measured memory_bytes: 2448
#include "bits/stdc++.h"

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,s,n) for(int i=(s);i<(n);++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define REPR(i,s,n) for(int i=(s);i>=(n);--(i))
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define DOUBLE fixed << setprecision(10)
#define fi first
#define se second
const double pi = acos(-1.0);
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
typedef vector<P> vP;
const ll mod = 1e9 + 7;
ll dx[4] = { 1,0,-1,0 };
ll dy[4] = { 0,1,0,-1 };
template <typename T>
bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
};
template <typename T>
bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
};
void Pvll(vll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) cout << v[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}
void Pvvll(vvll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) {
		rep(j, v[i].size()) {
			cout << v[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Ps(string s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) cout << s[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}

void Pvs(vs s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) {
		rep(j, s[i].size()) {
			cout << s[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Yes(bool x) {
	if (x) cout << "Yes\n";
	else cout << "No\n";
}

void YES(bool x) {
	if (x) cout << "YES\n";
	else cout << "NO\n";
}

void yes(bool x) {
	if (x) cout << "yes\n";
	else cout << "no\n";
}

void Yay(bool x) {
	if (x) cout << "Yay!\n";
	else cout << ":(\n";
}

//最大公約数
ll gcd(ll m, ll n) {
	if ((0 == m) || (0 == n))
		return 0;

	// ユークリッドの方法
	while (m != n)
	{
		if (m > n) m = m - n;
		else         n = n - m;
	}
	return m;
}
//最小公倍数
ll lcm(ll m, ll n) {
	if ((0 == m) || (0 == n))
		return 0;

	return (m * n / gcd(m, n));
}

ll  n, m, r, l, k, h, ans = 0, ret = M;
bool flag = false, flag2 = false, flag3 = false;
string s,t;

void INIT() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << DOUBLE;
}

int main() {
	INIT();
	ll x;
	cin >> k >> x;
	REP(i, x - k + 1,k+x) cout << i << " ";
	cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string> 
#include <vector>
#include <iomanip>
#include <math.h>
#include <map>
using namespace std;

int main()
{
	int N;
	string s, t;
	cin >> N >> s >> t;
	int ans = 2 * N;
	for (int i = 0; i < N; i++) {
		if (s.substr(i, N - i) == t.substr(0, N - i)) {
			ans -= N - i;
			break;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr long long int infll = 1001001001001001LL;
constexpr int INF = 1000000007;
constexpr int inf = 1000000007;
const int mod = 1000000007;

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

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

inline double nCr(const int n, int r)
{
    if (n == 0)
    {
        return 0;
    }
    if (r == 0)
    {
        return 1;
    }
    if (r == 1)
    {
        return n;
    }
    if (n == r)
    {
        return 1;
    }

    if (r > n / 2)
    {
        r = n / 2;
    }

    double result = 1;
    for (double i = 1; i <= r; i++)
    {
        result *= (n - i + 1) / i;
    }

    return (result);
}

template <typename T>
T seinomi(T a)
{
    if (a > 0)
    {
        return a;
    }
    else
    {
        return 0;
    }
}

template <typename T>
map<T, T> soinsuubunkai(T n) //連想配列[素因数f.first][個数f.second]
{
    map<T, T> ret;
    for (T i = 2; i * i <= n; i++)
    {
        while (n % i == 0)
        {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}

template <typename T>
T ketasuu(T num)
{
    return std::to_string(num).length();
}

int kaizyou(int k)
{
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}

template <class ForwardIt, class T>
void iota(ForwardIt first, ForwardIt last, T value)
{
    while (first != last)
    {
        *first++ = value;
        ++value;
    }
}

//nの階乗を計算
int factorial(int n)
{
    int answer = 1;
    while (n > 1)
    {
        answer *= n;
        n--;
    }
    return answer;
}
int comb(int n, int r)
{
    return factorial(n) / (factorial(r) * factorial(n - r));
}

long long modpow(long long a, long long n, long long mod)
{
    long long res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

//小数点以下10桁テンプレート（main関数内の最初に貼付け）
//std::cout << std::fixed << std::setprecision(10);

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


int main(){
ll a,p;
cin>>a>>p;
cout<<(a*3+p)/2<<endl;
}









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

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 101
int main(){

    int w,h,n,x,y,a;
    cin >> w >> h >> n;
    //ut << w << h << n << endl;

    int ar[MAX_A][MAX_A] = {0};

    int tmp = 0;
    for(int k = 0;k < n;k++){

        cin >> x >> y >> a;
        //cout << x << y << a << endl;
        //cout << "b" << endl;
        if(a == 1){
            //cout << "1" << endl;
            for(int i = 0;i < h;i++){
                for(int j = 0;j < x;j++){
                    if(ar[i][j] != 1){
                        ar[i][j] = 1;
                        tmp++;
                    }
                }
            }
            //cout << tmp << endl;
        }
        //cout << "a" << endl;

        if(a == 2){
            for(int i = 0;i < h;i++){
                for(int j = x;j < w;j++){
                    if(ar[i][j] != 1){
                        ar[i][j] = 1;
                        tmp++;
                    }
                }
            }
            //cout << tmp << endl;
        }

        if(a == 3){
            for(int i = (h-y);i < h;i++){
                for(int j = 0;j < w;j++){
                    if(ar[i][j] != 1){
                        ar[i][j] = 1;
                        tmp++;
                    }
                }
            }
        }

        if(a == 4){
            for(int i = 0;i < (h-y);i++){
                for(int j = 0;j < w;j++){
                    if(ar[i][j] != 1){
                        ar[i][j] = 1;
                        tmp++;
                    }
                }
                //cout << tmp << endl;
            }
            //cout << tmp << endl;
        }
    }
    int count = 0;

    for(int i = 0;i < h;i++){
        for(int j = 0;j < w;j++){
            if(ar[i][j] == 1){
                count++;
            }
        }
    }

    cout << h*w-count << endl;





    return 0;
}

Measured memory_bytes: 256
"use strict";
const Main = (input) =>{
   let xs = input.trim().split(' ');
   if(xs[0]=="Sunny"){
   console.log("Cloudy");
   }else if(xs[0]=="Cloudy"){
   console.log("Rainy");
   }else{
   console.log("Sunny");
   }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(x) (x).begin(), (x).end()

int n, l;
vector <string> s;
int32_t main() {
	cin >> n >> l;
	for(int i = 0; i < n; ++i) {
		string a; cin >> a;
		s.pb(a);
	}
	sort(all(s));
	for(auto it:s) cout << it;
}


Measured memory_bytes: 3596
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String o = sc.next();
    String e = sc.next();

    sc.close();

    String[] O = o.split("");
    String[] E = e.split("");

    String ans = "";

    for (int i = 0; i < O.length; i++) {
      if ((O.length + E.length) % 2 != 0) {
        if (i == O.length - 1) {
          ans += O[i];
        } else {
          ans += O[i] + E[i];
        }
      } else {
        ans += O[i] + E[i];
      }
    }

    System.out.println(ans);

  }

}

Measured memory_bytes: 22740
using System;

namespace A
{
    class A
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int n = int.Parse(input), i, j;
            int[,] graph = new int[n, n];
            for (i = 0; i < n; i++)
            {
                string[] input2 = Console.ReadLine().Split(' ');
                if (int.Parse(input2[1])!=0)
                {
                    for (j = 0; j < int.Parse(input2[1]); j++)
                    {
                        graph[int.Parse(input2[0]) - 1, int.Parse(input2[2 + j])-1] = 1;
                    }
                }
            }
            for (i = 0; i < n; i++)
            {
                for (j = 0; j < n; j++)
                {
                    if (j!=0)
                    {
                        Console.Write(" ");
                    }
                    Console.Write(graph[i,j]);
                }
                Console.WriteLine();
            }
        }
    }
}



Measured memory_bytes: 17740
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int g(string s){
	return atoi(s.c_str());
}

int f(string t){
	int h=g(t.substr(0,2));
	int m=g(t.substr(3,2));
	int s=g(t.substr(6,2));
	return h*60*60+m*60+s;
}

const int M=100000;

int main(){
	while(1){
		int n;
		cin>>n;
		if(n==0) break;
		vi a(M);
		for(int i=0;i<n;i++){
			string s,t;
			cin>>s>>t;
			a[f(s)]++;
			a[f(t)]--;
		}
		for(int i=1;i<M;i++) a[i]+=a[i-1];
		int res=0;
		for(auto i:a) res=max(res,i);
		cout<<res<<endl;
	}
}


Measured memory_bytes: 3600
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 11 14:44:47 2018
ABC046C
@author: maezawa
"""
import math
n = int(input())
tp = 1
ap = 1
for i in range(n):
    ti, ai = list(map(int, input().split()))
    #nit = math.ceil(tp/ti)
    #nia = math.ceil(ap/ai)
    nit = -(-tp//ti)
    nia = -(-ap//ai)
    ni = max(nit, nia)
    vi = ni*(ti+ai)
    #print(ni, vi)
    tp = ni*ti
    ap = ni*ai

print(vi)

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

int main(){
   long long N, A, B;
   cin >> N >> A >> B;

   long long syou, amari;
   syou = N/(A+B);
   amari = N%(A+B);

   if (amari >= A)
      cout << syou*A+A << endl;
   else
      cout << syou*A+amari << endl;

}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapit map<ll,ll>::iterator
#define mod 1000000007
#define db double
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll i;
    if(n%1000==0)
        i=0;
    else
        i=1000-n%1000;
    cout<<i<<"\n";
}


Measured memory_bytes: 3660
import java.util.*;

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

		long[] a = new long[n];
		long[] s = new long[n + 1];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong() - 1;
			s[i + 1] = (s[i] + a[i]) % k;
		}

		long answer = 0;
		Queue<Long> q = new LinkedList<>();
		Map<Long, Long> h = new HashMap<>();

		for (int i = 0; i <= n; i++) {
			q.offer(s[i]);
			while (q.size() > k) {
				long x = q.poll();
				h.put(x, h.get(x) - 1);
			}

			if (!h.containsKey(s[i])) {
				h.put(s[i], 1L);
				continue;
			}

			answer += h.get(s[i]);
			h.put(s[i], h.get(s[i]) + 1);
		}

		System.out.println(answer);
	}
}


Measured memory_bytes: 112108
s = gets.chomp

patterns = [
  /^.*keyence$/,
  /^k.*eyence$/,
  /^ke.*yence$/,
  /^key.*ence$/,
  /^keye.*nce$/,
  /^keyen.*ce$/,
  /^keyenc.*e$/,
  /^keyence.*$/,
]

ret = patterns.any? {|pat| s =~ pat} ? 'YES' : 'NO'
puts ret

Measured memory_bytes: 1788
#include <stdio.h>
int main()
{
	int A,B;
	int X,Y;
	scanf("%d %d",&A,&B);
	X=A*B;
	Y=X%2;
	if(Y==0){
		printf("No");
	}else{
		printf("Yes");
	}
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
using namespace std;
 
bool overlap(int a, int b, int c, int d){
  if ( d <= a ) return false;
  if ( b <= c ) return false;
  return true;
}
 
main(){
  int a, b, s, f, n;
  cin >> a >> b >> n;
  for ( int i = 0; i < n; i++ ){
    cin >> s >> f;
    if ( overlap(a, b, s, f) ){
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 0 << endl;
  return 0;
}


Measured memory_bytes: 3104