akhauriyash/Code-Regression huggingface dataset:
open System
open System.Collections.Generic

module InputUtility =
    let InputTokens = new Queue<string>()

    let EnsureInput () =
        if InputTokens.Count = 0 then
            let input = Console.ReadLine ()
            let s = input.Split ([|' '|], StringSplitOptions.RemoveEmptyEntries)
            if s.Length > 0 then
                for x in s do InputTokens.Enqueue(x)
                true
            else false
        else true

    let rec ReadNext () =
        if EnsureInput () then InputTokens.Dequeue ()
        else ReadNext ()

    let ReadNextInt () = ReadNext () |> int

    let Read2Int () = ReadNextInt (), ReadNextInt ()

    let ReadListOf f n =
        let rec loop acc = function
            | 0 -> List.rev acc
            | c -> loop ((ReadNext () |> f) :: acc) (c-1)
        loop [] n

    let MultipleCaseWithId f =
        let caseNum = ReadNextInt ()
        let rec loop index =
            if index = caseNum then ()
            else
                f index
                loop (index + 1)
        loop 0

    let MultipleCase f = MultipleCaseWithId (fun _ -> f ())

    let ReadList n =
        let rec loop acc = function
            | 0 -> List.rev acc
            | c -> loop (ReadNext () :: acc) (c-1)
        loop [] n

open InputUtility

module ARC075 =
    let rec binarySearchInt64 f s t =
        if s+1L=t then s
        else
            let d = (s+t)/2L
            if f d then binarySearchInt64 f d t
            else binarySearchInt64 f s d

    let private Widespread () =
        let g64 = ReadNext >> int64
        let ubDiv a b = (a - 1L) / b + 1L
        let n = ReadNextInt ()
        let inA, b = g64 (), g64 ()
        let a = inA - b
        let h = ReadListOf int64 n
        let f inD =
            let d = inD - 1L
            let bd = d * b
            let rec inner c = function
                | [] -> c >= 0L
                | h :: t ->
                    if h <= bd then inner c t
                    elif c < 0L then false
                    else
                        let r = ubDiv (h - bd) a
                        inner (c - r) t
            inner d h |> not
        min 1000000000L (h |> Seq.sum |> (+) 1L)
        |> binarySearchInt64 f 1L 
        |> printfn "%d"

    let Entry = Widespread

ARC075.Entry ()

Measured memory_bytes: 25788
#include<bits/stdc++.h>
using namespace std;
int a[100005],f[100005],n,nf=1e9;
int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",a+i);
    for(int i=1;i<=n;i++) f[i]=nf;
    for(int i=1;i<n;i++)
    for(int j=1;j<=2&&i-j>=0;j++)
    f[i]=min(f[i],f[i-j]+abs(a[i]-a[i-j]));
    printf("%d",f[n-1]);
    return 0;
}

Measured memory_bytes: 1024
#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 k,x;
  cin >> k >> x;
  if(k*500 >= x) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3592
#include <iostream>

using namespace std;

int main()	{
  long long x;
  cin >> x;
  long long moves = 2 * (x / 11);
  if (x % 11 > 0)	moves++;
  if (x % 11 > 6)	moves++;
  cout << moves << endl;
  return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
// clang-format off

using LL = long long;
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define REP(i,x) for(int i=0;i<(int)(x);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).rend();i++)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
 
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
// clang-format on
const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long M, std::vector<long long> A) {
  // solver code

  sort(A.begin(), A.end(), greater<LL>());

  LL sum = accumulate(A.begin(), A.end(), 0);

  if (A[M - 1] >= (double)sum / (4 * M)) {
    cout << YES << endl;
  } else {
    cout << NO << endl;
  }

  // cout << A << endl;
}

int main() {
  long long N;
  scanf("%lld", &N);
  long long M;
  scanf("%lld", &M);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, M, std::move(A));
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#define INF 1e9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define NO cout<<"NO"<<endl;
#define YES cout << "YES"<<endl;
#define No cout << "No"<<endl;
#define Yes cout << "Yes"<<endl;
#define all(a) a.begin(),a.end()
#define P pair<int,int>

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

//(int)'a'は97 (int)'A'は65 (int)'1'は49
//おまじない
//UnionFind

const int maxn=100000;

int keta(ll n){
    int res=0;
    while(n>0){
        res++;
        n=n/10;
    }
    return res;
}

int main(){
    
    while(true){
        ll a,L,anext;
        vector<pair<ll,int> > v;
        ll cnt=1;
        cin >> a>> L;
        if(a==0&&L==0)break;
        v.push_back(pair<ll,int>(a,0));
        anext=a;
        
        while(true){
            int nketa;
            int dig[10]={0};
            ll Ma=0,Mi=0;
            
            ll sub=anext;
            while(sub>0){
                dig[sub%10]++;
                sub=sub/10;
            }
            
            for(int i=9;i>=1;i--){
                rep(j,dig[i]){
                    Ma = Ma*10+i;
                }
            }
            nketa=keta(Ma);
            rep(i,L-nketa){
                Ma=Ma*10;
            }
            
            for(int i=1;i<10;i++){
                rep(j,dig[i]){
                    Mi = Mi*10+i;
                }
            }
            anext = Ma-Mi;
            //cout << Ma <<' '<<Mi<<' '<<anext<<endl;
            int it=INF;
            rep(j,v.size()){
                if(anext==v[j].first){
                    it = v[j].second;
                    break;
                }
            }
            if(it!=INF){
                cout << it << ' '<<anext << ' '<<cnt-it<<endl;
                break;
            }else{
                v.push_back(pair<ll,int>(anext,cnt));
                cnt++;
            }
            
        }
    }
    
    return 0;
}




Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
int N,a[100010]={},ans=0;
int solve(int k){
  ans++;
  if(a[k]==2){
    cout << ans << endl;
    return 0;
  }
  if(ans==N){
    cout << "-1" << endl;
    return 0;
  }
  return solve(a[k]);
}

int main(){
  cin >> N;
  for(int i=1;i<=N;i++){
    cin >> a[i];
  }
  solve(1);

  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
typedef long long int ll;

int main(){
    int m,d; cin >> m >> d;
    if(d<22){
        cout << 0 << endl;
        return 0;
    }
    int ans=0;
    for(int i=1;i<=m;i++){
        for(int j=1;j<=d;j++){
            if(j/10<2||j%10<2)continue;
            if(i==j/10*(j%10))ans++;
        }
    }
    cout << ans<< endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::setprecision(15);}}fIO;
template<typename T> using V = std::vector<T>;
template<typename T> void fill(V<T>&v) { for(T&e:v) std::cin >> e; }
/*-*/

struct UnionFind
{
	int n;
	std::vector<int> par,size;
	UnionFind(int sz) : n(sz), par(sz,0), size(sz,1) {
		std::iota(par.begin(),par.end(),0);
	}
	int find(int x) {
		if(par[x]==x) return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x=find(x);y=find(y);
		if(x==y) return;
		if(size[x]<size[y]) std::swap(x,y);
		size[x]+=size[y];
		par[y]=x;
	}
};


int main() {
	int h,w;
	std::cin >> h >> w;
	int sx,sy,tx,ty;
	std::cin >> sx >> sy >> tx >> ty;
	sx--;sy--;
	tx--;ty--;
	V<std::string> g(h);
	rep(i,h) std::cin >> g[i];
	UnionFind uf(h*w);
	auto enc = [&](int x, int y) -> int {
		return x*w+y;
	};
	rep(i,h) {
		rep(j,w) {
			if(g[i][j]=='.'&&i+1<h&&g[i+1][j]=='.') uf.unite(enc(i,j),enc(i+1,j));
			if(g[i][j]=='.'&&j+1<w&&g[i][j+1]=='.') uf.unite(enc(i,j),enc(i,j+1));
		}
	}
	//std::set<lnt> set;
	//rep(i,h) rep(j,w) set.emplace(uf.find(enc(i,j)));
	//V<int> v(all(set));
	//V<std::set<int> > gr(set.size());
	std::map<int,std::set<int> > gr;
	rep(i,h) {
		rep(j,w) {
			for(int dx=-2;dx<=2;dx++) for(int dy=-2;dy<=2;dy++) {
				int di=i+dx;
				int dj=j+dy;
				if(di>=h||dj>=w||di<0||dj<0) continue;
				if(g[i][j]=='#'||g[di][dj]=='#') continue;
				if(uf.find(enc(i,j))!=uf.find(enc(di,dj))) gr[uf.find(enc(i,j))].emplace(uf.find(enc(di,dj)));
			}
		}
	}
	{
		std::queue<int> que;
		std::map<int,int> dist;
		que.emplace(uf.find(enc(sx,sy)));
		dist[uf.find(enc(sx,sy))]=0;
		while(!que.empty()) {
			int i=que.front(); que.pop();
			for(auto to:gr[i]) {
				if(dist.count(to)) continue;
				dist[to]=dist[i]+1;
				que.emplace(to);
			}
		}
		int f=uf.find(enc(tx,ty));
		if(dist.count(f)) print(dist[f]);
		else print(-1);
	}
}


Measured memory_bytes: 51104
l, r = map(int, input().split())
ans = 2019
for i in range(l, r):
   for j in range(l+1, r+1):
      tmp = i*j % 2019
      if ans > tmp:
         ans = tmp         
      if ans == 0:
         print(ans)
         exit(0)
print(ans)


Measured memory_bytes: 2940
def q(a_,b_):
    a=max(a_,b_)
    b=min(a_,b_)
    r=a%b
    while r>0:
        a=b
        b=r
        r=a%b
    return b

a,b=input().split()
a=int(a)
b=int(b)
print(int(a*b/q(a,b)))

Measured memory_bytes: 3060
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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

int main() {
  int dis, ang = -90, cang;
  double ax = 0, ay = 0;
  char c;

  while(1) {
    cin >> dis >> c >> cang;
    if(dis+cang == 0) break;
    ax += dis * cos(-ang*(PI/180));
    ay += dis * sin(-ang*(PI/180));
    ang += cang;
  }
  cout << (int)ax << endl;
  cout << (int)ay << endl;
}

Measured memory_bytes: 1164
#include <iostream>
using namespace std;
int main()
{
  char s[1201]="";
  int n=0;
  while(1)
  {
    cin.get(s[n]);
    if(s[n]=='\n') break;
    n++;
  }
  for(int i=0;i<n;i++)
    s[i]=(char)(s[i]+(('a'<=s[i]&&s[i]<='z')*('A'-'a')-(('A'<=s[i]&&s[i]<='Z')*('A'-'a'))));
  cout<<s;
}

Measured memory_bytes: 3044
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

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

    int count_01 = 0;
    int count_10 = 0;

    for(int i =0; i < s.size(); i++) {
        count_01 = (i%2 == 1 ? '1' : '0') == s[i]? count_01 : count_01 + 1;
        count_10 = (i%2 == 1 ? '0' : '1') == s[i]? count_10 : count_10 + 1;
    }

    cout << min(count_01, count_10) << endl;
    return 0;
}

Measured memory_bytes: 512
//
//  ROIGold.cpp
//  Main calisma
//
//  Created by Rakhman on 05/02/2019.
//  Copyright © 2019 Rakhman. All rights reserved.
//

#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iterator>

#define ios ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
#define S second
#define F first
#define pb push_back
#define nl '\n'
#define NL cout << '\n';
#define EX exit(0)
#define all(s) s.begin(), s.end()
#define FOR(i, start, finish, k) for(int i = start; i <= finish; i += k)

const int MXN = 3e5 + 200;
const long long MNN = 5e3 + 100;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const int OO = 1e9 + 500;

typedef long long llong;
typedef unsigned long long ullong;

using namespace std;

llong n, k, ans, f[MXN];
vector<int> q[MXN];
bool used[MXN];

llong binpow(llong a, llong b){
    if(b == 0) return 1;
    if(b % 2 == 1) return binpow(a, b - 1) * a % MOD;
    else{
        llong x = binpow(a, b / 2);
        return x * x % MOD;
    }
}

void dfs(int x){
    used[x] = 1;
    llong sz = q[x].size();
    llong s = k - 1;
    if(x != 1) {
        s--;
        sz--;
    }
    ans = (ans * (f[s] * binpow(f[s - sz], MOD - 2) % MOD)) % MOD;
    for(int i = 0; i < q[x].size(); i++){
        if(used[q[x][i]] == 0) dfs(q[x][i]);
    }
}

int main () {
    ios;
    cin >> n >> k;
    f[0] = 1;
    for(int i = 1; i <= k; i++){
        f[i] = (f[i - 1] * i) % MOD;
    }
    for(int i = 1; i < n; i++){
        int u, v;
        cin >> u >> v;
        q[u].pb(v);
        q[v].pb(u);
    }
    ans = k;
    dfs(1);
    cout << ans;
    return 0;
}


Measured memory_bytes: 13696
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 a : u32 = read();
    let b : u32 = read();
    // let c : u32 = read();
    // let s : String = read();

    // println!("{} {}", a + b + c, s);

    println!("{}", if (a * b % 2) == 0 {"Even"}else{"Odd"});
}


Measured memory_bytes: 4352
/*  ex4_2
    Rikuta  */

#include <stdio.h>
#include <math.h>

//円周率の定義
#define PI 3.141592653589

int main(void){

    int hour_hand_length,min_hand_length,num_hour,num_min;

    //入力受け取り
    scanf("%d %d %d %d",&hour_hand_length,&min_hand_length,&num_hour,&num_min);

    //何時何分を分になおす
    int sum_mins=60*num_hour+num_min;

    //時針と分針の0:00からの弧度
    double hour_hand_radian=(double)sum_mins/360*PI;
    double min_hand_radian=(double)num_min/30*PI;

    //時針と分針の間の弧度
    double dif_radian=hour_hand_radian-min_hand_radian;

    //余弦定理をつかった答えの計算
    double ans=sqrt(pow((double)hour_hand_length,2)+pow((double)min_hand_length,2)-2*hour_hand_length*min_hand_length*cos(dif_radian));

    //答えの出力
    printf("%.9lf\n",ans);

    return 0;
}

Measured memory_bytes: 2536
parseint(x) = parse(Int, x)
ints() = map(parseint, readline() |> split)

function main()
    n, x = ints()
    l = ints()
    cnt = 1
    d = 0
    for i = 2:n+1
        d += l[i-1]
        (d <= x) && (cnt += 1)
    end
    println(cnt)
end

main()

Measured memory_bytes: 168212
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
#include <iomanip>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }


vector<bool> getPrimeTable(const int& max)
{
	vector<bool> table(max + 1);
    
	table[2] = true;
    
	int i, j;
	for(i = 3; i <= max; i += 2)
	{
		table[i] = i % 2 == 1;
		for(j = 3; j*j <= i; j += 2)
		{
			if(!(i % j))
			{
				table[i] = false;
				break;
			}
		}
	}
    
	return table;
}


int main()
{
	int n, x;
	vector<bool> table = getPrimeTable(1000000);

	while(cin >> n >> x && n)
	{
		vector<bool> v(x + 1, 0);
		v[0] = 1;

		rep(i, n)
		{
			int in;
			cin >> in;

			rep(i, x - in + 1)
				v[i + in] = v[i + in] || v[i];
		}

		for(int i = x; 0 < i; i--)
		{
			if(table[i] && v[i])
			{
				cout << i << endl;
				goto ng;
			}
		}

		cout << "NA" << endl;
ng:
		;
	}
}

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

//組み合わせの数nCrを計算
int comb(int n, int r){
    int num = 1;
    for(int i = 1; i <= r; i++){
        num = num * (n - i + 1) / i;
    }
    return num;
}

// int fact(int n){
//     int x = 1;
//     for (int i = 1; i <= n; ++i)
//         x *= i;
//     return x;
// }

int main(){
    int n,m,ans;
    cin >> n >> m;
    // ans = fact(n) / (2*fact(n-2)) + fact(m) / (2*fact(m-2));
    ans = comb(n, 2) + comb(m, 2);
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
int main(){
  string s;cin >> s;
  int n = s.size(),i,j,end[n] = {};
  for(i=0;i<n-1;i++){
    if(s[i] == 'R' && s[i+1] == 'L'){
      for(j=i;j>=0 && s[j]=='R';j--){
        end[i+((i-j)%2==1)]++;
      }
      for(j=i+1;j<n && s[j]=='L';j++){
        end[i+((j-i)%2==1)]++;
      }
    }
  }
  for(i=0;i<n;i++) printf("%d ",end[i]);
  printf("\n");
}

Measured memory_bytes: 4248
#include <stdio.h>
int main(void)
{
  char word[1000];
  int i=0,len=0;
  
  while(1)
    {
      scanf("%c",&word[i]);
      if(word[i] == '\n') break;
      if(word[i] >= 'a' && word[i] <= 'z') word[i] = word[i] - 32;		  	
      printf("%c",word[i]);
      i++;
    }  
  printf("\n");
  return 0;
}

Measured memory_bytes: 0
<?php
// Your code here!
$input = explode(" ",trim(fgets(STDIN)));
$A = $input[0];
$B = $input[1];
$K = $input[2];

if ($A > $B) {
    $limit = $B;
} else {
    $limit = $A;
}

for ($i = 1; $i <= $limit; $i++) {
    if ($B % $i == 0 && $A % $i == 0) {
        $answer[] = $i;
    }
}

rsort($answer);
echo $answer[$K - 1];
?>


Measured memory_bytes: 3828
n = int(input())

a = n//15
b = n//3
c = n//5
d,e,f,g = 0,0,0,0

for i in range(n+1):
    d = d+i
for j in range(a+1):
    e = e+j
for k in range(b+1):
    f = f+k
for l in range(c+1):
    g = g+l

h = d-(f*3)-(g*5)+(e*15)
print(int(h))

Measured memory_bytes: 9208
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<math.h>
#include<queue>
#include<deque>
#include<map>

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

using namespace std;
using ll = long long;

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

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


//////////////////////////////////////////////////

struct Edge {
    int to;
    ll cost;
};

int main() {
    int n; cin >> n;
    vector<vector<Edge>> g(n);
    for (int i = 0; i < n-1; i++)
    {
        int a, b; cin >> a >> b;
        a--; b--;
        ll c; cin >> c;

        g[a].push_back(Edge{b, c});
        g[b].push_back(Edge{a, c});
    }

    int q, k; cin >> q >> k;
    k--;
    vector<pair<int, int>> xy(q);
    for (int i = 0; i < q; i++)
    {
        int x, y;
        cin >> x >> y;
        x--; y--;
        xy[i] = make_pair(x, y);
    }


    vector<ll> dp(n);
    vector<bool> visited(n, false);
    
    auto dfs = [&](auto &&dfs, int now, ll len) -> void {
        if (visited[now]) return;
        visited[now] = true;
        dp[now] = len;

        for (int i = 0; i < g[now].size(); i++)
        {
            int next = g[now][i].to;
            ll c = g[now][i].cost;
            dfs(dfs, next, dp[now]+c);
        }
        
    };

    // int q, k; cin >> q >> k;
    // k--;
    dfs(dfs, k, 0);
    // vector<pair<int, int>> xy(n);
    // for (int i = 0; i < q; i++)
    // {
    //     int x, y;
    //     cin >> x >> y;
    //     x--; y--;
    //     cout << dp[x] + dp[y] << endl;
    // }

    for (int i = 0; i < q; i++)
    {
        int x = xy[i].first, y = xy[i].second;
        cout << dp[x] + dp[y] << endl;
    }
    
    return 0;
}


Measured memory_bytes: 13184
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> p(n);
    int sum = 0, max_sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> p[i];
        if (i < k) sum += p[i];
    }
    max_sum = sum;
    for (int i = 0; i < n - k; i++) {
        sum = sum - p[i] + p[i + k];
        max_sum = max(sum, max_sum);
    }
    cout << setprecision(15) << ((max_sum + k) / 2.0) << endl;
}

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

typedef long long ll;
#define ll long long
#define all(v) (v).begin(), (v).end()
#define _for(i,a,b) for(int i = (a); i < (b); i++) 
#define _rep(i,a,b) for(int i = (a); i <= (b); i++)

const int kMod = 1e9 + 7;
const int kMaxN = 1e6 + 5;

void taskA(){
    string s; cin >> s;
    int n = s.size();
    cout << (s[2]==s[3] && s[4]==s[5] ? "Yes\n" : "No\n");
    return;
}

void taskB() {
    int n; cin >> n;
    int ans = 0;
    ans += (n/500)*1000; n%=500;
    ans += (n/5)*5;
    cout << ans;
    return;
}

int main(){
    ios::sync_with_stdio(false), cin.tie(nullptr);
    //taskA();
    taskB();
    return 0;
}

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

static int compare(const void* a, const void* b)
{
    int aNum = *(int*)a;
    int bNum = *(int*)b;

    return aNum-bNum;
}

int main(void)
{
    int n, l[200], i, sum=0;

    scanf("%d", &n);

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

    qsort(l, 2*n, sizeof(int), compare);
    
    for(i=0;i<2*n;i++){
        if(i%2==0 || i==0) sum=sum+l[i];
    }

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

    return 0;
}
            


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define int long long
#define P pair<int,int>
#define all(vec) vec.begin(),vec.end()

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

void f(int x) {
	int cnt = 0;
	int k = x;
	while (k) {
		cnt++;
		k /= 10;
	}
	for (int i = 0; i < 6 - cnt; i++)cout << 0;
	cout << x;
}

int n, m, a[100010], b[100010];
vector<int> vec[100010];

signed main() {
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> a[i] >> b[i];
		vec[a[i]].push_back(b[i]);
	}
	for (int i = 1; i <= n; i++)sort(all(vec[i]));
	for (int i = 0; i < m; i++) {
		f(a[i]);
		f(lower_bound(all(vec[a[i]]), b[i]) - vec[a[i]].begin() + 1);
		cout << endl;
	}
}

Measured memory_bytes: 8576
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+10;
const int mod=1e9+7;
const double eps=1e-8;
const int INF = 0x3f3f3f3f;
int main()
{
    int n,x,k;
    cin>>n>>x>>k;
    int tmp=n/x;
    if(n%x!=0)
        tmp++;
    cout<<tmp*k<<endl;
    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
long double const pi = std::acos(-1.0L);
typedef pair<int,int> P;
const int INF = 1001001001;


int main() {
  int n; cin >> n;
  vector<string> s(n);
  rep(i,n) cin >> s[i];
  vector<int> cnt(4,0);
  rep(i,n){
    if(s[i]=="AC") cnt[0]++;
    else if(s[i]=="WA") cnt[1]++;
    else if(s[i]=="TLE") cnt[2]++;
    else cnt[3]++;
  }
  cout << "AC x "<<cnt[0] << endl;
  cout << "WA x "<<cnt[1] << endl;
  cout << "TLE x "<<cnt[2] << endl;
  cout << "RE x "<<cnt[3] << endl;

  return 0;
}

Measured memory_bytes: 6424
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,a,b;
	cin>>n;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(i%n==0)
		{
			cout<<"OK";
			return 0;
		}
	}
	cout<<"NG";
	return 0;
 } 

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

int main () {
  int N;
  cin >> N;
  
  int div[1000000];
  for ( int i = 1 ; i < N ; ++i ) div[i] = 1;
  for ( int i = 2 ; i < N ; ++i ) {
    for ( int j = i ; j < N ; j += i ) ++div[j];
  }
  
  int result = 0;
  for ( int i = 1 ; i < N ; ++i ) result += div[i];
  
  cout << result << endl;
} 

Measured memory_bytes: 7500
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int main(void)
{
    int n;

    scanf("%d", &n);
    printf("%.10f\n", pow(n / 3.0, 3));

    return 0;
}


Measured memory_bytes: 256
// -*- coding:utf-8-unix -*-

#[macro_use]
extern crate lazy_static;
extern crate num_bigint; // 0.2.2
extern crate num_traits; // 0.2.8
use num_bigint::BigInt;
use num_traits::Pow;

// use proconio::derive_readable;
use proconio::fastout;
use proconio::input;
// use std::convert::TryInto;
use libm::*;
use std::cmp::*;
use std::collections::{BinaryHeap, HashMap, HashSet};
use std::io::*;
use std::ops::Range;
use std::str::FromStr;
use superslice::*;

pub 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")
}

//abc084-D
// #[fastout]
fn main() {
    input![q: usize, lrs: [(i64, i64); q]];

    let mut primes = Vec::new();
    primes.push(2);
    let mut comsum_like2017s: Vec<usize> = vec![0; 100001];
    // let mut comsum_like2017s = vec![0; 100];

    // for i in 3..(100) {
    for i in 3..(100000 + 1) {
        let mut is_prime = true;

        if i % 2 == 0 {
            is_prime = false;
        } else {
            for prime in primes.iter() {
                if *prime > (sqrt(i as f64) as usize) {
                    break;
                }
                if i % prime == 0 {
                    is_prime = false;
                    break;
                }
            }
        }
        if is_prime {
            primes.push(i);
        }

        let is_contain_div2 = primes.binary_search(&((i + 1) / 2)).is_ok();

        if is_prime && is_contain_div2 {
            comsum_like2017s[i] = comsum_like2017s[i - 2] + 1;
        } else {
            comsum_like2017s[i] = comsum_like2017s[i - 2];
        }
    }

    // let mut v: Vec<_> = primes.iter().collect();
    // v.sort();
    // eprintln!("{:?}", v);
    // let a = comsum_like2017s.as_slice();
    // eprintln!("{:?}", (&a[..100]).iter().enumerate().collect::<Vec<_>>());

    // println!("{}", maxes.iter().max().unwrap());

    for (l, r) in lrs.iter() {
        println!(
            "{}",
            comsum_like2017s[*r as usize] - comsum_like2017s[max(l - 2, 0) as usize]
        );
    }
}

// fn go(mid: usize, d: usize, use_num: usize, num753_cand: &mut Vec<usize>, n: usize) {}

// use lazy_static::lazy_static;
// use std::sync::Mutex;

// lazy_static! {
//     static ref VALUES: Mutex<Vec<i32>> = Mutex::default();
// }

// let mut values = VALUES.lock().unwrap();
// values.extend_from_slice(&[1, 2, 3, 4]);
// assert_eq!(&*values, &[1, 2, 3, 4]);


Measured memory_bytes: 5700
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>

using namespace std;

class Deer{
  public:
    int t;
    int x;
    int y;
  Deer():x(0),y(0){}
};

vector<Deer> Deer_queue;

int main(){
  int N;
  cin>>N;
  Deer now_deer;

  for(int i=0;i<N;i++){
    Deer deer; 
    cin>>deer.t>>deer.x>>deer.y;
    Deer_queue.push_back(deer);
  }

  for(auto it=Deer_queue.begin();it!=Deer_queue.end();it++){
    int t=it->t; 
    int x=it->x;
    int y=it->y;
  
    t=abs(now_deer.t-t);
    x=abs(now_deer.x-x);
    y=abs(now_deer.y-y);
    
    t-=x;
    t-=y;
    
    if(t<0||t%2!=0){
      cout<<"No"<<endl;
      return 0;
    }

    now_deer.t=it->t;
    now_deer.x=it->x;
    now_deer.y=it->y;
  }

  cout<<"Yes"<<endl;

  return 0;
}


Measured memory_bytes: 1912
n = int(input())
s = [str(input()) for _ in range(n)]
abc_str = 'abcdefghijklmnopqrstuvwxyz'
anagram_lst = []
number = 0

def count_lst(x):
    count_lst = [0]*26
    for j in range(10):
        abc = x[j]
        for k in range(26):
            if abc==abc_str[k]:
                count_lst[k] += 1
                break
    return count_lst

def addition(n):
    answer = 0
    for i in range(1,n+1):
        answer += i
    return answer

for i in range(n):
    string = s[i]
    anagram_lst.append(count_lst(string))

anagram_lst.sort()
count = 1
for i in range(n-1):
    anagram1 = anagram_lst[i]
    anagram2 = anagram_lst[i+1]
    if anagram1==anagram2:
        count +=1
        if i==n-2:
            number += addition(count-1)
    else:
        number += addition(count-1)
        count = 1

print(number)

Measured memory_bytes: 94296
#include <bits/stdc++.h>
using namespace std;
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >= (ll)(ee); --ii)
#define VALS(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define pf push_front
#define INF 1234567890ll
#define PI (acos((ld)-1.0))
#define ll long long int 
#define ld long double
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
typedef pair <int, int> pi;
typedef pair <ll, ll> pl;
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9 + 7;


int main()
{
	vector <pi> v;
	IAMSPEED
	int n; cin >> n;
	FOR(i, 1, n) {
		int x; cin >> x;
		v.push_back(pi(x, i));
	}
	sort(v.begin(), v.end());
	for (auto i : v) {
		cout << i.second << ' ';
	}
}

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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main()
{
    int n,k;
    cin >> n >> k;
    if(n < 6) cout << "0" << endl;
    else if(n < 13) cout << k/2 << endl;
    else cout << k << endl;
}


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

int main()
{
	int N = 0;
	cin >> N;
	long long A[N], B[N];
	for(int i = 0; i < N; i++){
		cin >> A[i] >> B[i];
	}
	long long count = 0;
	for(int i = N - 1; i >= 0; i--){
		A[i] += count;
		if(A[i] == 0){
			;
		}else if(!(A[i] % B[i])){
			;
		}else{
			long long quot = A[i] / B[i];
			count += B[i] * (quot + 1) - A[i];
		}
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#define ll long long
#define rep(a,b) for(ll a=0;a<b;++a)

using namespace std;
int main(void){
    string s;
    cin>>s;
    for(char c:s) cout<<'x';
    cout<<endl;
}


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

const int MAX_N = 1 << 17;
const int INF = (1LL << 31) - 1;

template <class T>
struct MinSegTree3 {
	int n;
	struct S {
		bool flag;
		T dat;
		S() : dat(INF), flag(false) {}
	};

	S node[2 * MAX_N - 1];
	void init(int n_) {
		n = 1;
		while(n < n_) n *= 2;
	}

	void propagate(int k) {
		if(!node[k].flag) return;
		node[k].flag = false;
		if(2 * k + 1 < 2 * n - 1) {
			S& t = node[k];
			S& l = node[2 * k + 1];
			S& r = node[2 * k + 2];
			l.flag = r.flag = true;
			l.dat = r.dat = t.dat;
		}
	}

	void update(int a, int b, T x) { update(a, b, x, 0, 0, n); }

	void update(int a, int b, T x, int k, int l, int r) {
		propagate(k);
		if(r <= a || b <= l) return;
		if(a <= l && r <= b) {
			node[k].dat = x;
			node[k].flag = true;
			propagate(k);
			return;
		}
		update(a, b, x, k * 2 + 1, l, (l + r) / 2);
		update(a, b, x, k * 2 + 2, (l + r) / 2, r);
		// merge
		node[k].dat = min(node[2 * k + 1].dat, node[2 * k + 2].dat);
	}

	T query(int a, int b) { return query(a, b, 0, 0, n); }

	T query(int a, int b, int k, int l, int r) {
		propagate(k);
		if(r <= a || b <= l) return INF;
		if(a <= l && r <= b) return node[k].dat;
		T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return min(vl, vr);
	}
};

template <class T>
struct MaxSegTree3 {
	int n;
	struct S {
		bool flag;
		T dat;
		S() : dat(-INF), flag(false) {}
	};

	S node[2 * MAX_N - 1];
	void init(int n_) {
		n = 1;
		while(n < n_) n *= 2;
	}

	void propagate(int k) {
		if(!node[k].flag) return;
		node[k].flag = false;
		if(2 * k + 1 < 2 * n - 1) {
			S& t = node[k];
			S& l = node[2 * k + 1];
			S& r = node[2 * k + 2];
			l.flag = r.flag = true;
			l.dat = r.dat = t.dat;
		}
	}

	void update(int a, int b, T x) { update(a, b, x, 0, 0, n); }

	void update(int a, int b, T x, int k, int l, int r) {
		propagate(k);
		if(r <= a || b <= l) return;
		if(a <= l && r <= b) {
			node[k].dat = x;
			node[k].flag = true;
			propagate(k);
			return;
		}
		update(a, b, x, k * 2 + 1, l, (l + r) / 2);
		update(a, b, x, k * 2 + 2, (l + r) / 2, r);
		// merge
		node[k].dat = max(node[2 * k + 1].dat, node[2 * k + 2].dat);
	}

	T query(int a, int b) { return query(a, b, 0, 0, n); }

	T query(int a, int b, int k, int l, int r) {
		propagate(k);
		if(r <= a || b <= l) return -INF;
		if(a <= l && r <= b) return node[k].dat;
		T vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
		T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return max(vl, vr);
	}
};

MaxSegTree3<int> st;

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

	int n, q;
	cin >> n >> q;
	st.init(n);

	while(q--) {
		int a, s, t, x;
		cin >> a;
		if(a == 0) {
			cin >> s >> t >> x;
			st.update(s, t + 1, -x);
		}
		else {
			cin >> s >> t;
			cout << -st.query(s, t + 1) << endl;
		}
	}
}

Measured memory_bytes: 5212
import math
#素数列挙
def get_primes(limit):
    A = [i for i in range(2, limit+1)]
    P = []
    time = 0
    
    while True:
        prime = min(A)
        
        if prime > math.sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P



def resolve():
    N = int(input())
    cc = 0
    for i in range(1,N+1):
        includers = N//i
        
        cc+= i*(includers+1)*includers//2
    print(cc)
resolve()




Measured memory_bytes: 63060
#include <bits/stdc++.h>
using namespace std;
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define rep(i, n) repl(i, 0, n)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18 + 10;
const int dx[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	int x, n;
	cin >> x >> n;
	set<int> s;
	repl(i, -10, 110) s.insert(i);
	rep(i, n) {
		int a;
		cin >> a;
		s.erase(a);
	}
	vector<int> a;
	for (auto p : s) a.push_back(p);
	int now = inf, ans = 0;
	n = a.size();
	rep(i, n) {
		if (now > abs(a[i] - x)) now = abs(a[i] - x), ans = a[i];
	}
	cout << ans << endl;
	return 0;
}

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

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    vector<vector<bool>> a(n, vector<bool>(n));
    vector<int64_t> r(n);
    for (auto&& aa : a) {
        string s;
        cin >> s;
        for (auto i : irange(0L, n)) {
            aa[i] = (s[i] == '#');
            r[i] += (aa[i] ? 1 : 0);
        }
    }

    if (count(r.begin(), r.end(), 0L) == n) {
        cout << -1 << endl;
        return 0;
    }

    int64_t m = n;
    for (auto i : irange(0L, n)) {
        int64_t k = count(a[i].begin(), a[i].end(), false);

        if (k == 0) {
            m = 0;
        } else if (r[i] > 0) {
            m = min(m, k);
        } else {
            m = min(m, k + 1);
        }
    }

    int64_t ans = n - (count(r.begin(), r.end(), n)) + m;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int  N;
	cin >> N;
	for (int i = 9; i > 0;i--){
		if (N % i == 0){
			N /= i;
			break;
		}
	}
	if (N < 10){
		cout << "Yes" <<endl;
	}
	else{
		cout << "No" <<endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  int a,b;
  cin>>a>>b;
  cout<<a*b<<endl;
}

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

int main()
{
  int n, x, y;
  cin >> n >> x >> y;
  vector<int> ans(n - 1);
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int dx = i > x ? i - x : x - i;
      int dy = j > y ? j - y : y - j;
      ans.at(min(j - i - 1, dx + dy))++;
    }
  }
  for (auto&& e : ans) {
    cout << e << endl;
  }
}


Measured memory_bytes: 256
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if A == B:
  print("YES")
  exit()

if W >= V:
  print("NO")
  exit()
  
if A > B:
  V *= -1
  W *= -1

  A = A + V * T
  B = B + W * T
  if A <= B:
    print("YES")
    exit()

else:
  A = A + V * T
  B = B + W * T
  
  if A >= B:
    print("YES")
    exit()
      
print("NO")


Measured memory_bytes: 9120
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
ll inf = 1e9+7;

mat mult(mat &A,mat &B){
	mat C(A.size(),vec(B[0].size()));
	int n = A.size();
	for(int i=0;i<n;i++){
		for(int k=0;k<n;k++){
			for(int j=0;j<n;j++){
				C[i][j] = (C[i][j]+A[i][k]*B[k][j])%inf;
			}
		}
	}
	return C;
}

mat pow(mat A,ll m){
	if(m==1) return A;
	else if(m%2==0){
		mat B = pow(A,m/2);
		return mult(B,B);
	}else{
		mat B = pow(A,m-1);
		return mult(A,B);
	}
}

ll N,K;

int main(){
	cin >> N >> K;
	mat A(N,vec(N));
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			cin >> A[i][j];
		}
	}
	mat res = pow(A,K);
	ll ans = 0;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			ans = (ans+res[i][j])%inf;
		}
	}
	cout << ans << endl;
}

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

int main() {
    string s;
    cin >> s;
    for(int i = 0; i < s.length(); ++i){
        if(s[i] == s[i + 1]){
            cout << i + 1 <<  " " << i + 2;
            return 0;
        }
        if(s[i] == s[i + 2]){
            cout << i + 1 << " " << i + 3;
            return 0;
        }
    }
    cout << -1 << " " << -1;
    return 0;
}


Measured memory_bytes: 512
import math

#n = int(input())
w, h, x, y = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = input()
#list = list(s)

kotae = w * h / 2

flag = 0

if ( (w / 2 == x) and (h / 2 == y) ) :
    flag = 1


print(kotae, flag)

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

int main(){

  int n, m, q;
  int left[200000], right[200000];
  bool flag[200000];
  cin >> n >> m >> q;
  for(int i=0; i<n; i++) flag[i] = true;

  left[0] = n-1;   right[0] = 1;
  left[n-1] = n-2; right[n-1] = 0;
  for(int i=1; i<n-1; i++) {
    left[i] = i-1; right[i] = i+1;
  }

  int now_student = 0;
  for(int i=0; i<m; i++) {
    int num;
    cin >> num;
    if( num % 2 ) { //奇数の場合
      for(int j=0; j<num; j++) {
	now_student = left[now_student];
      }

      left[right[now_student]] = left[now_student];
      right[left[now_student]] = right[now_student];
      flag[now_student] = false;
      int tmp = right[now_student];
      now_student = tmp;
    }

    else {          //偶数の場合
      for(int j=0; j<num; j++) {
	now_student = right[now_student];
      }
      
      left[right[now_student]] = left[now_student];
      right[left[now_student]] = right[now_student];
      flag[now_student] = false;
      int tmp = right[now_student];
      now_student = tmp;
    }
  }

  for(int i=0; i<q; i++) {
    int num;
    cin >> num;
    if( flag[num] == false ) cout << 0 << endl;
    else cout << 1 << endl;
  }
}

Measured memory_bytes: 2916
#include <stdio.h>

#define NINE 9

int main(void){

	int cnt1;
	int cnt2;
	
	for(cnt1=1;cnt1<=NINE;cnt1++){
		for(cnt2=1;cnt2<=NINE;cnt2++){
			printf("%dx%d=%d\n",cnt1,cnt2,cnt1*cnt2);
		}
	}
	
return 0;
}


Measured memory_bytes: 1920
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
using namespace std;
 
#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
 
using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;



int main(){
	int N; cin >> N;
	vector<int> d(N);
	rep(i,N) cin >> d[i];
	int ans = 0;
	rep(i,N-1){
		repr(j,i+1,N){
			ans += d[i]*d[j];
		}
	}
	cout << ans << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int ans = 0;
    int n, m;
    cin >> n >> m;
    if(n == 1){
        ans = (m + 1) % mod;
    }else{
        int x = (m / (n - 1)) % mod;
        ans = (m + 1) % mod * ((2 * x + 1) % mod) % mod - (n - 1) % mod * x % mod * (x + 1) % mod;
        ans = (ans % mod + mod) % mod;
    }
    cout << ans << endl;
}

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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	int s = a + b + c;
	int m = max(a, max(b, c));
	int t = m + (s % 2 != 3 * m % 2);
	cout << (3 * t - s) / 2 << endl;
	return 0;
}


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,INF=mod*mod*3;
#define rep(i,N) for(ll i=0; i<(N); i++)
#define rep1(i,N) for(ll i=1; i<(N); i++)
#define pb push_back

ll N,M;
P bdg[100005];
ll siz[100005];
ll par[100005];
ll rnk[100005];
ll ans[100005];
bool love[100005];
void init(ll n){
	for(ll i=0; i<n; i++){
		par[i]=i;
		rnk[i]=0;
		siz[i]=0;
	}
}
ll find(ll x){
	if(par[x]==x){
		return x;
	}else{
		return par[x]=find(par[x]);
	}
}
void unite(ll x,ll y){
	x=find(x);
	y=find(y);
	if(x==y) return;
	if(rnk[x]<rnk[y]){
		siz[y]+=siz[x];
		par[x]=y;
	}else{
		siz[x]+=siz[y];
		par[y]=x;
		if(rnk[x]==rnk[y]) rnk[x]++;
	}
}
bool same(ll x,ll y){
	return find(x)==find(y);
}
ll size(ll x) {
    return siz[find(x)];
}

int main(){

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

cin>>N>>M;
rep(j,M){
	cin>>bdg[j].first>>bdg[j].second;
	bdg[j].first--; bdg[j].second--;
}
ll unko=N*(N-1)/2;
init(N);
for(ll i=M-1;i>=0;i--){
	ll x=bdg[i].first,y=bdg[i].second;
	ans[i]=unko;
	if(same(x,y)){
		ll root=find(x);
		if(!love[x]){
			siz[root]++; love[x]=true;
		}
		if(!love[y]){
			siz[root]++; love[y]=true;
		}
	}else{
		ll root1=find(x); 
		ll root2=find(y); 
		if(!love[x]){
			siz[root1]++; love[x]=true;
		}
		if(!love[y]){
			siz[root2]++; love[y]=true;
		}
		unko-=siz[root1]*siz[root2];
		unite(x,y);
	}
}

rep(i,M) cout<<ans[i]<<endl;

}
	


Measured memory_bytes: 8364