akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cmath>
#include<deque>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<tuple>
#include<utility>
#include<vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<vector<int>> vvi;

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define REP(i, n)  for(int i=0; i<(int)(n); i++)
#define REPS(i, n)  for(int i=1; i<=(int)(n); i++)
#define PER(i, n) for(int i=(int)(n)-1; i>= 0; i--)
#define PERS(i, n)  for(int i=(int)(n); i>0; i--)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define RFOR(i, c)  for(__typeof((c).rbegin()) i=(c).rbegin(); i!=(c).end(); i++)
#define ALL(container)  (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) (container).size()
#define FILL0(n)  setfill('0') << right << setw(n)
#define mp(a, b)  make_pair(a, b)
#define toLower(c)  c+0x20
#define toUpper(c)  c-0x20
#define pb  push_back
#define eb  emplace_back

const int INF = 1e9;
const long long LLINF = 1e18;
const ll MOD = 1000000007;
const int MSIZE = 100007;
const double Pi = 3.14159265358979323146;

int main(){
  string s, t; cin >> s >> t;
  REP(i, s.length()){
    if(s[i]!=t[i]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 3604
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
#define mul(a,b) a=(a*b)%mod
#define N 500010
ll fac[N],inv[N],ivf[N];
ll C(ll n,ll k){
    return fac[n]*ivf[n-k]%mod*ivf[k]%mod;
}
ll P(ll n,ll k){
    return fac[n]*ivf[n-k]%mod;
}
ll po(ll x,ll y){
    ll res=1;
    for(;y;y>>=1){
	if(y&1)res=res*x%mod;
	x=x*x%mod;
    }
    return res;
}

vector<ll> g[N];
ll ans,n,k;
void dfs(ll x,ll from,bool root){
    ll c=0;
    for(auto y:g[x])if(y!=from){
	c++;
	dfs(y,x,0);
    }
    ans=ans*P(k-2+root,c)%mod;
}

int main(){
    fac[0]=ivf[0]=inv[1]=1;
    for(int i=1;i<N;i++){
	if(i>1)inv[i]=(mod-mod/i*inv[mod%i]%mod)%mod;
	fac[i]=fac[i-1]*i%mod;
	ivf[i]=ivf[i-1]*inv[i]%mod;
    }
     
     cin>>n>>k;
     for(int i=0;i<n-1;i++){
	 ll a,b;cin>>a>>b;
	 g[a].push_back(b);
	 g[b].push_back(a);
     }
     ans=k;
     dfs(1,0,1);
     cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 31488
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
constexpr int INF = 0x3f3f3f3f; constexpr ll LLINF = 0x3f3f3f3f3f3f3f3f;
#define db(x) { cerr << #x << " = " << x << endl; }
template <typename T> void _dbarr(T* a, size_t sz){ for(int i = 0; i < sz; i++) cerr << a[i] << " \n"[i == sz-1]; }
template <typename T> void _dbarr(vector<T> a, size_t sz){ for(int i = 0; i < sz; i++) cerr << a[i] << " \n"[i == sz-1]; }
#define dbarr(x, n) {cerr << #x << ": "; _dbarr((x),(n));}
#define all(x) begin(x), end(x)
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define fs first
#define sn second

int main(){
	cin.tie(0)->sync_with_stdio(0);
	//freopen("in.txt","r", stdin);
    int a;
    cin >> a;
    cout << a + a*a + a*a*a << "\n";
}


Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>

 int main() {

	 int n = 0;
	 int a[3];
	 std::cin >> n;


	 while (std::cin>>a[0]>>a[1]>>a[2]) {

			 std::sort(a, a + 3);

			 if (a[2] * a[2] == a[1] * a[1] + a[0] * a[0]) {
				 std::cout << "YES" << std::endl;
			 }
			 else {
				 std::cout << "NO" << std::endl;
			 }

			 for (int d = 0; d < 3; ++d) {
				 a[d] = 0;
			 }
		
	 }

}

Measured memory_bytes: 3004
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
#include <algorithm>
#include <iomanip>
using namespace std;

int main(){
  double L, line, ans ;
  int block = 0, check;
  cin >> L ;
  line = L / 3 ;
  ans = line * line * line ;
  cout << fixed ;
  cout << setprecision(10) << ans << endl ;
  return 0 ;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int a,b,c,aa[110000],cnt=0;
string s,ss;
signed main()
{
	cin>>a;
	if(a%2==0){
		cout<<a/2-1;
	}else{
		cout<<a/2;
	}
}

Measured memory_bytes: 256
// https://atcoder.jp/contests/abc162/tasks/abc162_a

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;

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

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

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

void solve() {
  string S;
  cin >> S;

  if (any_of(all(S), [](char c) { return c == '7'; })) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
}


Measured memory_bytes: 3640
use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    let n: i32 = s.trim().parse().unwrap();

    let mut apart: Vec<Vec<Vec<i32>>> = vec![];
    for i in 0..4 {
        apart.push(vec![]);
        for j in 0..3 {
            apart[i].push(vec![]);
            for _ in 0..10 {
                apart[i][j].push(0);
            }
        }
    }
    for _ in 0..n {
        let (b, f, r, v) = input();
        apart[b - 1][f - 1][r - 1] += v;
    }
    for i in 0..4{
        for j in 0..3{
            for k in 0..10{
                print!(" {}", apart[i][j][k]);
            }
            println!("");
        }
        if i < 3{
            println!("####################");
        }
    }
}

fn input() -> (usize, usize, usize, i32) {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    let mut iter = s.trim().split_whitespace();

    let b: usize = iter.next().unwrap().parse().unwrap();
    let f: usize = iter.next().unwrap().parse().unwrap();
    let r: usize = iter.next().unwrap().parse().unwrap();
    let v: i32 = iter.next().unwrap().parse().unwrap();

    (b, f, r, v)
}


Measured memory_bytes: 5036
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007 //S(vector).size()
#define MAX 100005
#define NIL -1
using namespace std;
typedef long long ll;

int main(void){
	int n;
	cin >> n;
	vector<int> x(n), y(n), h(n);
	rep(i, n) cin >> x[i] >> y[i] >> h[i];

	for(int posX = 0; posX <= 100; posX++){
		for(int posY = 0; posY <= 100; posY++){
			int tmp = -1;
			int tmp2 = -1;
			bool  flag = true, jud = true;
			for(int i = 0; i < n; i++){
				if(h[i] != 0) tmp = h[i] + abs(posX - x[i]) + abs(posY - y[i]);

				if(tmp != -1 && tmp2 == -1) tmp2 = tmp;
				else {
					if(tmp != tmp2) flag = false;
				}
			}

			if(!flag) continue;

			for(int i = 0; i < n; i++){
				if(h[i] == 0){
					int dist = abs(posX - x[i]) + abs(posY - y[i]);

					if(dist < tmp2) jud = false;
				}
			}
			if(jud) cout << posX << " " << posY << " " << tmp2;
		}
	}

	return 0;
}


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

using namespace std;

const int MOD = 1e9 + 7;

char s[3005];
long long dp[3005][3005], ps[3005];

int main() {
	int n;
	scanf("%d", &n);
	scanf("%s", s);
	
	dp[1][1] = 1LL;
	ps[1] = 1LL;
	for (int i = 2; i <= n; i++) {
		for (int j = 1; j <= i; j++) {
			if (s[i - 2] == '<') {
				//1 ~ j - 1
				dp[i][j] = (dp[i][j] + ps[j - 1]) % MOD;
			}
			else{
				//j ~ i - 1
				dp[i][j] = (dp[i][j] + ps[i - 1] - ps[j - 1] + MOD) % MOD;
			}
		}
		for (int j = 1; j <= i; j++) ps[j] = (ps[j - 1] + dp[i][j]) % MOD;
	}
	
	long long res = 0;
	
	for (int i = 1; i <= n; i++) res = (res + dp[n][i]) % MOD;
	
	printf("%lld\n", res);
}


Measured memory_bytes: 69120
'''fujioka_1115
底面がa*a、高さがbの直方体の容器に水がx入っている。
水を溢れさせずに容器を（正方形の1辺を軸として）傾けるとき、
最大で何度傾けられるか？　⇒絵を描いて考える。
底面が正方形なので、3次元ではなく、2次元で考える。
立体的に3次元としての水の体積xではなく、
横から2次元として見た水の面積x/aで考える。
奥行であるaで割って、2次元とする。なるべく、シンプルに考える。
x/a=(a*b)/2の時に、水面は容器の角にある。面積は三角形。
傾けた時、水面が側面にある場合(水の面積が台形)と
底面にある場合(水の面積が三角形)で場合分け。
つまり、水量xと容器の形状から求められる(a^2b)/2の大小で場合分け。
tanの逆関数がarctanを使う。
仰角Θ=arctan(対辺/底辺)
'''
import math
a,b,x=[int(s) for s in input().split()]
if x>a*a*b/2:#上記の場合分け
#水が多いので、傾けた側の反対側で水面が側面に接している。
  h=2*(a*a*b-x)/(a*a)
  print(math.degrees(math.atan(h/a)))#弧度法から角度へ変換する
else:
#水が少ないので、傾けた側面に隣接する底面に水面が接している。
  k=2*x/(a*b)
  print(math.degrees(math.atan(b/k)))

Measured memory_bytes: 3188
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define FLSH fflush(stdout)
#define ll long long int
#define pb push_back
#define mp make_pair
#define in insert
#define MOD 1000000007
#define debug(x) cout << "[ " << #x  << " : " << x << " ]" << endl;

using namespace std;

int main(){

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

	int k,a, b, i;
	cin >> k >> a >> b;
	for (i = a; i <= b; ++i)
	{
		if(i%k == 0)
			break;
	}

	if(i == b+1){
		cout << "NG" << endl;
	}
	else
		cout << "OK" << endl;

}

Measured memory_bytes: 3636
#include <iostream>

 

using namespace std;

 

int main()
{
    int a, b;
    
    cin >> a >> b;
    if (a > b)
      cout << "a > b" << endl;
    else if (a < b)
      cout << "a < b" << endl;
    else
      cout << "a == b" << endl;
   
    return 0;
}


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

int main() {
  int N; cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  int idx = 1;
  for (int i = 0; i < N; i++) {
    if (A.at(i) == idx) idx++;
  }
  if (idx == 1) cout << -1 << endl;
  else cout << N - idx + 1 << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
using namespace std;
int n, a[100002],b[100002],c[100002],i,j,k,l;
long long nr12,nr,nr1;
int cautbin1 (int x)
{
    int st=1,dr=n,mij,m=0;
    while(st<=dr)
    {
        mij=(st+dr)/2;
        if(a[mij]<x)
        {
            m=mij;
            st=mij+1;
        }
        else
        {
            dr=mij-1;
        }
    }
    return m;
}
int cautbin2(int x)
{
    int st=1,dr=n,mij,m=n+1;
    while(st<=dr)
    {
        mij=(st+dr)/2;
        if(c[mij]>x)
        {
            m=mij;
            dr=mij-1;
        }
        else
        {
            st=mij+1;
        }
    }
    return m;
}
int main()
{
    cin>>n;
    for(i=1;i<=n;i++) cin>>a[i];
    for(i=1;i<=n;i++) cin>>b[i];
    for(i=1;i<=n;i++) cin>>c[i];
    k=0;
    sort(a+1,a+n+1);
    sort(c+1,c+n+1);
    a[0]=b[0]=c[0]=-(1<<30);
    a[n+1]=1<<30;
    b[n+1]=1<<30;
    c[n+1]=1<<30;
    for(j=1;j<=n;j++)
    {
        i=cautbin1(b[j]);
        if(i==0) continue;
        if(i==n+1) i=n;
        l=cautbin2(b[j]);
        if(l==n+1) continue;
        if(l==0) l=1;
        nr=nr+1LL*i*(n-l+1);
    }
    cout<<nr;
    return 0;
}


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

using namespace std;

int main(){
    int N,count=0;
    cin >> N;
    int D[N][2];
    for(int i = 0;i < N;i++){
        cin >> D[i][0] >> D[i][1];
        if(D[i][0]==D[i][1])count++;
        else if(count<3 && D[i][0]!=D[i][1])count = 0;
    }
    if(count>=3)cout << "Yes" << "\n";
    else cout << "No" << "\n";
}

Measured memory_bytes: 3628
def cf(x1,x2):
    cf=[1]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

A,B,K=map(int,input().split())
print(cf(A,B)[-K])

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

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for(int (i) = (n); (i) >= 0; --(i))
#define FOR(i, n, m) for(int (i) = (n); (i) < (m); ++(i))

// constexpr int INF = 1e9;
constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;


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

  auto jou = [](ll x){
    return x*x*x*x*x;
  };

  int left = -2000, right = 2000;
  FOR(i, left, right){
    FOR(j, left, right){
      if((jou(i) - jou(j)) == X){
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3536
#include <bits/stdc++.h>
#define N 100050
#define INF (1<<29)
using namespace std;
inline int rd() {
    int x=0,f=1;char ch=getchar();
    while (ch>'9'||ch<'0') {if(ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
    return x*f;
}

int a[N],b[N],n,k,tot;
vector<int> E[N];

void dfs(int u,int f,int d) {
    if (d > k/2) return ;
    tot++;
    for (int i=0;i<(int)E[u].size();i++) {
        int v = E[u][i];
        if (v == f) continue;
        dfs(v,u,d+1);
    }
}

int main() {
    n = rd(), k = rd();
    for (int i=1;i<n;i++) {
        int u = rd(), v = rd();
        a[i] = u, b[i] = v;
        E[u].push_back(v);
        E[v].push_back(u);
    }

    int ans = INF;
    if (k%2 == 0) {
        for (int i=1;i<=n;i++) {
            tot = 0;
            dfs(i, i ,0);
            ans = min(ans, n - tot);
        }
    } else {
        for (int i=1;i<n;i++) {
            tot = 0;
            dfs(a[i], b[i], 0);
            dfs(b[i], a[i], 0);
            ans = min(ans, n - tot);
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2688
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<cstring>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
#include<time.h>
#include<cassert>

using namespace std;
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H& b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H& b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H& b) const { return x == b.x && y == b.y; }
	bool operator!=(const H& b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P& b) const { return cost < b.cost; }
	bool operator>(const P& b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E& b) const { return cost < b.cost; }
	bool operator>(const E& b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T& a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T& a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j % i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
ll bitcount(ll x) {
	int sum = 0;
	for (int i = 0; i < 20; i++)
		if ((1ll << i) & x) sum++;
	return sum;
}
ll fact_[5000000];
ll comb(ll x, ll y, ll mod = Mod) {
	if (!fact_[0]) {
		fact_[0] = 1;
		for (int i = 1; i < 5000000; i++) {
			fact_[i] = fact_[i - 1] * i % mod;
		}
	}
	if (x < y) return 0;
	return mod_pow(fact_[x], mod, mod) *
		mod_pow(fact_[x - y], mod - 2, mod) % mod *
		mod_pow(fact_[y], mod - 2, mod) % mod;
}//xCy
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int h, w, k;
int a[500][500];
vector<int>ans[100000];
signed main() {
	cin >> h >> w >> k;
	k = 0;
	for (int i = 0; i < h; i++) {
		string s;
		cin >> s;
		for (int j = 0; j < w; j++) {
			if (s[j] == '#') {
				a[i][j] = ++k;
				int z = j - 1;
				while (z >= 0 && a[i][z] == 0) {
					a[i][z--] = k;
				}
			}
			else {
				if (j > 0) {
					a[i][j] = a[i][j - 1];
				}
			}
		}
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (a[i][j] == 0) {
				if (i == 0) {
					int z = 0;
					while (a[z][j] == 0) z++;
					a[i][j] = a[z][j];
				}
				else a[i][j] = a[i - 1][j];
			}
			cout << a[i][j] << (j == w - 1 ? "\n" : " ");
		}
	}
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 7;
int main(){
    int h, w;
    cin >> h >> w;
    char v[h+1][w+1];
    for(int i = 1; i <= h; i++)
        for(int j = 1; j <= w; j++) 
            cin >> v[i][j];
    int d[h+1][w+1];
    d[1][1] = 1;
    for(int i = 0; i <= h; i++) d[i][0] = 0;
    for(int i = 0; i <= w; i++) d[0][i] = 0;
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            if(i != 1 || j != 1){
                if(v[i][j] == '#') d[i][j] = 0;
                else{
                    d[i][j] = (d[i-1][j] + d[i][j-1])%INF;
                }
            }
        }
    }
    cout << d[h][w];
}

Measured memory_bytes: 5120
#include<bits/stdc++.h>
using namespace std;
#define		pb              push_back
#define		PB              pop_back
#define		nn              "\n"
#define     O_O             ios_base::sync_with_stdio(false); cin.tie(NULL)
#define		all(p)          p.begin(),p.end()
#define		zz(v)           v.size()
#define		ss              ' '
#define 	S(a)            scanf("%lld",&a)
#define 	SS(a,b)         scanf("%lld %lld",&a,&b)
#define 	SSS(a,b,c)      scanf("%lld %lld %lld",&a,&b,&c)
#define		gcd(a,b)        __gcd(a,b)
#define		lcm(a,b)        (a*b)/gcd(a,b)
#define		pi              acos(-1.0)
typedef		long long       ll;
typedef		vector<ll>      vll;


int main()
{
 //O_O ;
   string a[10000],b;
   ll t,ar[100000],count=0,ans=0;
   cin>>t;
   for(ll i=0;i<t;i++){


       cin>>a[i]>>ar[i];


   }
   cin>>b;
 for(ll i=0;i<t;i++){
    if(a[i]==b){
        count=i;
        break;
    }
 }
 for(ll i=count+1;i<t;i++)
 {
     ans=ans+ar[i];
 }
 cout<<ans<<nn;


    return 0;
}


Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int hi = 0;
		int[] x = new int[n], y = new int[n], h = new int[n];
		for ( int i = 0; i < n; i++ ) {
			x[i] = in.nextInt();
			y[i] = in.nextInt();
			h[i] = in.nextInt();

			if ( h[i] != 0 ) hi = i;
		}
		in.close();

		for ( int cy = 0; cy <= 100; cy++ ) {
			for ( int cx = 0; cx <= 100; cx++ ) {
				boolean match = true;
				int Height = h[hi] + Math.abs(x[hi] - cx) + Math.abs(y[hi] - cy);
				
				for ( int i = 0; i < n; i++ ) {					
					if(h[i] != 0) {
						int tempH = h[i] + Math.abs(x[i] - cx) + Math.abs(y[i] - cy);
						if ( Height != tempH ) {
							match = false;
							break;
						} else {
							Height = tempH;							
						}						
					}
					
					if(h[i] == 0 && Height > Math.abs(x[i] - cx) + Math.abs(y[i] - cy)) {
						match = false;
						break;
					}
				}
				if ( match ) {
					System.out.println(cx + " " + cy + " " + Height);
					return;
				}
			}
		}
	}
}

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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    int N, M; cin >> N >> M;
    set<int> st[N];
    vector<int> dig[N];
    rep(i, M){
        int s, c; cin >> s >> c;
        s--;
        st[s].insert(c);
        dig[s].push_back(c);
    }
    if(N == 1){
        if(st[0].size() > 1) cout << -1 << endl;
        else if(st[0].size() == 1) cout << dig[0][0] << endl;
        else cout << 0 << endl;
    }
    else{
        if(st[0].count(0)){
            cout << -1 << endl;
        }
        else{
            rep(i, N){
                if(st[i].size() > 1){
                    cout << -1 << endl;
                    return 0;
                }
            }
            rep(i, N){
                if(st[i].size() == 1) cout << dig[i][0];
                else if(i == 0) cout << 1;
                else cout << 0;
            }
            cout << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
rev_ox = {"o":"x", "x":"o"}
rev_sw = {"S":"W", "W":"S"}

def get_next(sw_prev2,sw_prev1,ox_prev1):
        
    sw = sw_prev2
    if sw_prev1 == "W": ox_prev1 = rev_ox[ox_prev1]
    if ox_prev1 == "x": sw = rev_sw[sw]
    
    return sw

n = int(input())
ox = input()

for sw0,sw1 in [("S","S"),("S","W"),("W","S"),("W","W")]:
    ans = ""
    ans = sw0+sw1
    for i,oxi in enumerate(ox[1:]+ox[0],1):
        ans += get_next(ans[i-1],ans[i],oxi)
    
    if ans[0] == ans[-2] and ans[1] == ans[-1]:
        ans = ans[:-2]
        break
else:
    ans = -1

print(ans)

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

using namespace std;

int main(){
    int a,b;
    cin>>a>>b;
    int t=1;
    int ans=0;
    while(t<b){
        --t;
        t+=a;
        ++ans;
    }
    cout<<ans<<endl;
    return 0;
}

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

int main()
{
   int  n,k;
   cin>>n>>k;
   ll ans =0;
  
  
   vector<ll>h(n);
  
  for(int i=0;i<n;i++)
  {
      cin>>h[i];
  }

   sort(h.begin(),h.end());
   
  if(n>k)
  {
     for(int i=0;i<n-k;i++)
     {
         ans += h[i];
     }
  }
  

   cout<<ans<<endl;

    return 0;

}


Measured memory_bytes: 1792
N = int(input())
inward = 0
top = 0
fin = 0
dbl = 0

for _ in range(N):
    s = input()
    n = len(s)
    if s[0] == 'B' and s[n-1] == 'A':
        dbl += 1
    elif s[0] == 'B' and s[n-1] != 'A':
        top += 1
    elif s[0] != 'B' and s[n-1] == 'A':
        fin += 1
    for i in range(n-1):
        if s[i] == 'A' and s[i+1] == 'B':
            inward += 1

ans = inward
MAX = N-1
if dbl>0:
    ans += dbl-1
    MAX -= (dbl-1)
    if top >0:
        ans +=1
        top -=1
        MAX -=1
    if fin >0:
        ans +=1
        fin -=1
        MAX -=1
ans += min(top,fin,MAX)
print(ans)


Measured memory_bytes: 45656
alfa = "0abcdefghijklmnopqrstuvwxyz"
N = int(input())
n = N
res = ""
while True:
    x = n % 26
    if x == 0:
        x = 26
    res += alfa[x]
    n -= x
    if n == 0:
        break
    n //= 26
print(res[::-1])

Measured memory_bytes: 61816
#include <cstdio>

int C[55][55];

int main(void)
{
    int n,p,x;
    int a,b;
    long long answer = 0;
    int i,j;

    //freopen("x.in","r",stdin);

    a = b = 0;
    scanf("%d %d",&n,&p);
    for(i = 1;i <= n;++i)
        scanf("%d",&x),a += x & 1,b += !(x & 1);

    C[0][0] = 1;
    for(i = 1;i <= n;++i)
        for(C[i][0] = 1,j = 1;j <= i;++j)
            C[i][j] = C[i - 1][j - 1] + C[i - 1][j];

    answer = 0;
    for(i = 0;i <= a;i += 2)
        answer += C[a][i];
    answer *= 1ll << b;
    if(p == 1)
        answer = (1ll << n) - answer;

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

    return 0;
}

Measured memory_bytes: 128
lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]
M = lines[0][1]
K = lines[0][2]

cumtime_a = []
for i in 1..N do
  if i == 1 then
    cumtime_a[i-1] = lines[1][0]
  else
    cumtime_a[i-1] = cumtime_a[i-2] + lines[1][i-1]
  end
end
cumtime_b = []
for i in 1..M do
  if i == 1 then
    cumtime_b.push[i-1] = lines[2][0]
  else
    cumtime_b.push[i-1] = cumtime_b[i-2] + lines[2][i-1]
  end
end
  
can_read = true
books_read = 0
time = 0
sa_a = 0
sa_b = 0
while can_read do
  if lines[1] == [] then
    if lines[2] == [] then
      can_read = false
    else
      next_time = lines[2].shift
      cumtime_b.shift
      sa_b += next_time
    end
  else
    if lines[2] == [] then
      next_time = lines[1].shift
      cumtime_a.shift
      sa_a += next_time
    else
      can_read_a = cumtime_a.bsearch_index{|x| x + time > K + sa_a}
      can_read_b = cumtime_b.bsearch_index{|x| x + time > K + sa_b}
      if can_read_a == nil then
        can_read_a = lines[1].length
      end
      if can_read_b == nil then
        can_read_b = lines[2].length
      end
      if can_read_a > can_read_b then
        next_time = lines[1].shift
        cumtime_a.shift
        sa_a += next_time
      elsif can_read_a < can_read_b then
        next_time = lines[2].shift
        cumtime_b.shift
        sa_b += next_time
      elsif lines[1][0] < lines[2][0] then
        next_time = lines[1].shift
        cumtime_a.shift
        sa_a += next_time
      else
        next_time = lines[2].shift
        cumtime_b.shift
        sa_b += next_time
      end
    end
  end
  if can_read and next_time + time <= K then
    time += next_time
    books_read += 1
  else
    can_read = false
  end
end
      
puts books_read

Measured memory_bytes: 55076
#include<stdio.h>
int N, a, ans[100100];
int main(){
	scanf("%d",&N);
	for(int i=0; i<N; i++){
		scanf("%d",&a);
		ans[a-1] = i + 1;
	}
	for(int i=0; i<N; i++){
		if(i)putchar(32);
		printf("%d",ans[i]);
	}putchar(10);
}

Measured memory_bytes: 2088
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
using llint = long long int;
using namespace std;

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

    string s;
    cin >> s;

    if (n % 2 == 1) {
        cout << "No";
        return 0;
    }

    string left = s.substr(0, n / 2);
    string right = s.substr(n / 2);
    if (left == right)
        cout << "Yes";
    else
        cout << "No";
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int t[4000][4000]; 
int LCS(char a[],char b[],int n,int m)
{
string str;
for(int i=1;i<=m;i++)
{
for(int j=1;j<=n;j++)
{
if(b[i-1]==a[j-1])
{
t[i][j]=1+t[i-1][j-1];
}
else{
t[i][j]=max(t[i-1][j],t[i][j-1]);
}
}
}
return t[m][n];
}
int main()
{
memset(t,0,sizeof(t));
char a[3000],b[3000];
cin>>a;
cin>>b;
LCS(a,b,strlen(a),strlen(b));
int i=strlen(b);
int j=strlen(a);
string str;
while(i>0 && j>0)
{
if(a[j-1]==b[i-1])
{
str=str+a[j-1];
i=i-1;
j=j-1;
}else
{
if(t[i][j-1]>t[i-1][j])
{
j=j-1;
}else{
i=i-1;
}
}
}
reverse(str.begin(),str.end());
cout<<str<<endl;
return 0;
}


Measured memory_bytes: 62848
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

void main() {
  int a, b, c, n;
  readf (" %d %d %d %d", &a, &b, &c, &n);
  long res;
  foreach (x; 0 .. (n / a) + 1) {
    int n0 = n - a * x;
    foreach (y; 0 .. (n0 / b) + 1) {
      int n1 = n0 - y * b;
      if (!(n1 % c)) ++res;
    }
  }
  writeln (res);
}


Measured memory_bytes: 256
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace std;
int main() {

	int n; scanf("%d", &n);
	vector<int> vec;
	pair<int, int> cnt = { 0,0 };
	for (int i = 0; i < n; i++) {
		int a; scanf("%d", &a);
		vec.push_back(a);
	}
	sort(vec.begin(), vec.end(), [](int a,int b) {
		return a > b;
	});
	vector<int> tmp = vec;
	tmp.erase(unique(tmp.begin(), tmp.end()), tmp.end());
	if (tmp.size() == 1 && vec[0] == n - 1){
		printf("Yes\n");return 0;
	}

	if (tmp.size()>2||vec[0]!= vec[1]|| (tmp.size() >= 2 && tmp[0]!=tmp[1] +1)) {
		printf("No\n"); return 0;
	}
	int g = vec[0];
	for (int i = 0; i < n; i++) {
		if (vec[0] == vec[i]) cnt.first++;
		else cnt.second++;
	}
	if (g > cnt.second && cnt.first >= 2 * (g - cnt.second))
		printf("Yes\n");
	else printf("No\n");
}

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

int main() {
	
	while (true){
		char ch;
		scanf("%c",&ch);
		char ch1=toupper(ch);
		char ch2=tolower(ch);
		if (ch=='\n' ) break;
		if (!isalpha(ch)) cout<<ch;
		else if (islower(ch)) cout<<ch1;
		else if (isupper(ch)) cout<<ch2;
	}
	cout<<endl;

	return 0;
}

Measured memory_bytes: 1148
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int h[100010];
int dp[100010];
int main(){ _;
  int n;cin>>n;
  REP(i,n)cin>>h[i];
  dp[0]=0;
  dp[1]=abs(h[0]-h[1]);
  for(int i=2;i<n;i++){
    dp[i]=min(dp[i-2]+abs(h[i-2]-h[i]),dp[i-1]+abs(h[i-1]-h[i]));
  }
  cout<<dp[n-1]<<endl;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;


/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
//#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define pb push_back


/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
const int inf = pow(2, 57);
const int mod = 1e9 + 7;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};
const string alpha = "abcdefghijklmnopqrstuvwxyz";

/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}


/* general_method */
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; }




/* main */








signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n = input();

    vi arr; rep(i,0,n) arr.push_back(input());


    vi sorted = arr;
    sort(all(sorted));

    int ans = 0;

    rep(i,0,n){
        int d = distance(sorted.begin(), lower_bound(all(sorted), arr[i]));
        if(i % 2 != d % 2) ans++;
    }

    print((ans + 1)/2);


    


     



     





    


    


   





    


    


    





    
    






    



    





    


    

}



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

using namespace std;

int main()
{
    int n;
    cin>>n;
    if(n<10)
        cout<<n<<endl;
    else if(n<100) cout<<"9"<<endl;
    else if(n<1000) cout<<n-90<<endl;
    else if(n<10000) cout<<"909"<<endl;
    else if(n<100000) cout<<n-9999+909<<endl;
    else if(n==100000) cout<<"90909"<<endl;
}


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

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
  long long l,r;
  cin >> l>>r;
  long long c = 2019;
  long long ll=l/2019;
  long long rr=r/2019;
  if (ll-rr>=1||rr-ll>=1) {
    c=0;
  } else {
   for(long long i=l;i<r;i++) {
    for(long long j=l+1;j<r+1;j++) {
      long long m = (i%2019)*(j%2019);
      m=m%2019;
      c=min(m,c);
    }
  }
 }
  cout << c << endl;
}


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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int N; cin >> N;
	vi arr (N);

	F0R(i, N) cin >> arr[i];
	int hi = *max_element(arr.begin(), arr.end());

	int best = hi;
	F0R(i, N) if (arr[i]!=hi) {
		if (abs(2*arr[i] - hi) <= abs(2*best - hi)) best = arr[i];
	}

	print(hi, best);
}

Measured memory_bytes: 3560
#include<iostream>

using namespace std;

int main() {
	int x = 0;
	int y = 0;
	int z = 0;
	int a[10];
	for(int i=0;i<10;i++){
		cin >> a[i];
	}
	for(int j=0;j<10;j++){
		if(x < a[j]) {
			z = y;
			y = x;
			x = a[j];
		}else if (y < a[j]){
			z = y;
			y = a[j];
		}else if (z < a[j]){
			z = a[j];
		}
	}
	cout << x << endl;
	cout << y << endl;
	cout << z << endl;
	return 0;
}



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

int main() {
  string s,t;
  cin >> s >> t;
  
  int S = s.size();
  bool y = true;
  
  for(int i = 0; i<S+1 ; i++){
    if(s == t){
      cout << "Yes" << endl;
      y = false;
      break;
    }
    s = s.back() + s.substr(0,S-1);
  }
  
  if(y){
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
#define MOD 1000000007
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define P pair<ll, ll>
#define PP pair<P,int>
#define T tuple<int,int,int> 
using namespace std;
 
int main(){
    int x; cin>> x;
    if(x>=30) cout << "Yes" << endl;
    else cout << "No" << endl;
return 0;
}

Measured memory_bytes: 3620
fun main() {
    val (h1, m1, h2, m2, k) = readIntList()
    val time = (h2 * 60 + m2) - (h1 * 60 + m1)
    if (time - k > 0) println(time - k)
    else println(0)
}

fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)
fun <T> Array<Array<T>>.print() {
    this.forEach {
        println(it.joinToString(" "))
    }
}

Measured memory_bytes: 36408
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
int main(){
  ll a,b,c;
  cin>>a>>b>>c;
  if(a>b)swap(a,b);
  if(b>c)swap(b,c);
  if(a>b)swap(a,b);
  if(a%2==0||b%2==0||c%2==0)cout<<0;
  else{
    cout<<a*b;
  }
}

Measured memory_bytes: 3584
# https://atcoder.jp/contests/arc026/tasks/arc026_2
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()

  ans=inf
  for i in range(h+1):
    a=i*w
    b=(h-i+1)//2*w
    c=(h-i)//2*w
    ans=min(ans,max(a,b,c)-min(a,b,c))

    a=i*w
    b=(h-i)*((w+1)//2)
    c=(h-i)*(w//2)
    ans=min(ans,max(a,b,c)-min(a,b,c))

  for i in range(w+1):
    a=i*h
    b=(w-i+1)//2*h
    c=(w-i)//2*h
    ans=min(ans,max(a,b,c)-min(a,b,c))

    a=i*h
    b=(w-i)*((h+1)//2)
    c=(w-i)*(h//2)
    ans=min(ans,max(a,b,c)-min(a,b,c))

  return ans

# main()
print(main())


Measured memory_bytes: 5204
#include <iostream>
#include <vector>

using namespace std;
typedef pair<int, int> p;

void solve()
{
	int H, W;
	while(cin >> H >> W, H || W)
	{
		vector< vector<bool> > isVisited(H, vector<bool>(W));
		vector< vector<char> > tile(H, vector<char>(W));
		for(int i = 0; i < H; ++i)
		{
			for(int j = 0; j < W; ++j)
			{
				isVisited[i][j] = false;
				cin >> tile[i][j];
			}
		}
		p pos(0, 0);
		while(true)
		{
			if(isVisited[pos.second][pos.first])
			{
				cout << "LOOP" << endl;
				break;
			}
			else
			{
				isVisited[pos.second][pos.first] = true;
				if(tile[pos.second][pos.first] == '>')
				{
					++pos.first;
				}
				else if(tile[pos.second][pos.first] == '^')
				{
					--pos.second;
				}
				else if(tile[pos.second][pos.first] == '<')
				{
					--pos.first;
				}
				else if(tile[pos.second][pos.first] == 'v')
				{
					++pos.second;
				}
				else if(tile[pos.second][pos.first] == '.')
				{
					cout << pos.first << " " << pos.second << endl;
					break;
				}
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

Measured memory_bytes: 1244
#encoding:utf-8 No.0046 2014.10.6
height = []
while gets
  height.push $_.to_f
end

max = height[0]
min = height[0]

height.length.times do |i|
  if max < height[i]
    max = height[i]
  elsif min > height[i]
    min = height[i]
  end
end

printf("%.1f\n",max-min)

Measured memory_bytes: 6128
void main() {
	auto S = ri;
	"%d:%d:%d".writefln(S/3600, S%3600/60, S%60);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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


int main(){
  string s;
  cin >> s;
  int n = s.size() - 2;
  string c = to_string(n);
  cout << s[0] + c + s[s.size() - 1] << endl;
}

Measured memory_bytes: 256
import sys
def tree_path():
    # 辺と長さが与えられる
    # 頂点1からの各点の距離を計算する
    # 距離が偶数か奇数かで色分け
    def walk(i, c):
        if d[i] == -1:
            d[i] = c
            for node, dist in path[i]:
                walk(node, c + dist)

    sys.setrecursionlimit(100000)
    n = int(input())
    path = [[] for _ in range(n + 1)]
    for _ in range(n - 1):
        u, v, w = map(int, input().split())
        # 無向グラフ
        path[u].append([v, w])
        path[v].append([u, w])
    # d[0]は使わない
    d = [-1] * (n + 1)
    walk(1, 0)
    for item in d[1:]:
        print(item % 2)


tree_path()

Measured memory_bytes: 98148
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#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++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const ll inf=1e9+7;
const ll INF=1e18;

int main(){
    int n,d;ll a;cin>>n>>d>>a;
    map<int,ll> fox;
    vin x(n);
    ll h;
    rep(i,n){
        cin>>x[i]>>h;
        fox[x[i]]=h;
    }
    sort(all(x));
    vll bom(n+1);
    ll ans=(ll)0,tmp;
    rep(i,n){
        if(i>0)bom[i]+=bom[i-1];
        fox[x[i]]-=bom[i];
        if(fox[x[i]]<=0)continue;
        tmp=(fox[x[i]]+a-(ll)1)/a;
        ans+=tmp;
        bom[i]+=tmp*a;
        bom[upper_bound(all(x),x[i]+2*d)-x.begin()]-=tmp*a;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 17968
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (1E9+7)
#define PI 3.1415926535897932384626433832795

std::ostream &operator<<(std::ostream &out, const vector<int> &tgt)
{
	string s;
	for (int i = 0; i<tgt.size(); i++) {
		s += (to_string(tgt[i]) + ((i != tgt.size() - 1) ? " " : ""));
	}
	out << s;
	return out;
}
struct node {
	vi to;
	int fi = -1, se = -1;
	bool visited = false;
};

vector<node> g;
int t = 0;

void dfs(int n) {
//	stack<int> s;
//	s.push(n);
//	while (!s.empty()) {
	g[n].fi = ++t;
	g[n].visited = true;
	rep(i, g[n].to.size()) {
		if(!g[g[n].to[i]].visited)dfs(g[n].to[i]);
	}
	g[n].se = ++t;
}

int main(){
	int n,in,inn;
	cin >> n;
	g.resize(n);
	rep(i, n) {
		cin >> in;
		cin >> in;
		rep(j, in) {
			cin >> inn;
			g[i].to.push_back(inn-1);
		}
	}
	rep(i, n) {
		if (!g[i].visited) {
			dfs(i);
		}
	}
	rep(i, n) {
		cout <<i+1<<" "<< g[i].fi << " " << g[i].se << endl;
	}
}


Measured memory_bytes: 3144
#include<bits/stdc++.h>
 using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
typedef long long LL;
int N;
int K;
LL a[1011];
LL s[1011];
vector<LL>v;

LL dfs(vector<LL> x, int now){
	//cout<<x.size()<<endl;
	if(now<0)return 0;
	LL c=0;
	vector<LL>w;
	REP(i,x.size()){
		if((x[i]>>now)&1){
			c++;
			//cout<<x[i]<<" ";
			x[i]-=(LL(1)<<now);
			w.push_back(x[i]);
		}
	}
	//cout<<(LL(1)<<now)<< " "<<c<<endl;
	if(c>=K){
		return (LL(1)<<now)+dfs(w,now-1);
	}else{
		return dfs(x,now-1);
	}
}

int main(){
	cin>>N>>K;
	a[0]=0;
	s[0]=0;
	REP(i,N){
		cin>>a[i+1];
		s[i+1]=s[i]+a[i+1];
		
	}
	N++;
	REP(i,N){
		REP(j,i){
			v.push_back(s[i]-s[j]);
		}
	}
	cout<<dfs(v,62)<<endl;
    return 0;
}

Measured memory_bytes: 120684
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<iomanip>

#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{"; for(auto nth : list){ cout << nth << " ";}cout << "}" << endl;

using namespace std;

int main(){

	while(true){
		int a,b;
		cin >> a >> b;
				
		if(a==0&&b==0) break;
		

		int people[a];
		int stone=b;
		for(int i=0;i<(sizeof(people)/sizeof(int));i++){
			people[i]=0;
		}

		
		int count=0;
		bool flag = false;
		while(true){
			for(int i=0;i<(sizeof(people)/sizeof(int));i++){
				if(people[i]==b){
					cout << i << endl;
					flag = true;	
				}
			}
			
			if(flag){
				break;
			}

			if(stone>0){
				people[count]++;
				stone--;
			}
			else if(stone<=0){
				stone+=people[count];
				people[count]=0;
			}

			count++;
			if(count>=a) count=0;
		}
	
	}
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  int n;
  cin >> n;
  int ans = 0;
  rep(i,n){
    int num = i+1;
    if(num % 2 == 0) continue;
    int count = 0;
    for(int d = 1;d<=n;d++) if(num % d == 0) count++;
    if(count == 8) ans++;
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#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 srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

int n;

bool ok(string& s,string& t)
{
    int pos = 0;
    rep(i,len(s)){
        if(s[i] == t[pos]){
            pos++;
        }
        if(pos == len(t)){
            return true;
        }
    }
    return false;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s,t;
    cin >> s >> t;
    string bf = t;
    int moto = len(bf);
    n = len(s);
    int ans = 0;
    while(1){
        if(ok(s,t)){
            ans++;
        }else{
            break;
        }
        int k = len(t);
        if(n < (ll)k*(moto+1)+moto){
            break;
        }
        string nw = t;
        rep(i,moto){
            nw += bf[i];
            nw += t;
        }
        swap(t,nw);
    }
    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i= (a); i < (b); ++i)
typedef long long ll;
typedef pair<int,int> P;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main()
{
  double R;
  cin >> R;
  cout << fixed<<setprecision(10)<<R * 2 * 3.1415926535 << endl;
}

Measured memory_bytes: 3784
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin>>s;
  if(s == "ABC") cout<<"ARC"<<endl;
  else cout<<"ABC"<<endl;
}

Measured memory_bytes: 3652