akhauriyash/Code-Regression huggingface dataset:
//$g++ -std=c++11 Template.cpp 

//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

priority_queue<int> q_descending;
priority_queue<int, vector<int>, greater<int> > q_ascending;


struct sort_pred {
    bool operator()(const std::pair<int,int> &left, const std::pair<int,int> &right) {
        return left.second < right.second;
    }
};

int
main(void){  
  ios_base::sync_with_stdio(false);

  int n;
  cin >> n;
  vector<int> a(n+2);
  
  FOR(i,1,n+1) {
    cin >> a[i];
  }
  ll csum = 0LL;
  vector<int> cost(n+2);

  //cost: diff, csum: sum of diff
  REP(i, n+1){
    cost[i] = abs(a[i+1]-a[i]);
    csum += cost[i];
  }

  // .. -> i -> i+1 -> i+2 -> .. , remove i+1
  REP(i, n) cout << csum - cost[i] - cost[i+1] + abs(a[i+2]-a[i]) << endl;
  
  
  return 0;
}


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

int main() {
  char c;
  cin >> c;

  // ここにプログラムを追記
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
      cout << "vowel" << endl;
    }else{
      cout << "consonant" << endl;
    }
}
  



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;

ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

ll LCM(ll a,ll b){
    return a / GCD(a,b) * b;
}

const int MOD = 1000000007;


int main() {
    int k; cin >> k;
    if(k % 2 == 0){
        cout << pow(k/2,2);
    }else{
        cout << (k/2) * ((k+1)/2);
    }
}


Measured memory_bytes: 256
#include <cmath>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;
using vi = vector<int>;

ll n;
ll m;

void input() {
  cin >> n >> m;
}

bool check(ll x) {
  ll a = n;
  ll b = m;

  ll need = x - a;

  if (need > 0) {
    b -= need * 2;

    if (b <= 0)
      return true;
  }

  return b / 2 < x;
}

void solve() {
  ll l = 0;
  ll r = 1e18;

  while (r - l > 1) {
    ll mid = (l + r) / 2;

    if (check(mid))
      r = mid;
    else
      l = mid;
  }

  cout << l << '\n';
}

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

  cout.precision(16);
  cout << fixed;

  int _times = 1;

#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  _times = 2;
#endif

  // cin >> _times;

  while (_times--) {
    input();
    solve();
  }
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof a)
using namespace std;
typedef long long ll;
int main()
{
    int n,k;
    int a[1005]={0};
    cin>>n>>k;
    for(int i=0;i<n;i++)
    {
     cin>>a[i];
    }
    sort(a,a+n);
    int sum=0;
    for(int i=0;i<k;i++)
        sum+=a[i];
    cout<<sum;
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main()
{ 
long long int n,sum=0;
cin>>n;
for(int i=1;i<=n;i++){
    if(n%i==0){
        sum=sum+n/i-1;
    }
    else{
        sum=sum+n/i;
    }
}
cout<<sum;
}

Measured memory_bytes: 3632
#include <cstdio>

int comp(int h1, int w1, int h2, int w2)
{
    if (h1 * h1 + w1 * w1 < h2 * h2 + w2 * w2) {
        return -1;
    } else if (h1 * h1 + w1 * w1 == h2 * h2 + w2 * w2) {
        if (h1 < h2)
            return -1;
        else if (h1 == h2)
            return 0;
        else
            return 1;
    } else {
        return 1;
    }
}

int main()
{
    for (;;) {
        int h, w;
        scanf("%d %d", &h, &w);
        if (h == 0 && w == 0)
            break;

        int mh = 100, mw = 100;
        for (int y = 1; y < 150; ++y) {
            for (int x = y + 1; x < 150; ++x) {
                if (comp(h, w, y, x) < 0 && comp(y, x, mh, mw) < 0) {
                    mh = y;
                    mw = x;
                }
           }
        }

        printf("%d %d\n", mh, mw);
    }

    return 0;
}

Measured memory_bytes: 1032
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#include <cassert>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define Cout(x) cout << x << endl;
#define check(v) rep(i,v.size()) cout << v[i] << endl;
#define vint(x) vector<int> x
#define vll(x) vector<long long> x
#define vstr(x) vector<string> x
const long long LLINF = 1LL<<60;
const int INF = 1e9;
const long long MOD = 1000000007;
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; }
typedef long long ll;
#define pint pair<int,int>
#define pll pair<ll,ll>
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, r; cin >> n >> r;
    if(n>=10) {
        cout << r << endl;
    }
    else {
        cout << r+100*(10-n) << endl;
    }

    return 0;
}

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

int main()
{
	char ch;
	int cnt[26] = {0};
	while (scanf("%c",&ch) != EOF) {
		if (isalpha(ch)) {
			ch= tolower(ch);
			++cnt[ch - 'a'];
		}
	
}
	for (int i = 0; i < 26; i++) {
		printf("%c : %d\n", i + 'a', cnt[i]);
	}



    return 0;
}

Measured memory_bytes: 3192
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (sort)

main :: IO ()
main = do
  [n, k] <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  ps <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  print . sum . take k . sort $ ps

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


Measured memory_bytes: 4608
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (1e+18) + 7;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-6;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

ll mod_pow(ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%mod;
		a = a * a%mod; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 20;
modint fact[max_n], factinv[max_n];
void init() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}

void solve() {
	int n, k; cin >> n >> k;
	vector<ll> a(n);
	rep(i, n) {
		ll x; cin >> x;
		a[i] = x;
	}
	sort(a.begin(), a.end());
	modint ans = 0;
	rep(i, n) {
		int le = i;
		ans += (modint)a[i] * comb(le, k - 1);
		int ri = n - 1 - le;
		ans -= (modint)a[i] * comb(ri, k - 1);
	}
	cout << ans << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(7);
	init();
	//int t; cin >> t; rep(i, t)solve();
	solve();
	//stop
		return 0;
}


Measured memory_bytes: 17408
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int W = sc.nextInt();
		int H = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		int r = sc.nextInt();
		if ((x >= r && y >= r) && (W >= x + r && H >= y + r)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 26420
/* Question 1
Queue using array
Abhishek Trivedi
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string wa;
    
    long int t,j,i,k,l,n;
    cin>>wa;
    n=wa.length();
    if(wa[n-1]!='s')
    cout<<wa<<"s";
    if(wa[n-1]=='s')
    cout<<wa<<"es";
    
}

Measured memory_bytes: 3624
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const X = BigInt(arg[0].split(" ")[0]);
    let now = 100;
 	let cnt = 0;
  
    while(BigInt(now) < X) {
      now += Math.floor(now * 0.01);
      cnt++;
    }
    
    console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 29836
N=int(input())
A=[0]+list(map(int,input().split()))

Dic1={}
set1=set()
for i in range(1,N+1):
    temp=i-A[i]
    if temp in set1:
        Dic1[temp]=Dic1[temp]+1
    else:
        Dic1[temp]=1
        set1.add(temp)

#print(Dic1)

Dic2={}
set2=set()
for j in range(1,N+1):
    temp=j+A[j]
    if temp in set2:
        Dic2[temp]=Dic2[temp]+1
    else:
        Dic2[temp]=1
        set2.add(temp)

#print(Dic2)


ans=0
for k in range(len(set1)):
    now=set1.pop()
    if now in set2:
        ans+=Dic1[now]*Dic2[now]

print(ans)




        



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

int main() {
  int a[3];
  rep(i, 3) cin >> a[i];
  sort(a, a + 3);
  int ans = a[0] + a[1];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3640
#define _CRT_SECURE_NO_WARNINGS

/* include ***********************/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

/* define *************************/
//for
#define REP(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define REPS(i,n) for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define RREPS(i,n) for(int i=(int)(n);i>0;i--)
#define FOR(i,s,n) for(int i=(int)(s),i##_len=(int)(n);i<i##_len;i++)
#define RFOR(i,s,n) for(int i=(int)(n)-1,i##_len=(int)(s);i>=i##_len;i--)

//printf
#define PRINTD(d) printf("%d\n",(d))
#define PRINTL(d) printf("%lld\n",(d))

//memset
#define m0(s) memset(s,0,sizeof(s))
#define ml(s) memset(s,63,sizeof(s))
#define fill(s,c) memset(s,c,sizeof(s))

#define INF 1e9
#define MOD 1000000007

typedef long long ll;
typedef unsigned long long ull;

int diff[4][2] = {
	{ 0, -1 },
	{ -1, 0 },
	{ 1, 0 },
	{ 0, 1 },
};
//今回の変数
int n[1000][1000];
int v[1000][1000];

int Min(int a, int b) {
	return (a)<(b) ? (a) : (b);
}
int Max(int  a, int  b) {
	return (a) > (b) ? (a) : (b);
}
ll Minl(ll a, ll b) {
	return (a)<(b) ? (a) : (b);
}
ll Maxl(ll a, ll b) {
	return (a)>(b) ? (a) : (b);
}

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

	int ans = 0;
	REP(i, n+1) {
		if (i*r > n)break;
		REP(j, n+1) {
			if (i*r + j*g > n)break;
			if ((n - i * r - j * g)%b==0)ans++;
		}
	}
	PRINTD(ans);

}


Measured memory_bytes: 128
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define pye cout << "yes" << endl;
#define pno cout << "no" << endl;
#define pYe cout << "Yes" << endl;
#define pNo cout << "No" << endl;
#define pYE cout << "YES" << endl;
#define pNO cout << "NO" << endl;
#define prin(num) cout << num << endl;
#define INF 1000000000
#define MOD 1000000007
#define MAX 100001
#define NIL -1
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PA;
typedef priority_queue<ll> PQ;
typedef pair<double, double> doup;
//typedef vector<ll> vec;
//typedef vector<vec> mat;

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


int main() {
    string s;
    cin >> s;
    reverse(s.begin(), s.end());
    
    for(ll i=0; i<s.size();) {
        if(s.substr(i, 5)=="maerd") {
            i+=5;
        }else if(s.substr(i, 7)=="remaerd") {
            i+=7;
        }else if(s.substr(i, 5)=="esare") {
            i+=5;
        }else if(s.substr(i, 6)=="resare") {
            i+=6;
        }else {
            pNO;
            return 0;
        }
    }
    pYE;
    
}


Measured memory_bytes: 512
import fractions

N = int(input())
A = list(map(int, input().split()))

left = [0]*(N+1)
for i in range(1,N+1):
    left[i] = fractions.gcd(left[i-1],A[i-1])

right = [0]*(N+1)
right[N-1] = A[N-1]
for i in range(N-2,-1,-1):
    right[i] = fractions.gcd(right[i+1],A[i])

ans = 0
for i in range(N):
    ans = max(ans,fractions.gcd(left[i],right[i+1]))
print(ans)

Measured memory_bytes: 89580
# -*- coding: utf-8 -*-
"""
Pattern - Largest Rectangle in a Histogram
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_3_C&lang=jp

"""
import sys


def solve(heights):
    h_len = len(heights)
    left = [-1] * h_len
    right = [-1] * h_len
    stack = []
    for i in range(h_len):
        if not stack:
            left[i] = 0
        else:
            while stack and stack[-1][1] >= heights[i]:
                stack.pop()
            left[i] = stack[-1][0]+1 if stack else 0
        stack.append((i, heights[i]))

    stack = []
    for i in range(h_len-1, -1, -1):
        if not stack:
            right[i] = h_len
        else:
            while stack and stack[-1][1] >= heights[i]:
                stack.pop()
            right[i] = stack[-1][0] if stack else h_len
        stack.append((i, heights[i]))

    area = [h*(r-l) for h, l, r in zip(heights, left, right)]
    return max(area)


def main(args):
    _ = input()
    heights = [int(h) for h in input().split()]
    ans = solve(heights)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])



Measured memory_bytes: 25320
#include <stdio.h>

int main(){
	int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a==b && a!=c && b!=c){
    printf("Yes");
}
else if(a!=b && a==c && b!=c){
    printf("Yes");

}
else if(a!=b && a!=c && b==c){
    printf("Yes");
}
else {
    printf("No");
}
return 0;



} 

Measured memory_bytes: 1692
# -*- coding: utf-8 -*-
from collections import Counter


N = int(input())
p = {}

for _ in range(N):
    s = input()
    if s not in p.keys():
        p[s] = 1
    else:
        p[s] += 1

M = int(input())

for _ in range(M):
    t = input()
    if t not in p.keys():
        p[t] = -1
    else:
        p[t] -= 1

print(max(max(p.values()), 0))


Measured memory_bytes: 3316
#include<iostream>
#include<vector>
#include<cstring>

using namespace std;

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

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

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let kazu: usize = read();
    let mut vec= Vec::new();

    for x in 0..kazu {
        let ans2: i32 = read();
        vec.push(ans2);
    }
    let mut count1:i32=0;
    let mut finish =false;
    loop {
        for xx in 0..kazu {
            if (vec[xx] % 2 == 0) {
                vec[xx] = vec[xx] / 2;
            }else{
                finish=true;
                break;
            }
        }
        if (finish){
            break;
        }
        count1+=1;
    }

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

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type_a,class Type_b> void chmax(Type_a &a,const Type_b &b){if(a<b)a=b;}
template<class Type_a,class Type_b> void chmin(Type_a &a,const Type_b &b){if(a>b)a=b;}
template<class Type> Type igcd(Type x,Type y){if(x==0||y==0)return (x>y)?x:y;return (y%x)?igcd(y%x,x):x;}
template<class Type> Type ilcm(Type x,Type y){return x/igcd(x,y)*y;}
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	string s;
	cin>>s;
	
	REP(i,s.size()) cout<<'x';
	cout<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.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;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(RALL(a));
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        ans += (i % 2 ? -a[i] : a[i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
def resolve():
  n = int(input())
  plan = []
  for i in range(n):
    t, x, y = map(int, input().split())
    plan.append((t, x, y))

  t = 0
  x = 0
  y = 0

  for p in plan:
    time = p[0] - t
    l = abs(x - p[1]) + abs(y - p[2])
    if l > time or l % 2 != time % 2:
      print('No')
      return
    t, x, y = p

  print('Yes')

  return

if __name__ == "__main__":
  resolve()


Measured memory_bytes: 17352
N = input()
lst = []

for i in range(N):
    X, Y = map(int, raw_input().split())
    lst.append((X, Y))

if N % 2 != 0:
    print "NA"
    exit()

ansx = lst[0][0] + lst[N / 2][0]
ansy = lst[0][1] + lst[N / 2][1]

for i in range(N / 2):
    x = lst[i][0] + lst[i + N / 2][0]
    y = lst[i][1] + lst[i + N / 2][1]
    if x != ansx or y != ansy:
        print "NA"
        exit()

print str(ansx / 2.0) + " " + str(ansy / 2.0)


Measured memory_bytes: 4716
#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define POWER9 1000000000
#define MOD POWER9+7
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

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

	int N;
	cin >> N;
	LL ans = 0;
	for(int i=0; i<N; i++){
		LL tmp;
		cin >> tmp;
		ans += tmp-1;
	}
	cout << ans << endl;

	return 0;
}



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

int main()
{
    int n;
    scanf("%d",&n);
    multiset <int> is;
    for(int a,i=0; i<n; i++){
        scanf("%d",&a) ,a = 1e9-a;
        is.insert(a);
        auto it = is.upper_bound(a);
        if(it != is.end())
            is.erase(it);
    }
    printf("%d\n",is.size());
}


Measured memory_bytes: 4992
package main

import "fmt"

func main() {
	var n, h, w int
	fmt.Scan(&n, &h, &w)
	cnt := 0
	for i := 0; i < n ;i++{
		var a, b int
		fmt.Scan(&a, &b)
		if(a >= h && b >= w) {
			cnt++
		}
	}
	fmt.Println(cnt)
}


Measured memory_bytes: 1980
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new java.util.Scanner(System.in);
		int[] array = new int[10];





		
		for(int i = 0; i < 10; i++){
			array[i] = scanner.nextInt();
		}


		Arrays.sort(array);

		System.out.println(array[9]);
		System.out.println(array[8]);
		System.out.println(array[7]);


	}
}

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

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

using namespace std;

int main(){
	int n,k,x[100]; cin>>n>>k;
	rep(i,n) cin>>x[i];

	int ans=0;
	rep(i,n) ans+=2*min(x[i],k-x[i]);
	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#include <bitset>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using pii = pair<int,int>;
ll dp[123456];
int main(){
    ll k;
    cin >> k;
    memset(dp,-1,sizeof(dp));
    dp[1] = 1;
    deque<ll>q;
    q.push_front(1);
    while(!q.empty()){
        ll x = q.front();
        q.pop_front();
        if(dp[x * 10 % k] == -1 or dp[x * 10 % k] > dp[x]){
            dp[x * 10 % k] = dp[x];
            q.push_front(x * 10 % k);
        }
        if(dp[(x + 1) % k] == -1 or dp[(x + 1) % k] > dp[x] + 1){
            dp[(x + 1) % k] = dp[x] + 1;
            q.push_back((x + 1) % k);
        }
    }
    cout << dp[0] << endl;
}

Measured memory_bytes: 1664
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <vector>
using namespace std;
const int maxn=1e5+5;


int main(){
	ios::sync_with_stdio(false);
	int n;
	while(cin>>n){
		int flag=0;
		for(int i=0;i<30&&n-i*4>=0;i++){
			int temp=n-i*4;
			if(temp%7==0){
				flag=1;break;
			}
		} 
		if(flag) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	
	} 
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,m;
int main()
{
	cin>>n>>m;
	vector<vector<int> >a(n,vector<int>(m));
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			cin>>a[i][j];
		}
	}
	vector<int>y1,x1,y2,x2;
	for(int i=0;i<n-1;i++)
	{
		for(int j=0;j<m;j++)
		{
			if(a[i][j]%2==1)
			{
				a[i+1][j]++;
				a[i][j]--;
				y1.push_back(i);
				x1.push_back(j);
				y2.push_back(i+1);
				x2.push_back(j);
			}
		}
	}
	for(int j=0;j<m-1;j++)
	{
		if(a[n-1][j]%2==1)
		{
			a[n-1][j+1]++;
			a[n-1][j]--;
			y1.push_back(n-1);
			x1.push_back(j);
			y2.push_back(n-1);
			x2.push_back(j+1);
		}
	}
	cout<<y1.size()<<endl;
	for(int i=0;i<y1.size();i++)
	{
		cout<<y1[i]+1<<' '<<x1[i]+1<<' '<<y2[i]+1<<' '<<x2[i]+1<<endl;
	}
	return 0;
}

Measured memory_bytes: 5224
#レベルNのバーガーには2**(N+1)-1枚のパティ、2**(N+1)-2枚のバン

N,X=map(int,input().split())

def F(N,X):
  if N==0 and X==1:
    return 1
  elif N==0 and X==0:
    return 0
  elif N!=0 and X==1:
    return 0
  else:
    if 1<X<2**(N+1)-1:
      return F(N-1,X-1)
    elif X==2**(N+1)-1:
      return 2**N
    elif 2**(N+1)-1<X<2**(N+2)-3:
      return 2**N+F(N-1,X-(2**(N+1)-1))
    elif X==2**(N+2)-3:
      return 2**(N+1)-1
print(F(N,X))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


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

  if(S[0] == S[1] || S[1] == S[2] || S[2] == S[3]) cout << "Bad" << endl;
  else cout << "Good" << endl;
  
  return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
  int k;
  string s;
  cin >> k >> s;
  if (s.size() > k) s = s.substr(0, k) + "...";
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 3632
<?php
$stdin = trim(fgets(STDIN));
$array = explode(" ", $stdin);
 
$n = (int) $array[0];
 
$x =  (int) $array[1];
 
$tako = $n / $x;
 
$tako = ceil($tako);
 
$t = (int) $array[2];
 
$ans = $tako * $t;

echo $ans;
?>

Measured memory_bytes: 16092
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds;
using namespace std;
#define F first
#define S second
#define pb push_back
#define powerof2 ()
using ll = long long;
const ll M = 1000000007;
using vl = vector<ll>;
using pll =  pair<ll,ll>;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag, tree_order_statistics_node_update> is;


void answer(){
    int a,b,c;cin>>a>>b>>c;
    if(b-a==c-b)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
}
 
 
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //int q;
    answer();
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<functional>
#include<string>
#include<cstring>
#include<cmath>
#include<sstream>
using namespace std;
int  main()
{
	int h,p,q;
	int n,m,a;
	while(cin>>n>>m>>a,n)
	{
		int num[1002][102];
		for(int i=0;i<1002;i++)
		{
			for(int j=0;j<102;j++)
			{
				num[i][j]=-1;
			}
		}
		int maxh=0;
		for(int i=0;i<m;i++)
		{
			cin>>h>>p>>q;
			num[h][p-1]=q-1;
			num[h][q-1]=p-1;
			maxh=max(h,maxh);
		}
		int ans=a-1;
		for(int i=maxh;i>=0;i--)
		{
			for(int j=0;j<n;j++)
			{
				if((num[i][j]==ans)||num[i][ans]==j)
				{
					ans=j;
					//cout<<ans<<endl;
					break;
				}
			}
		}
		cout<<ans+1<<endl;
		}
		return 0;
	}

Measured memory_bytes: 1560
n = int(input())
t = list(map(int, input().split()))
a = list(map(int, input().split()))
mod = 10**9+7
ans = 1
if n == 1 and t != a:
    print(0)
    exit()
for i in range(1,n-1):
    if t[i-1] == t[i] and a[i] == a[i+1]:
        ans = (ans*min(t[i],a[i]))%mod
    elif t[i-1] < t[i] and t[i] > a[i]:
        print(0)
        exit()
    elif a[i] > a[i+1] and t[i] < a[i]:
        print(0)
        exit()
print(ans)


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

#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (a); i >= (int)(b); i--)
#define all(x) (x).begin(), (x).end()
using i32 = int32_t;
using i64 = int64_t;
using f32 = float;
using f64 = double;
using P   = pair<int, int>;

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

template <class T>
void dump_vec(const vector<T>& v) {
    auto len = v.size();
    rep(i, 0, len) {
        cout << v[i] << (i == (int)len - 1 ? "\n" : " ");
    }
}

struct FastIO {
    FastIO() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} FASTIO;

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

i64 gcd(i64 x, i64 y) {
    return y == 0 ? x : gcd(y, x % y);
}

i64 lcm(i64 x, i64 y) {
    return x / gcd(x, y) * y;
}
//---------------------------------------------------------------------------------------------------

signed main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, 0, N) {
        cin >> A[i];
    }
    auto ans = A[0];
    rep(i, 1, N) {
        ans = lcm(ans, A[i]);
    }
    cout << ans << "\n";
}



Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
using namespace std;

long long A, B, C, D, E, F;
long long ans_water = 0, ans_sugar = 0;

//0で初期化するとwater = 0となり1つだけWAとなる
double max_percentage = -1;
bool visit[3001][3001];

void DFS(long long water, long long sugar) {
    //F以下でないとダメ
    if (water + sugar > F)
        return;

    //溶け残ったらダメ
    if (water / 100 * E < sugar)
        return;

    //訪問フラグ
    if (visit[water][sugar]) {
        return;
    }

    //作った砂糖水の濃度
    if (water != 0) { //0除算を避ける
        double tmp = 100.0 * sugar / (100.0 * water + sugar);

        if (tmp > max_percentage) {
            max_percentage = tmp;
            ans_water = water;
            ans_sugar = sugar;
        }
    }
    visit[water][sugar] = true;

    //操作1
    DFS(water + 100 * A, sugar);
    //操作2
    DFS(water + 100 * B, sugar);
    //操作3
    DFS(water, sugar + C);
    //操作4
    DFS(water, sugar + D);
}

int main()
{
    cin >> A >> B >> C >> D >> E >> F;

    DFS(0, 0);

    //if (ans_water != 0)
        cout << ans_water + ans_sugar << " " << ans_sugar << endl;
    //else 
        //cout << 0 << " " << 0 << endl;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,ma,mi;
  cin >>n;
  ma =0;
  mi =1<<30;
  for(int i =0;i<n;i++){
    int a;
    cin >> a;
    ma = max(a,ma);
    mi = min(a,mi);
  }
  cout << ma -mi;
}

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

using namespace std;

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

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn  = 3e6;//AmShZ
const ll mod =1e9+7;
const ld PI = acos((ld)-1);

#define pb(x) push_back(x);
#define endl '\n'
#define dokme(x) cout << x ;  return(0);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ms(x , y) memset(x , y , sizeof x);
ll pw(ll a, ll b, ll md = mod) {
    ll res = 1;while(b){if(b&1){res=(a*res)%mod;}a=(a*a)%mod;b>>=1;}return(res);
}

int h , w , k;
int white[20][2000];

bool chk(int msk , int last , int cur){
    int lr = 0;
    for(int i = 0 ; i < h ; i ++){
        if(msk>>i&1 or i == h-1){
            int cnt = white[i+ 1][cur+1] - white[i+1][last] + white[lr][last] - white[lr][cur+1];
            if(cnt > k){
                return(0);
            }
            lr= i+1;
        }
    }
    return(1);
}

int solve(int last ,int msk ){
    if(chk(msk , last , w - 1)){
        return(0);
    }
    if(!chk(msk , last ,last)){
        return(1e9);
    }
    int cur = last;
    for(int i =  (1 << 15)  ; i > 0 ; i>>=1){
        if(cur + i >= w){
            continue;
        }
        if(!chk(msk , last , cur + i)){
            continue;
        }
        cur+=i;
    }
    return(solve(cur + 1 , msk) + 1);
}

int main(){
    migmig
    cin >> h >> w >> k;
    for(int i = 0 ; i < h ; i ++){
        string s;
        cin >> s;
        for(int j = 0 ; j < w ; j ++){
            white[i+1][j+1] = (s[j] == '1');
        }
    }
    for(int i = 0 ; i <= h; i ++){
        for(int j = 1 ; j <= w ; j ++ ){
            white[i][j]+=white[i][j-1];
        }
    }
    for(int j = 0 ; j <= w ; j ++){
        for(int i = 1 ; i <= h ; i ++ ){
            white[i][j]+=white[i - 1][j];
        }
    }
    int ans= 1e9;
    for(int i = 0 ; i < (1 << (h-1)) ; i ++){
        int res = solve(0 , i) + __builtin_popcount(i);
        ans =min(ans , res);
    }
    cout << ans;
    return(0);
}

//When we hit our lowest point, we are open to the greatest change.
//If I try, I fail. If I don't try, I'm NEVER GOING TO GET IT.
//Sometimes, life is like this dark tunnel. You can't always see the light at the end of the tunnel. But if you just keep moving... you will come to a better place.
//It is important to draw wisdom from diffrent places. If you take it from only one place it becomes rigid and stale.
//kuxtal jach uts chuchul u u páajtal máak jach táaj meyajilo'ob le castigadas tumen ch'aik descansos.


Measured memory_bytes: 384
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		Integer[] a = new Integer[n];
		List<Integer> alice = new ArrayList<Integer>();
		List<Integer> bob = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			a[i]=scan.nextInt();
		}
		int countAli=0;
		int countBob=0;
		Arrays.sort(a,Collections.reverseOrder());
		for(int i=0;i<n;i++) {
			if(i%2==0) {
				alice.add(a[i]);
				countAli = countAli + a[i];
			}else {
				bob.add(a[i]);
				countBob = countBob+a[i];
			}
		}
		//System.out.println(alice);
		//System.out.println(bob);
		System.out.println(countAli-countBob);

	}

}


Measured memory_bytes: 21844
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

using ll = long long;

ll N, M;
std::vector<ll> vs[8];

int main()
{
  scanf( "%lld%lld", &N, &M );

  rep( i, N )
  {
    ll x, y, z;
    scanf( "%lld%lld%lld", &x, &y, &z );

    rep( j, 2 ) rep( k, 2 ) rep( l, 2 )
      vs[j|(k<<1)|(l<<2)].push_back( pow(-1,j)*x+pow(-1,k)*y+pow(-1,l)*z );
  }

  rep( j, 8 )
    std::sort( vs[j].rbegin(), vs[j].rend() );

  ll ans = 0;
  rep( j, 8 )
  {
    ll sum = 0;

    rep( i, M )
      sum += vs[j][i];

    ans = std::max( ans, sum );
  }

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

  return 0;
}

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

string s1, s2, t;

int main()
{
    cin >> s1 >> s2;
    int a, b;
    cin >> a >> b;
    cin >> t;
    if(t == s1) a--;
    else b--;
    cout << a << " " << b << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>

using namespace std;

typedef long long ll;

int main(int argc, char **argv)
{
    string S;
    cin >> S;

    int len = S.length();
    int start = 0;
    int end = len;
    for (int i = start; i < len / 2; ++i) {
        if (S[i] != S[end - 1 - i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    start = 0;
    len = (len - 1) / 2;
    end = len;
    for (int i = start; i < len / 2; ++i) {
        if (S[i] != S[end - 1 - i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    start = ((S.length() + 3) / 2) - 1;
    len = (S.length() - (S.length() + 3) / 2) + 1;
    end = S.length();
    for (int i = 0; i < len / 2; ++i) {
        if (S[start + i] != S[end - 1 - i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 256
from collections import Counter
n = int(input())
s = input()
flag = True
if len(set(s))<=2:
    print(0)
    flag = False
if flag:
    r = [i+1 for i in range(n) if s[i]=='R']
    b = [i+1 for i in range(n) if s[i]=='B']
    g = [i+1 for i in range(n) if s[i]=='G']
    minus = 0
    def cnt_cmb(a, b, c):
        cnt = 0
        set_c = set(c)
        for i in a:
            for j in b:
                if (i+j)/2 in set_c:
                    cnt += 1
        return cnt
    minus +=cnt_cmb(r, b, g)
    minus += cnt_cmb(b, g, r)
    minus += cnt_cmb(g, r, b)
    a = Counter(s)
    rslt = 1
    for value in a.values():
        rslt *= value
    print(rslt-minus)

Measured memory_bytes: 9580
import datetime

num2wd={0:"Monday",1:"Tuesday",2:"Wednesday",3:"Thursday",4:"Friday",5:"Saturday",6:"Sunday"}

while True:
    m,d=[int(i) for i in input().split(" ")]
    if m==0 and d==0:
        break

    date=datetime.datetime(2004,m,d)
    print(num2wd[date.weekday()])



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

int main() {
    std::ios_base::sync_with_stdio(false);
    cin.tie(0);
	string s;
	cin >> s;
	bool is_a = false, is_b = false;
	for (char c : s) {
		if (c == 'A')
			is_a = true;
		if (c == 'B')
			is_b = true;
	}
	if (is_a && is_b)
		cout << "Yes";
	else
		cout << "No";
	cout << "\n";
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
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; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int h, n;
  cin >> h >> n;
  vector<int> a(n), b(n);
  rep(i, n) cin >> a[i] >> b[i];
  vector<int> dp(h+1, INF);
  dp[0] = 0;
  for (int i = 1; i <= h; i++) {
    rep(j, n) {
      int idx = max(i-a[j], 0);
      chmin(dp[i], dp[idx]+b[j]);
    }
  }
  cout << dp[h] << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  double t, x; cin >> t >> x;
  cout << fixed << setprecision(15) << t / x << '\n';
}

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

using namespace std;

int main(){
  int N;
  cin >> N;
  string W[N];
  int i;
  for(i = 0; i < N;i++){
    cin >> W[i];
    for(int j = 0;j < i;j++){
      if(W[j] == W[i]){
        cout << "No" << endl;
        return 0;
      }
    }
  }

  for(i = 0;i < N-1;i++){
    if(W[i].back() != W[i+1].front()){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;

}


Measured memory_bytes: 256
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;

int main() {
  ll H;
  cin >> H;

  ll ans = 0;
  ll count = 1;

  while (H > 0) {
    ans += count;
    H /= 2;
    count *= 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll h, w, k, a[1000][1000], si, sj;
string s;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	cin >> h >> w >> k;
	rep(i, 1, h){
		string buf;
		cin >> buf;
		rep(j, 1, w){
			a[i][j] = (buf[j-1] == '#')? -1 : h*w;
			if(buf[j-1] == 'S'){si = i; sj = j;}
		}
	}
	
	queue<P> q;
	q.push(P(si, sj));
	a[si][sj] = 0;
	//rep(i, 1, h){rep(j, 1, w){cout << a[i][j];}cout << endl;}
	while(!q.empty()){
		ll ai = q.front().first;
		ll aj = q.front().second;
		q.pop();
		if(a[ai][aj] + 1 < a[ai-1][aj] && a[ai][aj] + 1 <= k){
			a[ai-1][aj] = a[ai][aj] + 1;
			q.push(P(ai-1, aj));
		}
		if(a[ai][aj] + 1 < a[ai+1][aj] && a[ai][aj] + 1 <= k){
			a[ai+1][aj] = a[ai][aj] + 1;
			q.push(P(ai+1, aj));
		}
		if(a[ai][aj] + 1 < a[ai][aj-1] && a[ai][aj] + 1 <= k){
			a[ai][aj-1] = a[ai][aj] + 1;
			q.push(P(ai, aj-1));
		}
		if(a[ai][aj] + 1 < a[ai][aj+1] && a[ai][aj] + 1 <= k){
			a[ai][aj+1] = a[ai][aj] + 1;
			q.push(P(ai, aj+1));
		}
	}
	
	//rep(i, 1, h){rep(j, 1, w){cout << a[i][j] << " ";}cout << endl;}
	ll ans = h*w;
	rep(i, 1, h){
		rep(j, 1, w){
			if(a[i][j] != -1 && a[i][j] != h*w){
				ll ansbuf = 1+min(min((i-1+k-1)/k, (h-i+k-1)/k), min((j-1+k-1)/k, (w-j+k-1)/k));
				ans = min(ansbuf, ans);
			}
		}
	}
	print(ans);
	return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;

const int inf = 1e9;
const ll linf = 1e18;
const ll mod = 1e9 + 7;

int dp[101][101][301];

int main()
{
  int n, W;
  cin >> n >> W;

  vi w(n), v(n);
  rep(i, n) cin >> w[i] >> v[i];

  int wb = w[0];
  rep(i, n) w[i] -= wb;

  memset(dp, -1, sizeof(dp));
  dp[0][0][0] = 0;

  int ans = 0;
  rep(i, n) rep(j, i+1) rep(k, 3*n+1){
    if(dp[i][j][k] == -1) continue;
    dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k]);
    if(wb*(j+1) + k+w[i] <= W){
      dp[i+1][j+1][k+w[i]] = max(dp[i+1][j+1][k+w[i]], dp[i][j][k] + v[i]);
      ans = max(ans, dp[i+1][j+1][k+w[i]]);
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 12288
#include<bits/stdc++.h>
#define rush() int T;scanf("%d",&T);int kase=1;while(T--)
#define all(x) (x).begin(),(x).End()
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)<(y)?(x):(y))
#define pb(x) push_back(x)
#define mem(a) memset(a,0,sizeof(a))
using namespace std;
using std::bitset;
typedef long long ll;
const ll maxn=1e6+5;
const ll mod=998244353;
const ll INF=0x3f3f3f3f3f3f3f3f;
const long double PI=acos(-1.0);
const long double eps=1e-5;
inline ll read(){ll ans=0,flag=1;char c;c=getchar();while(c<'0' || c>'9'){if(c=='-')flag=-1;c=getchar();}while(c>='0' && c<='9'){ans=ans*10+(ll)(c-'0');c=getchar();}return ans*flag;}
ll quickpow(ll x,ll y,ll mod){ll ans=1;while(y){if(y&1)ans=ans*x%mod;x=x*x%mod;y>>=1;}return ans;}

double a[200005];

int main()
{
    int n,k;
    cin>>n>>k;
    int x;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        a[i]=(x+1.0)/2.0;
    }
    for(int i=1;i<n;i++)
    {
        a[i]=a[i]+a[i-1];
    }
    double ans=a[k-1];
    for(int i=1;k+i-1<n;i++)
    {
        double t=a[k+i-1]-a[i-1];
        if(t>ans)
            ans=t;
    }
    printf("%.12lf\n",ans);
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <cstdlib>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int INF=0x3f3f3f3f;
const int MAXN=1e5+5;
int t[MAXN],m[MAXN];

int main()
{
    int x,n;
    while(scanf("%d%d",&x,&n)!=EOF)
    {
        vector<PII> events;
        int tmp;
        for(int i=0;i<n;i++)
        {
            scanf("%d",&tmp);
            events.emplace_back(tmp,-1);
        }
        int q; scanf("%d",&q);
        for(int i=0;i<q;i++)
        {
            scanf("%d%d",&t[i],&m[i]);
            events.emplace_back(t[i],i);
        }
        sort(events.begin(),events.end());
        int dir=-1,a=0,ya=0,b=x,yb=x,t0=0;
        for(auto event:events)
        {
            int t=event.first;
            if(t0<t)
            {
                int dt=t-t0;
                if(dir==-1)
                {
                    if(ya>=dt)
                    {
                        ya-=dt;
                        yb-=dt;
                    }else if(yb<dt)
                    {
                        a=ya=b=yb=0;
                    }else
                    {
                        a+=dt-ya;
                        ya=0;
                        yb-=dt;
                    }
                }else
                {
                    if(yb+dt<=x)
                    {
                        ya+=dt;
                        yb+=dt;
                    }else if(ya+dt>x)
                    {
                        a=b=0;
                        ya=yb=x;
                    }else
                    {
                        b-=(dt-x+yb);
                        yb=x;
                        ya+=dt;
                    }
                }
            }
            t0=t;
            int id=event.second;
            if(id!=-1)
            {
                if(m[id]<a) printf("%d\n",ya);
                else if(m[id]>b) printf("%d\n",yb);
                else printf("%d\n",ya+m[id]-a);
            }else
            {
                dir*=(-1);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3696