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

using namespace std;

#define fto(i, s, e) for(int i = s; i <= e; ++i)
#define fto1(i, s, e) for(int i = s; i < e; ++i)
#define fdto(i, s, e) for(int i = s; i >= e; --i)
#define fit(var, it) for(__typeof(var.begin()) it = var.begin(); it != var.end(); ++it)
#define frit(var, it) for(__typeof(var.rbegin()) it = var.rbegin(); it != var.rend(); ++it)

#define newl '\n'
#define debugt cerr << 0.001*clock() << newl
#define debug1(x, i) cout << #x << '[' << i << "] = " << x[i] << newl
#define debug(v, l, r) fto(_i, l, r) debug1(v, _i)
#define debug2(x, i, j) cout << #x << '[' << i << "][" << j << "] = " << x[i][j] << newl
#define debug3(x, i, j, k) cout << #x << '[' << i << "][" << j << "][" << k << "] = " << x[i][j][k] << newl

#define ll long long
#define ii pair<int, int>
#define ff first
#define ss second
#define pb push_back
#define glen(v) int((v).size())

template<typename T1, typename T2> ostream& operator<< (ostream &os, pair<T1, T2> const &v) {
	return os << '(' << v.ff << ", " << v.ss << ')';
}

#define eps 1e-15
#define oo 1000000007
#define OO 1000000000000000003LL
#define maxn 3003

int n;
int a[maxn];
ll f[maxn][maxn][2];

int main() {
	//ios_base::sync_with_stdio(0); cin.tie(0);

	scanf("%d", &n);

	fto (i, 1, n) {
		scanf("%d", &a[i]);
		f[i][i][0] = a[i];
		f[i][i][1] = -a[i];
	}

	fdto (i, n-1, 1) {
		fto (j, i+1, n) {
			f[i][j][0] = max(f[i+1][j][1] + a[i], f[i][j-1][1] + a[j]);
			f[i][j][1] = min(f[i+1][j][0] - a[i], f[i][j-1][0] - a[j]);
		}
	}

	printf("%lld\n", f[1][n][0]);

	return 0;
}


Measured memory_bytes: 139648
#include <bits/stdc++.h>
using namespace std;
#define max 200009
map<long,long>mp;

int main()
{
    long i,j,t,a,b,n,c,temp,m;
    t=1;
    // cin>>t;
    while(t--)
    {
       cin>>n>>m;
       long arr[n+1];
       for(i=0;i<n;i++)
       {
           cin>>arr[i];
           
       }
       sort(arr,arr+n);
       reverse(arr,arr+n);
       cout<<accumulate(arr,arr+m,0LL);
      
    }
}

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

int main ()
{
    int H, N, i, ans=0;
    scanf("%d %d", &H, &N);
    int arr[N], sum=0;

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

    for(i=0; i<N; i++)
    {
        sum+=arr[i];
        if(sum>=H)
            ans=1;
    }

    switch(ans)
    {
        case 1: printf("Yes"); break;
        case 0: printf("No"); break;
    }
    return 0;
}


Measured memory_bytes: 512
#include <cstdio>

int main()
{
        unsigned int hill[10];

        for (int i = 0; i < 10; i++) {
                scanf("%u", &hill[i]);
        }
        for (int i = 0; i < 3; i++) {
                for (int j = 9; j > i; j--) {
                        if (hill[j - 1] < hill[j]) {
                                unsigned int tmp = hill[j - 1];
                                hill[j - 1] = hill[j];
                                hill[j] = tmp;
                        }
                }
        }
        for (int i = 0; i < 3; i++) {
                printf("%u\n", hill[i]);
        }

        return 0;
}

Measured memory_bytes: 1036
n,m = map(int, input().split())
H = list(map(int, input().split()))
s = [[0] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    s[a-1].append(H[b-1])
    s[b-1].append(H[a-1])
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c+= 1
print(c) 

Measured memory_bytes: 26048
#include<stdio.h>
int main(){
	unsigned char usW_D_str[1200];
	unsigned short usW_C_i, usW_C_j;
	int string_count;
	
	for(usW_C_i = 0;usW_C_i < 1200;usW_C_i++){
		usW_D_str[usW_C_i] = '\0';
	}
	
	for(usW_C_i = 0;usW_C_i < 1200;usW_C_i++){
		scanf("%c", &usW_D_str[usW_C_i]);
		if(usW_D_str[usW_C_i] == '\0'){
			break;
		}
	}
	
	for(usW_C_i = 0;usW_C_i < 1200;usW_C_i++){
		if(usW_D_str[usW_C_i] >= 'A' && usW_D_str[usW_C_i] <= 'Z'){
			usW_D_str[usW_C_i + usW_C_j] += 32;
		}
		else if(usW_D_str[usW_C_i] >= 'a' && usW_D_str[usW_C_i] <= 'z'){
			usW_D_str[usW_C_i] -= 32;
		}
		else;
	}
	
	for(usW_C_i = 0;usW_D_str[usW_C_i] != '\0';usW_C_i++){
		printf("%c", usW_D_str[usW_C_i]);
	}
	
	return 0;
}


Measured memory_bytes: 2044
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        int gap = b - a;
        int sum = 0;
        for (int i = 1; i <= gap; i++) {
            sum += i;
        }
        System.out.println(sum - b);
    }
}


Measured memory_bytes: 21716
# -*- coding: utf-8 -*-
s = int(input())
d = {s:1}
before = s
i = 1

def f(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1

while True:
    i += 1
    ai = f(before)
    if ai in d:
        res = i
        break
    else:
        d[ai] = i
        before = ai

# print(d)
print(res)


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

const int N=2e5+100;
const int mod=1e9+7;
typedef long long ll;

typedef pair<ll,int>pa;

ll sum[60],p[60];

ll solve(ll n,ll x)
{

      if(n==0 && x>=1) return 1;
      else if(x<=0) return 0;
      else {
         if(x<=sum[n-1]+1)   return solve(n-1,x-1);
         else if(x==sum[n-1]+1)  return p[n-1];

         else  return  p[n-1]+1+solve(n-1,x-sum[n-1]-2);
      }
}


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

    ll n,k;cin>>n>>k;

    sum[0]=1,p[0]=1;

    for(int i=1;i<=50;i++){
        sum[i]=sum[i-1]*2+3;
        p[i]=p[i-1]*2+1;
    }
    cout<<solve(n,k)<<endl;
     return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
//#include "library/debug.cpp"

template <class T>
struct BinaryIndexedTree {
    vector<T> node;
    int n;

    BinaryIndexedTree(int _n)
        : n(_n) {
        node.resize(n);
    }

    void add(int x, T v) {
        while (x < n) {
            node[x] += v;
            x |= (x + 1);
        }
    }

    T get(int x) {
        T v = 0;
        while (x >= 0) {
            v += node[x];
            x = (x & (x + 1)) - 1;
        }
        return v;
    }

    T get(int a, int b) {
        return get(b) - get(a - 1);
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, 0, n) cin >> a[i];
    vector<ll> b = a;
    sort(b.begin(), b.end());
    b.erase(unique(b.begin(), b.end()), b.end());
    ll l = 0, r = b.size();
    while (r - l > 1) {
        ll m = (r + l) / 2;
        BinaryIndexedTree<ll> bt(2 * n + 5);
        ll cnt = n + 1;
        ll sum = 0;
        bt.add(cnt, 1);
        rep(i, 0, n) {
            if (a[i] >= b[m])
                cnt++;
            else
                cnt--;
            sum += bt.get(cnt);
            bt.add(cnt, 1);
        }
        if (sum * 2 >= n * (n + 1) / 2)
            l = m;
        else
            r = m;
    }
    cout << b[l] << endl;
    return 0;
}

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

using namespace std;
typedef long long ll;
#define sz(x) (ll)((x).size())
#define rep(i,n) for(ll i=0;i<n;i++)
const ll INF=1000000000000000;
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return true;}return false;}

int main(){
	string s; cin>>s;
	ll L=sz(s);
	//0 1 ...... L-1
	// 0 1 ... L-2
	ll ans=INF;
	rep(i,L-1){
		if(s[i]!=s[i+1]) chmin(ans,max(i+1,L-1-i));
	}
    cout<<(ans==INF?L:ans);
}

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

int main() {

    int N;
    cin >> N;

    double m = N / 1.08;
    int ce = ceil(m);
    int fl = floor(m);

    int ce_tax = floor(ce*1.08);
    int fl_tax = floor(fl*1.08);
    if(ce_tax == N){
        cout << ce << endl;
        return 0;
    } else if(fl_tax == N){
        cout << fl << endl;
        return 0;
    } else {
        cout << ":(" << endl;
        return 0;
    } 
    return 0;
}

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

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

    int A;
    for (int i = 0; i < N; i++)
    {
        cin >> A;
        H -= A;
    }
    if (H > 0)
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
}


Measured memory_bytes: 256
n = gets.to_i
s = gets.split('')

cnt = 0
n.times do |i|
  j = i + 1
  k = i + 2
  while k < n
    cnt += 1 if (s[i] != s[j] && s[j] != s[k] && s[i] != s[k])
    j += 1
    k += 2
  end
end

puts s.count('R') * s.count('G') * s.count('B') - cnt

Measured memory_bytes: 14372
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    S = list(input())
    T = list(input())

    ans = 0
    for i in range(len(S)):
        if S[i] == T[i]:
            ans += 1
    
    print(ans)

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc139","a",main)

Measured memory_bytes: 3060
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
#include <climits>

#include <sstream>
#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
#include <functional>
#include <algorithm>

using namespace std;

#define fast_cin() ios_base::sync_with_stdio(false)

typedef long double ld;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int max_N = 1e3 + 10;
const ld inf = 1e18;

ll X[max_N], Y[max_N], R[max_N];
int popped[max_N];
vector< pair<int, ld> > E[max_N];
ld dist[max_N];
int N;

template<typename T>
T sqr(const T &x) {return x * x;}
ld distance(int i, int j);
ld dijkstra();

int main()
{
	int xt, yt;
	cin >> X[0] >> Y[0] >> xt >> yt;
	cin >> N;
	X[N + 1] = xt;
	Y[N + 1] = yt;
	for (int i = 1; i <= N; ++i) {
		cin >> X[i] >> Y[i] >> R[i];
	}
	for (int i = 0; i <= N + 1; ++i) {
		for (int j = i + 1; j <= N + 1; ++j) {
			ld temp = max(distance(i, j) - R[i] - R[j], ld(0));
			E[i].push_back({j, temp});
			E[j].push_back({i, temp});
		}
	}
	cout << fixed << setprecision(12) << dijkstra() << endl;
}

ld distance(int i, int j)
{
	return sqrt(sqr(X[i] - X[j]) + sqr(Y[i] - Y[j]));
}

ld dijkstra()
{
	for (int i = 1; i <= N + 1; ++i) {
		dist[i] = inf;
	}
	priority_queue< pair<ld, int>, vector< pair<ld, int> >, greater< pair<ld, int> > > dfq;
	dfq.push({0, 0});
	while(!dfq.empty() && !popped[N + 1]) {
		auto u = dfq.top();
		dfq.pop();
		if (!popped[u.second]) {
			popped[u.second] = 1;
			for (auto &v : E[u.second]) {
				if (dist[v.first] > dist[u.second] + v.second) {
					dist[v.first] = dist[u.second] + v.second;
					dfq.push({dist[v.first], v.first});
				}
			}
		}
	}
	return dist[N + 1];
}


Measured memory_bytes: 40976
use std::io::{self, BufRead};
use std::cmp::min;

fn main() {
  let stdin = io::stdin();
  let mut lines = stdin.lock().lines();
  let vs: Vec<i32> = lines.next().unwrap().unwrap().as_bytes().iter().rev().map(|x| *x as i32 - 48).collect();
  let mut a0 = vs[0];
  let mut b0 = 10 - vs[0];
  for i in 1..vs.len() {
    let n = vs[i];
    let a1 = min(n + 1 + b0, n + a0);
    let b1 = min(9 - n + b0, 10 - n + a0);
    a0 = a1;
    b0 = b1;
  }
  println!("{}", min(a0, b0 + 1));
}

Measured memory_bytes: 8444
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
 
#define rep(i,s,n) for(int i = (s);i<(n);i++)
#define repe(i,s,n) for(int i = (s);i<=(n);i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
const ll MOD=1000000007,INF=1e18;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
 
 
 

 
signed main(){
    int n,c,k;
    cin>>n>>c>>k;
    vint t(n);
    rep(i,0,n)cin>>t[i];
    sort(all(t));
    
    int cur=0,ans=0;
    while(cur<n){
        int nex=cur;
        while(nex<n&&nex-cur<c&&t[nex]-t[cur]<=k)nex++;
        ans++;
        cur=nex;
    }
    
    cout<<ans<<endl;
    
    
    return 0;
}

Measured memory_bytes: 1024
EPS=1.0e-9
while input=gets do
  a,b,c,d,e,f=input.split(" ").collect do |x|
    x.to_f
  end
  num1=(c*e-b*f)/(a*e-b*d)
  num2=(a*f-c*d)/(a*e-b*d)
  print "%.3f" % (num1+EPS)," ","%.3f" % (num2+EPS) ,"\n"
end

Measured memory_bytes: 6144
#include<stdio.h>
#define MAX 100
#define INFTY (1<<21)
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n,M[MAX][MAX];

int prim(){
  int i,v,u,sum,min;
  int d[MAX],p[MAX],c[MAX];

  for(i=0;i<n;i++){
    d[i]=INFTY;
    p[i]=-1;
    c[i]=WHITE;
  }
  d[0]=0;
  while(1){
    min=INFTY;
    u=-1;
    for(i=0;i<n;i++){
      if(min>d[i] && c[i]!=BLACK){
        u=i;
        min=d[i];
      }
    }
    if(u==-1)break;
    c[u]=BLACK;
    for(v=0;v<n;v++){
      if(c[v]!=BLACK && M[u][v]!=INFTY){
      if(d[v]>M[u][v]){
        d[v]=M[u][v];
        p[v]=u;
        c[v]=GRAY;
      }
    }
  }
}

sum=0;

for(i=0;i<n;i++){
  if(p[i]!=-1)sum+=M[i][p[i]];
 }
return sum;
}

int main(){

  int i,j,f;
  scanf("%d",&n);

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&f);
      M[i][j]=(f==-1)?INFTY:f;
    }
  }

  printf("%d\n",prim());

  return 0;
}


Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int MOD = 1e9+7;
const ll LINF = 1e18;
const int INF = 1e9;
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;

int main()
{
    char cc;
    cin >> H >> W >> K;
    vector<vector<char>> arr(H,vector<char>(W));
    for (int i = 0; i < H; i++) rep(j,W) cin >> arr[i][j];

    for(int temp=0;temp<(1<<H);temp++)
    {
        bitset<6> h(temp);
        for(int temmt=0;temmt<(1<<W);temmt++)
        {
            bitset<6> w(temmt);
    
            int sum = 0;
            for (int i = 0; i < H; i++)
            {
                if (h.test(i))
                {
                    continue;
                }
                for (int j = 0; j < W; j++)
                {
                    if (w.test(j))
                    {
                        continue;
                    }
                    if(arr[i][j] == '#') sum++;
                }
                

            }
            if(sum==K)A++;
        }
    }
    
    cout << A;
    return 0;
}

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

#define ln                '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

num n, ans;

int main() {
    ios::sync_with_stdio(0);
    cin >> n;
    if (n % 2 == 1) {
        cout << 0 << ln;
    } else {
        num cur = 1;
        ans = n / 10;
        n /= 10;
        cur = 1;
        circ (k, 0, 25) {
            cur *= 5;
            ans += n / cur;
        }
        cout << ans << ln;
    }
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

n=int(input())
S=input()
for si in S:
    if si=="Y":

        print("Four")
        exit()
print("Three")

Measured memory_bytes: 38384
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] line = sc.nextLine().trim().split(" ");
    long n = Long.valueOf(line[0]);
    long m = Long.valueOf(line[1]);
    Queue<Long> queue = new PriorityQueue<>(Collections.reverseOrder());
    line = sc.nextLine().trim().split(" ");
    for (String s : line) {
      queue.add(Long.valueOf(s));
    }
    for (int i = 0; i < m; i++) {
      long tmp = queue.poll();
      tmp /= 2;
      queue.add(tmp);
    }
    long sum = 0;
    for (long q : queue) {
      sum += q;
    }
    System.out.println(sum);
  }
}

Measured memory_bytes: 54472
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<ll> vl;
ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t;
    }
    return n*rep_jijo(n,x-1);
}
ll com(ll n,ll r){
    ll x=1,y=1;
    ll tmp=n;
    while(tmp>=n-r+1){
        x=x*tmp%mod;
        tmp--;
    }
    while(r>0){
        y=y*r%mod;
        r--;
    }
    return x*rep_jijo(y,mod-2)%mod;
}

int main (){
    int n;
    ll sum_a=0;
    ll sum_b=0;
    cin >> n;
    vl a(n);
    vl b(n);
    vl c(n);
    rep(i,n){
        ll A;
        cin >> A;
        a[i]=A;
        sum_a+=A;
    }
    rep(i,n){
        ll B;
        cin >> B;
        b[i]=B;
        sum_b+=B;
    }
    if(sum_b>sum_a){
        cout << -1 << endl;
        return 0;
    }
    ll sub=sum_a-sum_b;
    rep(i,n) c[i]=b[i];
    int ans=0;
    vl abc;
    rep(i,n){
        if(c[i]>a[i]) ans++;
        else if(a[i]==c[i]) continue;
        else {
            ans++;
            ll x=a[i]-c[i];
            abc.push_back(x);
        }
    }
    sort(abc.begin(),abc.end());
    int len=abc.size();
    rep(i,len){
        if(sub<=0) break;
        if(abc[i]<=sub){
            ans--;
            sub-=abc[i];
        }
    }

    cout << ans <<endl;


    return 0;
}



Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define endl '\n'
#define maxn 100005
#define tc printf("Case %d: ", cs)
#define tcn printf("Case %d:\n", cs);
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
const double PI = acos(-1.0);

#define dbg1(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;
#define dbg4(w,x, y, z) cerr << #w << " = " << w << ", " <<#x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
	return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
	os << "{";
	for (auto it = v.begin(); it != v.end(); ++it) {
		if ( it != v.begin() ) os << ", ";
		os << *it;
	}
	return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
	os << "[";
	for (auto it = v.begin(); it != v.end(); ++it) {
		if ( it != v.begin()) os << ", ";
		os << *it;
	}
	return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
	os << "[";
	for (auto it = v.begin(); it != v.end(); ++it) {
		if ( it != v.begin() ) os << ", ";
		os << it -> first << " = " << it -> second ;
	}
	return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

clock_t tStart = clock();
#define timeStamp dbg("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)

void faltu () { cerr << endl; }

template <typename T>
void faltu( T a[], int n ) {
	for (int i = 0; i < n; ++i) cerr << a[i] << ' ';
	cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) { cerr << arg << ' '; faltu(rest...); }
// Program showing a policy-based data structure.
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less 
#include <iostream>
using namespace __gnu_pbds;
using namespace std;
// GNU link : https://goo.gl/WVDL6g
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
        tree_order_statistics_node_update>
        new_data_set;

/**___________________________________________________**/



int main()
{
	FASTIO
	/*
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
//*/
	int T;
	//scanf("%d", &T);
	T = 1;
	for (int cs = 1; cs <= T; cs++) {
		double a, b;
		cin >> a >> b;
		cout << setprecision(20) << (a / b) << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>

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

using namespace std;

int main(void){
    int a[4], b[4];
    while(~scanf("%d %d %d %d", a, a + 1, a + 2, a + 3)){
        scanf("%d %d %d %d", b, b + 1, b + 2, b + 3);
        int hit = 0, blow = 0;

        rep(i, 4) rep(j, 4) if(a[i] == b[j]) if(i == j) hit ++; else blow ++;

        printf("%d %d\n", hit, blow);
    }

    return 0;
}

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

typedef pair<int, int> P;
const int INF = 1000*1000 +10;

int main() {
    int H, W;
    cin >> H >> W;
    vector<string> masu;
    masu.resize(H);
    rep(i, H) {
        cin >> masu[i];
    }

    queue<P> loc_queue;
    int ans = 0;
    vector<vector<int>> d_temp(H, vector<int>(W, 0));

    rep(i, H) {
        rep(j, W) {
            if (masu[i][j]=='#') {
                loc_queue.push(P {i, j});
            }
        }
    }

    int dh[4] = {0, 1, 0, -1};
    int dw[4] = {1, 0, -1, 0};

    while (!loc_queue.empty()) {
        P loc_temp = loc_queue.front();
        loc_queue.pop();

        int h = loc_temp.first;
        int w = loc_temp.second;

        rep(i, 4) {
            int nh = h + dh[i];
            int nw = w + dw[i];
            if (0<=nh && 0<=nw && nh<H && nw<W && masu[nh][nw]=='.') {
                masu[nh][nw] = '#';
                loc_queue.push(P {nh, nw});
                d_temp[nh][nw] = d_temp[h][w] + 1;
                ans = max(ans, d_temp[nh][nw]);
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 13456
#include<iostream>

using namespace std;

int insertionsort(int* a,int n,int g,int cnt){
  for(int i = g; i < n; i++){
    int v = a[i];
    int j = i - g;
    while(j >= 0 && a[j] > v){
      a[j+g] = a[j];
      j -= g;
      cnt++;
    }
    a[j+g] = v;
  }
  return cnt;
}

int main(){
  int cnt = 0;
  int n;
  cin >> n;
  int a[n];
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  int x = n;
  int g[n];
  int m = 0;
  for(int i = 0; x > 1; i++){
    x = x - 1;
    g[i] = x;
    m++;
    x = x/3;
  }
  g[m] = 1;
  m++;
  for(int i = 0; i < m; i++){
    cnt = insertionsort(a,n,g[i],cnt);
  }
  cout << m << "\n";
  for(int i = 0; i < m; i++){
    if(i > 0){
      cout << " ";
    }
    cout << g[i];
  }
  cout << "\n";
  cout << cnt << "\n";

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

  return 0;
}



Measured memory_bytes: 6908
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

H, W, M = map(int, input().split())

h = []
w = []
c = set()
for i in range(M):
    a, b = map(int, input().split())
    h.append(a)
    w.append(b)
    c.add((a,b))

h = Counter(h)
w = Counter(w)

h = sorted(h.items(), key=lambda x:x[1], reverse=True)
w = sorted(w.items(), key=lambda x:x[1], reverse=True)

num_h = h[0][1]
num_w = w[0][1]

h_key = []
w_key = []

for i in range(len(h)):
    if h[i][1] == num_h:
        h_key.append(h[i][0])
    else:
        break

for i in range(len(w)):
    if w[i][1] == num_w:
        w_key.append(w[i][0])
    else:
        break

for hh in h_key:
    for ww in w_key:
        if (hh,ww) not in c:
            print(num_h + num_w)
            sys.exit()

print(num_h + num_w -1)



















Measured memory_bytes: 112508
#include <iostream>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int main(void)
{
    int n;
    cin >> n;
    vector<int> a(100);
    vector<int> b(100);
    vector<int> c(100-1);

    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n-1) cin >> c[i];

    int sum = b.at(a.at(0)-1);

    for(int i = 1; i < n; i++)
    {
        sum += b.at(a.at(i)-1);
        if(a.at(i) == a.at(i-1) + 1){
            sum += c.at(a.at(i-1)-1);
        }

        //cout << sum << endl;
    }

    cout << sum << endl;
    return 0;
}

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

int main(){
	int W, A, B; scanf("%d%d%d", &W, &A, &B);
	if (A > B) swap(A, B);

	if (B <= A + W) return !printf("0");
	printf("%d", B - A - W);
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef pair<int ,string> pis;
 
 
const int INF = 10000000;


int main(){
	int a, b, c, r, n;
	while(cin>>a>>b>>c){
		if(a == 0 && b == 0 && c == 0) break;
		vii v;
		cin>>n;
		int x, y, z;
		for(int i = 0; i < n; i++){
			cin>>x>>y>>z>>r;
			x--; y--; z--;
			r = (r + 1) % 2;
			vi u;
			u.pb(r);
			u.pb(x);
			u.pb(y);
			u.pb(z);
			v.pb(u);
		}

		sort(all(v));

		vi u(a + b + c, 2);
		for(int i = 0; i < n; i++){
			if(v[i][0] == 0){
				for(int j = 1; j < 4; j++) {
					u[v[i][j]] = 1;
					//cout<<" "<<v[i][j];
				}
				//cout<<endl;
			}
			else{
				if(u[v[i][1]] == 2 && u[v[i][2]] == 1 && u[v[i][3]] == 1) u[v[i][1]] = 0;
				else if(u[v[i][1]] == 1 && u[v[i][2]] == 2 && u[v[i][3]] == 1) u[v[i][2]] = 0;
				else if(u[v[i][1]] == 1 && u[v[i][2]] == 1 && u[v[i][3]] == 2) u[v[i][3]] = 0;
			}
		}

		for(int i = 0; i < a + b + c; i++) cout<<u[i]<<endl;
	}
}

Measured memory_bytes: 1288
n, m = gets.split.map(&:to_i)
ab=$<.map{|m|m.split.map(&:to_i)}
pay = 0
ab.sort.each do |e|
    if e[1] < m
        pay += e[0] * e[1]
        m -= e[1]
    else
        pay += m * e[0]
        break
    end
end

p pay

Measured memory_bytes: 11000
n = int(input())
sl = list(input())

max_k = 0
now = 0
for s in sl:
    if s == "(":
        now += 1
    else:
        now -= 1
    max_k = min(now, max_k)


print("(" * (-max_k) + "".join(sl) + max(now-max_k, 0) * ")")


Measured memory_bytes: 38384
a = int(input())
k =[int(input()) for i in range(a)]
k.sort()
if a%2!=0:
  s1= 2*sum(k[a//2:]) - 2*sum(k[:a//2]) -k[a//2]-k[a//2+1]
  s2= 2*sum(k[a//2+1:]) - 2*sum(k[:a//2+1]) +k[a//2]+k[a//2-1]
  s = max(s1,s2)
else:
  s= 2*sum(k[a//2:]) - 2*sum(k[:a//2]) -k[a//2]+k[a//2-1]
print(s)
#print(2*sum(k[a//2+1:]) , 2*sum(k[:a//2]))

Measured memory_bytes: 7504
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
#define int long long int

signed main(){
    int a[3][3];
    int aa[3][3];
    for(int i=0;i<3;i++){
        for(int j=0;j<3;j++){
            cin >> a[i][j];
            aa[i][j] = 0;
        }
    }
    int n;
    cin >> n;
    int b[n];
    for(int i=0;i<n;i++){
        cin >> b[i];
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++){
            for(int k=0;k<3;k++){
                if(a[j][k] == b[i]){
                    aa[j][k] = 1;
                }
            }
        }
    }
    for(int i=0;i<3;i++){
        if(aa[0][i] && aa[1][i] && aa[2][i]){cout << "Yes" << endl;return 0;}
        if(aa[i][0] && aa[i][1] && aa[i][2]){cout << "Yes" << endl;return 0;}
    }
    if(aa[0][0] && aa[1][1] && aa[2][2]){cout << "Yes" << endl;return 0;}
    if(aa[0][2] && aa[1][1] && aa[2][0]){cout << "Yes" << endl;return 0;}
    cout << "No" << endl;
    
}

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

using namespace std;
using namespace atcoder;

const int N = 100000;

int vertexid[N];
int L[N], R[N];
int fl;
vector<int> graph[N];

void build(int v, int l, int r)
{
  L[v] = l, R[v] = r;
  if (l + 1 == r)
  {
    vertexid[v] = l;
    return;
  }
  int m = (l + r) / 2;
  vertexid[v] = fl++;
  build(2 * v + 1, l, m);
  build(2 * v + 2, m, r);
  graph[vertexid[v]].push_back(vertexid[2 * v + 1]);
  graph[vertexid[v]].push_back(vertexid[2 * v + 2]);
}

void connect(int from, int l, int r, int v)
{
  if (r <= L[v] || R[v] <= l) return;
  if (l <= L[v] && R[v] <= r)
  {
    graph[from].push_back(vertexid[v]);
    return;
  }
  connect(from, l, r, 2 * v + 1);
  connect(from, l, r, 2 * v + 2);
}

int main()
{
  int n, d;
  cin >> n >> d;
  vector<int> x(n), y(n);
  for (int i = 0; i < n; i++)
  {
    cin >> x[i] >> y[i];
  }
  vector<pair<int, int> > f;
  for (int i = 0; i < n; i++)
  {
    f.push_back({y[i], 2 * i + 1});
    f.push_back({x[i], 2 * i});
  }
  vector<int> pos(2 * n);
  sort(f.begin(), f.end());
  for (int i = 0; i < 2 * n; i++)
  {
    pos[f[i].second] = i;
  }
  fl = 2 * n;
  build(0, 0, 2 * n);
  for (int i = 0; i < 2 * n; i++)
  {
    int c = x[f[i].second / 2] + y[f[i].second / 2] - f[i].first;
    int mirror = pos[f[i].second ^ 1];
    int L, R;
    {
      int le = -1, ri = 2 * n;
      while (le + 1 < ri)
      {
        int mi = (le + ri) / 2;
        if (f[mi].first <= c - d) le = mi;
        else ri = mi;
      }
      L = ri;
    }
    {
      int le = -1, ri = 2 * n;
      while (le + 1 < ri)
      {
        int mi = (le + ri) / 2;
        if (f[mi].first >= c + d) ri = mi;
        else le = mi;
      }
      R = le;
    }
    if (L <= mirror - 1)
    {
      connect(i, L, mirror, 0);
    }
    if (mirror + 1 <= R)
    {
      connect(i, mirror + 1, R + 1, 0);
    }
  }
  scc_graph G(fl);
  for (int i = 0; i < fl; i++)
  {
    for (auto u : graph[i])
    {
      G.add_edge(i, u);
    }
  }
  vector<vector<int> > scc = G.scc();
  vector<int> wh(fl);
  for (int i = 0; i < scc.size(); i++)
  {
    for (int j = 0; j < scc[i].size(); j++)
    {
      wh[scc[i][j]] = i;
    }
  }
  vector<int> ans(n);
  for (int i = 0; i < n; i++)
  {
    if (wh[pos[2 * i]] == wh[pos[2 * i + 1]])
    {
      cout << "No\n";
      return 0;
    }
    ans[i] = wh[pos[2 * i]] > wh[pos[2 * i + 1]];
  }
  cout << "Yes\n";
  for (int i = 0; i < n; i++)
  {
    if (ans[i]) cout << y[i] << "\n";
    else cout << x[i] << "\n";
  }
}

Measured memory_bytes: 6516
n, k = map(int, input().split())
MOD = 10 ** 9 + 7
SIZE = 10 ** 5 * 2 + 1
fact = [0] * SIZE
inv = [0] * SIZE
finv = [0] * SIZE
fact[0], fact[1] = 1, 1
inv[1] = 1
finv[0], finv[1] = 1, 1
for i in range(2, SIZE):
    fact[i] = fact[i - 1] * i % MOD
    inv[i] = MOD - inv[MOD % i] * (MOD // i) % MOD
    finv[i] = finv[i - 1] * inv[i] % MOD


def combination(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    return fact[n] * (finv[r] * finv[n - r] % MOD) % MOD

k = min(k, n - 1)

ans = 0
for i in range(k + 1):
    ans += combination(n, i) * combination(n - 1, i)
    ans %= MOD
print(ans)


Measured memory_bytes: 26740
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[100100];
int main(){
	int n;
	scanf("%d",&n);
	int mi=0x3f3f3f3f;
	int cnt=0;
	ll su=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		su+=1ll*abs(a[i]);
		mi=min(mi,abs(a[i]));
		if(a[i]<0){
			cnt++;
		}
	}
	if(cnt&1){
		su-=mi*2;
	}
	printf("%lld\n",su);
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x, y; cin>>x>>y;
    int b = (y-2*x)/2;
    int a = (y-4*b)/2;
    int c = (4*x-y)/2;
    if(a+b==x && a==c && (a>=0 && b>=0) && 2*a+4*b==y)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3620
b=list(map(int,input().split()))
c = int(input())
ans = 0
r = min([b[0]*4, b[1]*2, b[2]])
r2 = min([r*2, b[3]])
if c % 2 == 1:
	ans += r
	c -= 1
ans += r2 * (c // 2)
print(ans)

#if c%2==1:
#	print(int(((c-1)/2)*r2+r))
#else :
#	print(int((c/2)*r2))


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int D = sc.nextInt();
		sc.close();
		while(A>0) {
			C=C-B;
			if(C<=0) {
				System.out.println("Yes");
				return;
			}
			A=A-D;
		}
		System.out.println("No");
	}
}

Measured memory_bytes: 35784
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PI  3.14159265358979323846
#define M   1000000007
ll fast(ll n,ll a,ll m)
{
    if(n==0)
        return 1;
    else if(n==1)
        return a;
    else
    {
        ll r=fast(n/2,a,m);
        if(n%2==0)
        {
            return (((r%m)*(r%m))%m);
        }
        else
        {
            return (((((r%m)*a)%m)*r)%m);
        }
    }
}
int main()
{
  ll n,A,B;
  cin>>n>>A>>B;
  ll ans=n/(A+B);
  ans*=A;
  ans+=min(A,n%(A+B));
  cout<<ans;

}


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

#define INF 1000000

int N;
vector<string> a;
vector<string> b;
string base;
string target;

int dfs(string &str){
	if(str == target) return 0;
	if(str.size() >= target.size()) return INF;
	int ret = INF;
	string ns;
	for(int i = 0; i < N; i++){
		ns.clear();
		bool flg = false;
		int idx = 0;
		int pos = 0;
		while((pos = str.find(a[i], idx)) != string::npos){
			ns.append(str.substr(idx, pos - idx));
			ns.append(b[i]);
			idx = pos + a[i].size();
			flg = true;
		}
		if(flg){
			ns.append(str.substr(idx));
			ret = min(ret, dfs(ns) + 1);
		}
	}
	return ret;
}

int main(){
	while(cin >> N, N){
		a.resize(N);
		b.resize(N);
		for(int i = 0; i < N; i++){
			cin >> a[i] >> b[i]; 
		}
		cin >> base;
		cin >> target;

		int ans = dfs(base);
		if(ans == INF){
			cout << "-1" << endl;
		}else{
			cout << ans << endl;
		}
	}
}

Measured memory_bytes: 3124
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(System.out);
        Scanner sc = new Scanner();
        int a=Integer.parseInt(sc.next());
        int b=Integer.parseInt(sc.next());
        int c=Integer.parseInt(sc.next());
        System.out.println(a*b/2);
    }

    static class Scanner {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");
        int spaces = 0;

        public String nextLine() throws IOException {
            if (spaces-- > 0) {
                return "";
            } else if (st.hasMoreTokens()) {
                return new StringBuilder(st.nextToken("\n")).toString();
            }
            return br.readLine();
        }

        public String next() throws IOException {
            spaces = 0;
            while (!st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public boolean hasNext() throws IOException {
            while (!st.hasMoreTokens()) {
                String line = br.readLine();
                if (line == null) {
                    return false;
                }
                if (line.equals("")) {
                    spaces = Math.max(spaces, 0) + 1;
                }
                st = new StringTokenizer(line);
            }
            return true;
        }
    }
}


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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

long int M = 1e+9+7;
int main(void){
    int n;
    cin >> n;
    map<string,int> ans;
    string tmp;
    rep(i,n){
        cin >> tmp;
        ans.insert(make_pair(tmp,1));
    }
    cout << ans.size() << endl;
    return 0;
}

Measured memory_bytes: 19116
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String S = in.next();
            boolean easy = true;
            char[] rs = {'R', 'U', 'D'};
            char[] ls = {'L', 'U', 'D'};
            Arrays.sort(rs);
            Arrays.sort(ls);
            for (int i = 0; easy && i < S.length(); i++) {
                char c = S.charAt(i);
                if (i % 2 == 0) {
                    easy = Arrays.binarySearch(rs, c) >= 0;
                } else {
                    easy = Arrays.binarySearch(ls, c) >= 0;
                }
            }
            out.println(easy ? "Yes" : "No");
        }

    }
}



Measured memory_bytes: 22736
if __name__ == '__main__':
    x, y = map(int, input().strip().split())
    flag = False

    if y % 2 == 1:
        print("No")
    else:
        sum = x * 4
        if sum == y:
            print("Yes")
        else:
            for i in range(x):
                sum -= 2
                if sum == y:
                    print("Yes")
                    flag = True
                    break

            if not flag:
                print("No")


Measured memory_bytes: 9180
N,K = map(int,input().split())
S = input()
S.split('0')
c0 = [len(s) for s in S.split('1') if len(s) != 0]
c1 = [len(s) for s in S.split('0') if len(s) != 0]
if S[0] == '0':
    c1 = [0]+c1


ref = sum(c1[:K+1])+sum(c0[:K])
ans = ref
for i in range(N):
    if i < len(c0):
        ref -= c0[i]
    if i < len(c1):
        ref -= c1[i]
    if i+K < len(c0):
        ref += c0[i+K]
    if i+K+1 < len(c1):
        ref += c1[i+K+1]
    ans = max(ans,ref)

print(ans)

Measured memory_bytes: 4748
#include <bits/stdc++.h>
#include <sys/time.h>
using namespace std;
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 COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }


int main() {
    int X, Y, Z;
    while (cin >> X >> Y >> Z) {
        swap(X, Y);
        swap(X, Z);
        cout << X << " " << Y << " " << Z << endl;
    }
}
















Measured memory_bytes: 768
#include <iostream>

int main(){
   int A, B, K;
   std::cin >> A >> B >> K;
   int btm_max = A+K-1;
   int top_min = B-K+1;
   if ((K >= B) || (top_min <= btm_max)){
      for (int i=A; i<=B; i++){
         std::cout << i << std::endl;
      }
   }else {
      for (int i=A; i<=btm_max; i++){
         std::cout << i << std::endl;
      }
      for (int i=top_min; i<=B; i++){
         std::cout << i << std::endl;
      }
   }

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()
 
using namespace std;
using ll = long long;
 
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; }

struct edge { int to; int cost; };
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int MOD = 1e9+7;
const double EPS = 1.0e-10;
const double PI = acos(-1.0);
 
const int mx4[] = {0,1,0,-1};
const int my4[] = {1,0,-1,0};
const int mx8[] = {0,1,1,1,0,-1,-1,-1};
const int my8[] = {1,1,0,-1,-1,-1,0,1};

int main(){
	int n,m;
	cin >> n >> m;
	int sum = 0;
	vi a(n);
	rep(i,n){
		cin >> a[i];
		sum += a[i];
	}
	int cnt = 0;
	for(int i = 0; i < n; i++){
		if(a[i]*4*m>=sum) cnt++;
	}
	cout << (cnt >= m ? "Yes" : "No") << endl;
	return 0;
}

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

void printv(vector<ll> v) {
  for (ll i : v)
    cout << i << endl;
}

int main() {
  int a,b;
  cin>>a>>b;
  cout<<a*b<<endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
typedef long long ll;
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define fi first
#define se second
#define mod 1000000007
#define pi acos(-1.0)
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define ps(x,y) fixed<<setprecision(y)<<x
#define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

void c_p_c()
{
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
}

int main()
{
    //c_p_c();
    FastIO;
int n;
   cin>>n;
   double r = 2*pi*n;
   cout<<ps(r,16)<<endl;

}



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

for i in range(A,min([A+K+1,B+1]),1):
  if i<A+K:
    print(i)
    
for i in range(max([A+K, B-K-1]),B+1,1):
  if i>B-K:
    print(i)

Measured memory_bytes: 3060
#include <stdio.h>

int popcount(int n) {
	int sumipe = 0;
	while (n > 0) {
		if (n & 1) sumipe++;
		n >>= 1;
	}
	return sumipe;
}

int f_memo[271828];

int f(int n) {
	if (n == 0) return 0;
	if (f_memo[n]) return ~f_memo[n];
	return ~(f_memo[n] = ~(f(n % popcount(n)) + 1));
}

int N;
char X[271828];

int deltas_p[271828], deltas_m[271828];

int main(void) {
	int count, p1, m1, delta_p, delta_m;
	int i;
	if (scanf("%d", &N) != 1) return 1;
	if (scanf("%271827s", X) != 1) return 1;
	count = 0;
	for (i = 0; i < N; i++) {
		if (X[i] == '1') count++;
	}

	p1 = m1 = 0;
	delta_p = delta_m = 1;
	for (i = N - 1; i >= 0; i--) {
		if (X[i] == '1') {
			p1 = (p1 + delta_p) % (count + 1);
			if (count > 1) m1 = (m1 + delta_m) % (count - 1);
		}

		deltas_p[i] = delta_p;
		deltas_m[i] = delta_m;

		delta_p = (delta_p * 2) % (count + 1);
		if (count > 1) delta_m = (delta_m * 2) % (count - 1);
	}

	for (i = 0; i < N; i++) {
		if (X[i] == '1') {
			if (count == 1) {
				puts("0");
			} else {
				printf("%d\n", f((m1 + (count - 1) - deltas_m[i]) % (count - 1)) + 1);
			}
		} else {
			printf("%d\n", f((p1 + deltas_p[i]) % (count + 1)) + 1);
		}
	}

	return 0;
}


Measured memory_bytes: 3872
#include<stdio.h>
int main(){
	int w[10],k[10],wt=0,kt=0;
	int temp;
	int i,j;
	for(i=0;i<10;i++){
		scanf("%d",&w[i]);
	}
	for(i=0;i<10;i++){
		scanf("%d",&k[i]);
	}
	
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			if(w[j]<w[i]){
				temp=w[i];
				w[i]=w[j];
				w[j]=temp;
			}if(k[j]<k[i]){
				temp=k[i];
				k[i]=k[j];
				k[j]=temp;
			}
		}
	}
	for(i=0;i<3;i++){
		kt+=k[i];
		wt+=w[i];
	}	
	printf("%d %d\n",wt,kt);
	
	return 0;
}

Measured memory_bytes: 0
public class Main {
  private static void solve() {
    int n = ni();
    long m = nl();

    long[] a = nal(n);
    int two = -1;
    for (int i = 0; i < n; i++) {
      int cnt = 0;
      a[i] /= 2;
      long x = a[i];
      while (x % 2 == 0) {
        x /= 2;
        cnt++;
      }
      if (two < 0) {
        two = cnt;
      } else if (two != cnt) {
        System.out.println(0);
        return;
      }
    }

    long lcm = 1;
    for (int i = 0; i < n; i++) {
      lcm *= a[i] / gcd(a[i], lcm);

      if (lcm > m) {
        System.out.println(0);
        return;
      }
    }

    long ret = m / lcm - m / (2 * lcm);
    System.out.println(ret);

  }

  public static long gcd(long a, long b) {
    while (b > 0) {
      long c = a;
      a = b;
      b = c % b;
    }
    return a;
  }


  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 40160
N = int(input())
flag = False
dic = []

word = input()
dic.append(word)

for i in range(N-1):
    word = input()
    if(word not in dic and word[0] == dic[-1][-1]):
        dic.append(word)
    else:
        flag = True
        break
if(flag == True):
    print('No')
else:
    print('Yes')

Measured memory_bytes: 3064