akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

#define ll long long
#define tc                int T;cin>>T;while(T--)
const int INF = 1e9 + 5;
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int n; cin >> n;
	vector<vector<int>> a(n, vector<int>(3));
	vector<vector<int>> dp(n, vector<int>(3, 0));
	for (auto& e : a)for (auto& d : e)cin >> d;
	dp[0][0] = a[0][0];
	dp[0][1] = a[0][1];
	dp[0][2] = a[0][2];
	for (int i = 1; i < n; ++i) {
		for (int e : {0, 1, 2}) {
			for (int f : {0, 1, 2}) {
				if (e != f)dp[i][e] = max(dp[i][e], dp[i - 1][f] + a[i][e]);
			}
		}
	}
	int ans = 0;
	for (int f : {0, 1, 2})ans = max(ans, dp[n - 1][f]);
	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 11264
use proconio::input;

fn main() {
    input! {
        n: usize,
        d: isize,
        xy: [[isize; 2]; n]
    }
    let d2 = d.pow(2);
    let c = xy
        .iter()
        .filter(|p| p[0].pow(2) + p[1].pow(2) <= d2)
        .count();
    print!("{}", c)
}


Measured memory_bytes: 15780
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;
typedef pair<Pii, int> PPi;

template<typename T>
void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readi(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }

void dfs(int a, vector<bool> &used, int &ans, int d, vector<Pii> &pX, vector<Pii> &pY, set<PPi> &sX, set<PPi> &sY, vec &X, vec &Y){
    ans += Upper_bound(pX, Pii(X[a] - d, Y[a] + d)) - Upper_bound(pX, Pii(X[a] - d, Y[a] - d - 1));
    ans += Upper_bound(pX, Pii(X[a] + d, Y[a] + d)) - Upper_bound(pX, Pii(X[a] + d, Y[a] - d - 1));
    ans += Upper_bound(pY, Pii(Y[a] - d, X[a] + d - 1)) - Upper_bound(pY, Pii(Y[a] - d, X[a] - d));
    ans += Upper_bound(pY, Pii(Y[a] + d, X[a] + d - 1)) - Upper_bound(pY, Pii(Y[a] + d, X[a] - d));

    vec v(0);

    while(true){
        auto it = sX.lower_bound(PPi(Pii(X[a] - d, Y[a] - d), -1));
        if(it == sX.end() || (*it).first.first > X[a] - d || (*it).first.second > Y[a] + d) break;
        v.push_back((*it).second);
        sX.erase(it);
    }

    while(true){
        auto it = sX.lower_bound(PPi(Pii(X[a] + d, Y[a] - d), -1));
        if(it == sX.end() || (*it).first.first > X[a] + d || (*it).first.second > Y[a] + d) break;
        v.push_back((*it).second);
        sX.erase(it);
    }

    while(true){
        auto it = sY.lower_bound(PPi(Pii(Y[a] - d, X[a] - d), -1));
        if(it == sY.end() || (*it).first.first > Y[a] - d || (*it).first.second > X[a] + d) break;
        v.push_back((*it).second);
        sY.erase(it);
    }

    while(true){
        auto it = sY.lower_bound(PPi(Pii(Y[a] + d, X[a] - d), -1));
        if(it == sY.end() || (*it).first.first > Y[a] + d || (*it).first.second > X[a] + d) break;
        v.push_back((*it).second);
        sY.erase(it);
    }

    REP(i, v.size()){
        if(!used[v[i]]){
            used[v[i]] = true;
            dfs(v[i], used, ans, d, pX, pY, sX, sY, X, Y);
        }
    }
}

signed main(){

    int N, a, b;
    cin >> N >> a >> b;
    a--; b--;
    vec x(N), y(N), X(N), Y(N);
    REP(i, N){
        cin >> x[i] >> y[i];
        X[i] = x[i] + y[i];
        Y[i] = x[i] - y[i];
    }

    vector<Pii> pX(N), pY(N);
    set<PPi> sX, sY;
    vector<bool> used(N, false);
    REP(i, N){
        pX[i] = Pii(X[i], Y[i]);
        pY[i] = Pii(Y[i], X[i]);
        sX.insert(PPi(pX[i], i));
        sY.insert(PPi(pY[i], i));
    }
    SORT(pX); SORT(pY);
    
    int ans = 0;
    int d = max(llabs(X[a] - X[b]), llabs(Y[a] - Y[b]));
    //cout << d << endl;

    used[a] = true;
    dfs(a, used, ans, d, pX, pY, sX, sY, X, Y);
    cout << ans / 2;

    return 0;
}

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

int dp[1001][1001];
int v[1001], w[1001];
int main() {
	int W, N;
	int cnt = 1;
	while (scanf("%d", &W), W) {
		scanf("%d", &N);
		rep(i, N)scanf("%d,%d", &v[i], &w[i]);
		for (int i = 0; i < N; i++) {
			for (int j = 0; j <= W; j++) {
				if (j < w[i]) dp[i + 1][j] = dp[i][j];
				else dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i]);
			}
		}
		int Max = 0, Min = 0;
		for (int i = 0; i <= W; i++) {
			if (Max < dp[N][i]) { Max = dp[N][i]; Min = i; }
		}
		printf("Case %d:\n%d\n%d\n", cnt, Max, Min);
		cnt++;
	}
	return 0;
}



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

typedef long long ll;

ll N, K, curpow, a[10001];
vector<ll> s[2];

ll llog(ll n)
{
    ll ans = 1LL;
    while (n != 1LL)
    {
        n /= 2LL;
        ans++;
    }
    return ans;
}

ll get_ans(int m)
{
    if (curpow == -1LL)
    {
        ll ans = s[m][0];
        for (ll x : s[m])
            ans &= x;
        return ans;
    }
    s[1-m].clear();
    for (ll x : s[m])
    {
        if (x & (1LL << curpow)) s[1-m].push_back(x);
    }
    if (s[1-m].size() == K) {
        curpow = -1;
        return get_ans(1-m);
    }
    else if (s[1-m].size() > K)
    {
        curpow--;
        return get_ans(1-m);
    }
    else
    {
        curpow--;
        return get_ans(m);
    }
}

int main()
{
    scanf("%lld %lld", &N, &K);
    for (int i = 1; i <= N; i++)
    {
        scanf("%lld", a + i);
        a[i] += a[i-1];
    }
    for (int i = 0; i <= N; i++)
    {
        for (int j = i + 1; j <= N; j++)
        {
            ll tmp = a[j] - a[i];
            s[0].push_back(tmp);
            curpow = max(curpow, llog(tmp));
        }
    }
    printf("%lld\n", get_ans(0));
    return 0;
}


Measured memory_bytes: 6384
from itertools import product
 
D, G = map(int, input().split())
score = []
for i in range(D):
    p, c = map(int, input().split())
    s = (i + 1) * 100
    score.append([s, p, c, s * p + c])
 
ans = float('inf')
for ptn in product([0, 1], repeat=D):
    total = 0
    cnt = 0
    for i in range(D):
        total += score[i][3] * ptn[i]
        cnt += score[i][1] * ptn[i]
 
    if 0 in ptn[::-1]:
        i = D - 1 - ptn[::-1].index(0)
        x = score[i]
    else:
        x = score[-1]
 
    for i in range(x[1]):
        if total >= G:
            break
        total += x[0]
        cnt += 1
 
    if total < G:
        cnt = float('inf')
    ans = min(ans, cnt)
print(ans)

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

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

int main()
{
  int N;
  cin >> N;
  rep(i, N)
  {
    cout << "ACL";
  }
}


Measured memory_bytes: 3576
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int m1 = Integer.parseInt(sc.nextLine().split(" ")[0]);
        int m2 = Integer.parseInt(sc.nextLine().split(" ")[0]);

        System.out.println(m1 + 1 == m2 ? "1" : "0");
    }
}


Measured memory_bytes: 23124
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

template <typename T = ll>
struct SegmentTreeLazy {
  private:
    int n;
    vector<T> node, lazy;
    vector<bool> lazyFlag;

  public:
    SegmentTreeLazy(int sz) {
        n = 1;
        while (n < sz)
            n *= 2;
        node.resize(2 * n - 1, 0);
        lazy.resize(2 * n - 1, 0);
        lazyFlag.resize(2 * n - 1, false);
    }
    SegmentTreeLazy(vector<T> v) {
        int sz = int(v.size());
        n = 1;
        while (n < sz)
            n *= 2;
        node.resize(2 * n - 1, 0);
        lazy.resize(2 * n - 1, 0);
        lazyFlag.resize(2 * n - 1, false);

        for (int i = 0; i < sz; i++)
            node[i + n - 1] = v[i];
        for (int i = n - 2; i >= 0; i--)
            node[i] = max(node[i * 2 + 1], node[i * 2 + 2]);
    }
    void lazyEvaluate(int k, int l, int r) {
        if (lazyFlag[k]) {
            node[k] = lazy[k];
            if (r - l > 1LL) {
                lazy[k * 2LL + 1LL] = lazy[k * 2LL + 2LL] = lazy[k];
                lazyFlag[k * 2LL + 1LL] = lazyFlag[k * 2LL + 2LL] = true;
            }
            lazyFlag[k] = false;
        }
    }
    void update(int a, int b, T x, int k = 0, int l = 0, int r = -1) {
        if (r < 0)
            r = n;
        lazyEvaluate(k, l, r);
        if (b <= l || r <= a)
            return;
        if (a <= l && r <= b) {
            lazy[k] = x;
            lazyFlag[k] = true;
            lazyEvaluate(k, l, r);
        } else {
            update(a, b, x, 2 * k + 1, l, (l + r) / 2);
            update(a, b, x, 2 * k + 2, (l + r) / 2, r);
            node[k] = max(node[2 * k + 1], node[2 * k + 2]);
        }
    }

    T find(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r < 0)
            r = n;
        lazyEvaluate(k, l, r);
        if (b <= l || r <= a)
            return 0;
        if (a <= l && r <= b)
            return node[k];
        T vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
        T vr = find(a, b, 2 * k + 2, (l + r) / 2, r);
        return max(vl, vr);
    }
};

int main() {
    int n;
    cin >> n;
    vl h(n);
    vl a(n);
    for (int i = 0; i < n; ++i) {
        cin >> h[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    SegmentTreeLazy<ll> seg(200002);
    for (int i = 0; i < n; ++i) {
        ll temp = seg.find(0, h[i]);
        seg.update(h[i], h[i] + 1, temp + a[i]);
    }
    cout << seg.find(0, 200001) << "\n";

    return 0;
}

Measured memory_bytes: 11648
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
using namespace std;
const int mod=1e9+7;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n; cin >> n;
    string ans="No";
    if(n/10==9 or n%10==9) ans="Yes";
    cout << ans << endl;
 }    


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <iomanip>
#include <unordered_set>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vll> vvll;
typedef map<int,int> mii;
typedef set<int> si;
#define rep(i,n) for(ll i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define arep(i,v) for(auto i : v)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
// #define fi first
#define se second
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template <class T> inline void dump(T &v){irep(i, v){cout<<(*i)<<((i==--v.end())?'\n':' ');}}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
constexpr ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
constexpr ld EPS = 1e-11;


int main() {

    map<string,int> m;
    int n;
    cin>>n;
    rep(i,n){
        string s;
        cin>>s;
        m[s]++;
    }
    cout<<"AC x "<<m["AC"]<<endl;
    cout<<"WA x "<<m["WA"]<<endl;
    cout<<"TLE x "<<m["TLE"]<<endl;
    cout<<"RE x "<<m["RE"]<<endl;
}



Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvvl vector<vvl>
#define vvl vector<vector<ll>>
#define VV(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define VVV(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;

#define P 998244353
#define N_MAX 10000000
typedef long long int ll;
ll fac[N_MAX+1];
ll inv[N_MAX+1];
ll finv[N_MAX+1];

ll comb(ll n, ll k){
  if(n<0||k<0||n<k) return 0;
  return (((fac[n]*finv[n-k])%P)*finv[k])%P;
}

void init(){
  fac[0] = finv[0] = fac[1] = finv[1] = inv[1] = 1;
  for(int i = 2; i <= N_MAX; i++){
    fac[i] = (fac[i-1]*i)%P;
    inv[i] = ((-(P/i)*inv[P%i])%P+P)%P;
    finv[i] = (finv[i-1]*inv[i])%P;
  }
}
ll pp(ll a, ll b){
  return (a * b)%P;
}
ll mpow(ll a, ll b, ll p = -1){
  ll ret = 1, num = a;
  if(p==-1){
    while(b>0){
      if(b%2) ret *= num;
      num = num * num;
      b /= 2;
    }
  }else{
    while(b>0){
      if(b%2) ret = (ret*num)%p;
      num = (num*num)%p;
      b /= 2;
    }
  }
  return ret;
}
int main(int argc, char const *argv[]) {
  init();
  ll a, b, c, d;std::cin >> a >> b >> c >> d;
  vvl dp = VV(c+1, d+1, 0, ll);
  dp[a][b] = 1;

  for(int i=a;i<=c;i++){
    for(int j=b;j<=d;j++){
      dp[i][j] = (dp[i][j] - pp(dp[i-1][j-1], (i-1)*(j-1)) + P)%P;
      if(i!=c){
        dp[i+1][j] = (dp[i+1][j] + pp(dp[i][j], j))%P;
      }
      if(j!=d){
        dp[i][j+1] = (dp[i][j+1] + pp(dp[i][j], i))%P;
      }
    }
  }
  std::cout << dp[c][d] << '\n';
  return 0;
}


Measured memory_bytes: 307720
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Text;

namespace ConsoleApp {

    class Program {
        static void Main(string[] args) {
            var num = int.Parse(Console.ReadLine());
            var gcf = GetGCF(num, 2);

            Console.WriteLine(num * 2 / gcf);
        }

        private static int GetGCF(int x, int y) {
            //x>=yとする
            if (y > x) {
                var temp = y;
                y = x;
                x = temp;
            }

            int r;

            while ((r = x % y) != 0) {
                x = y;
                y = r;
            }
            return y;
        }
    }
    
}


Measured memory_bytes: 13140
fn solve(ps: Vec<(usize, String)>) -> (usize, usize) {
    let mut ans = vec![false; 100001];
    let mut was = vec![0; 100001];

    let mut wa = 0;
    let mut ac = 0;
    for (p, r) in ps {
        if ans[p] {
            continue;
        }

        if r == "WA" {
            was[p] += 1;
        } else {
            ans[p] = true;
            ac += 1;
            wa += was[p];
        }
    }

    (ac, wa)
}

#[test]
fn solve_test() {
    assert_eq!(
        solve(vec![
            (1, "WA".to_owned()),
            (1, "AC".to_owned()),
            (2, "WA".to_owned()),
            (2, "AC".to_owned()),
            (2, "WA".to_owned()),
        ]),
        (2, 2)
    );

    assert_eq!(
        solve(vec![
            (7777, "AC".to_owned()),
            (7777, "AC".to_owned()),
            (7777, "AC".to_owned()),
        ]),
        (1, 0)
    );
}

#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        line.pop();
        line
    }};
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => {{
        let mut line = String::new();
        ::std::io::stdin().read_line(&mut line).unwrap();
        let iter = line.split_whitespace();
        iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
    }};
}

fn main() {
    let (_, m) = parse_line!(usize, usize);
    let ps = (0..m)
        .map(|_| parse_line!(usize, String))
        .collect::<Vec<_>>();

    let (ac, wa) = solve(ps);
    println!("{} {}", ac, wa);
}


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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){


}

Node treeSearch(Node u, int k){


}

Node treeSuccessor(Node x){


}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y



}
void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;
  
  while(x!=NIL){
    y=x;
    if(z->key < x->key)x=x->left;
    else x=x->right;
  }
  z->parent = y;

  if(y==NIL)root=z;
  else if(z->key < y->key) y->left =z;
  else y->right = z;
  
}

void inorder(Node u){
  if(u->left!=NIL)inorder(u->left);
  printf(" %d",u->key);
  if(u->right!=NIL)inorder(u->right);
			
}
void preorder(Node u){
  printf(" %d",u->key);
  if(u->left!=NIL)preorder(u->left);
  if(u->right!=NIL)preorder(u->right);
}
int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }

  }




  return 0;
}



Measured memory_bytes: 25156
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint big=2.19e17+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

///2009~
int main(void){
	int n,i,j;cin>>n;
	vector<vector<int>>tate(100001);
	vector<vector<int>>yoko(100001);
	vector<int>xz(n);
	vector<int>yz(n);
	for(i=0;i<n;i++){
		int x,y;cin>>x>>y;
		xz[i]=x;yz[i]=y;
		tate[x].pub(i);
		yoko[y].pub(i);
	}
	vector<vector<int>>go(n);
	for(int x=1;x<=100000;x++){
		for(i=1;i<tate[x].size();i++){
			go[tate[x][i]].pub(tate[x][i-1]);
			go[tate[x][i-1]].pub(tate[x][i]);
		}
		for(i=1;i<yoko[x].size();i++){
			go[yoko[x][i]].pub(yoko[x][i-1]);
			go[yoko[x][i-1]].pub(yoko[x][i]);
		}
	}
	vector<bool>mita(n);
	llint ans=-n;
	for(i=0;i<n;i++){
		//cerr<<"de"<<endl;
		if(mita[i]){continue;}
		set<int>A,B;
		queue<int>que;
		que.push(i);
		while(que.size()){
			int t=que.front();que.pop();
			if(mita[t]){continue;}
			mita[t]=1;
			
			A.ins(xz[t]);
			B.ins(yz[t]);
			for(auto it:go[t]){que.push(it);}
		}
		ans+=(llint)A.size()*B.size();
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 19072
#include <iostream>

using namespace std;

int main() {
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;

	if (x + r > W) {
		cout << "No\n";
		return 0;
	}
	else if (x - r < 0) {
		cout << "No\n";
		return 0;
	}

	if (y + r > H) {
		cout << "No\n";
		return 0;
	}
	else if (y - r < 0) {
		cout << "No\n";
		return 0;
	}

	cout << "Yes\n";

	return 0;
}



Measured memory_bytes: 3064
def main():
    N = int(input())
    A = [None]*N
    B = [None]*N
    for i in range(N):
        A[i],B[i] = map(int,input().split())
    ans = 0
    for i in range(N-1,-1,-1):
        if (A[i]+ans)%B[i] == 0:
            continue
        ans += (B[i] - (A[i]+ans)%B[i])
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 48988
n = 50021
a = Array.new(n){|i| i+1}
a[0] = 0
(2..n**(0.50)).each do |i|
  (2..(n/i)).each{|j| a[i*j-1] = 0} if a[i-1]>0
end
a.delete(0)

while gets
  q = $_.to_i
  i = 1
  while a[i] < q do i+=1 end
  puts "#{a[i-1]} #{a[i]==q ? a[i+1]:a[i]}"
end

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

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

bool isPrime(int a) {
  if(a == 2) return true;
  if(a < 2 || !(a % 2)) return false;

  double sq = sqrt(a);
  for(int i = 3; i <= sq; i += 2) {
    if(a % i == 0) return false;
  }
  return true;
}


int main() {
  int w;
  cin >> w;
  cout << w * 32 << endl;
}

Measured memory_bytes: 3160
def main():
    n = int(input())
    base = 26
    orig = ord('a')
    ans = ''
    for exp in range(1, 12):
        if (tmp := pow(base, exp)) >= n:
            n -= 1  # zero_indexed for ASCII mod
            for digit in range(exp):
                ans += (chr(orig + n % base))
                n //= base
            break
        else:
            n -= tmp
    print(ans[::-1])


if __name__ == '__main__':
    main()


Measured memory_bytes: 9136
<?php
$n = intval(fgets(STDIN));
for($i = 0; $i <= 10000; $i++){
    $dp[0][$i] = false;
}
$dp[0][0] = true;

for($i = 1; $i <= $n; $i++){
    $s = intval(fgets(STDIN));
    for($j = 0; $j < 10000; $j++){
        $dp[$i][$j] = $dp[$i - 1][$j];
        if($j >= $s && $dp[$i - 1][$j - $s]){
            $dp[$i][$j] = true;
        }
    }
}
$max = 0;
for($i = 0; $i <= 10000; $i++){
    if($i % 10 && $dp[$n][$i]){
        $max = $i;
    }
}
echo $max;



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

string s;

int main()
{
	int n;
	cin >> n;
	if (n == 22) s = "Christmas Eve Eve Eve";
	if (n == 23) s = "Christmas Eve Eve";
	if (n == 24) s = "Christmas Eve";
	if (n == 25) s = "Christmas";
	cout << s << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
using ll = long long;
using P = pair<int, int>;

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

const int INF = 1001001001;

int main(){
    int H, W; cin >> H >> W;
    int ch, cw; cin >> ch >> cw;
    int dh, dw; cin >> dh >> dw;
    ch--, cw--, dh--, dw--;

    vector<string> s(H);
    vector<vector<int>> dist(H, vector<int>(W, INF));
    rep(i,H) cin >> s[i];
    deque<P> q;

    q.push_back(P(ch, cw));
    dist[ch][cw] = 0;

    while(!q.empty()){
        P p = q.front();
        q.pop_front();
        int x = p.first;
        int y = p.second;
        int tmp = dist[x][y];

        for(int i = 0; i < 4; i++){
            int nx = x + dx[i];
            int ny = y + dy[i];
            if(nx < 0 || nx >= H || ny < 0 || ny >= W) continue;
            if(s[nx][ny] == '#') continue;
            if(dist[nx][ny] <= tmp) continue;

            q.push_front(P(nx, ny));
            dist[nx][ny] = min(dist[nx][ny], tmp);
        }
        for(int j = -2; j <= 2; j++){
            for(int k = -2; k <= 2; k++){
                int nx = x + j;
                int ny = y + k;

                if(nx < 0 || nx >= H || ny < 0 || ny >= W) continue;
                if(s[nx][ny] == '#') continue;
                if(dist[nx][ny] <= tmp + 1) continue;

                q.push_back(P(nx, ny));
                dist[nx][ny] = min(dist[nx][ny], tmp + 1);
            }
        }
    }
    /*
    rep(i,H){
        rep(j,H) {
            cout << cnt[i][j];
        }
        cout << endl;
    }
    */
    if(dist[dh][dw] == INF) cout << -1 << endl;
    else cout << dist[dh][dw] << endl;
}

Measured memory_bytes: 9484
import numpy as np
arr = np.array(list(map(int, input().split())), dtype='float128')
s = np.sqrt(arr, dtype='float128')
if arr[0] + arr[1] + 2 * np.sqrt(arr[0] * arr[1], dtype='float128') < arr[2]:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 12500
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    for (auto& x : a) cin >> x;

    vector<ll> is_prime(pow(*max_element(a.begin(), a.end()), 1.0 / 3.0) + 3,
                        1);
    vector<ll> primes, primeSqs;
    primes.reserve(is_prime.size());
    primeSqs.reserve(is_prime.size());
    is_prime[0] = 0;
    is_prime[1] = 0;

    for (int i = 2; i < is_prime.size(); ++i) {
        if (is_prime[i]) {
            primes.push_back(i);
            primeSqs.push_back(i * i);
            for (int j = i * i; j < is_prime.size(); j += i) {
                is_prime[j] = 0;
            }
        }
    }

    map<ll, int> cnt;

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < primes.size(); ++j) {
            if (primes[j] * primes[j] * primes[j] > a[i]) break;

            while (a[i] % (primes[j] * primes[j] * primes[j]) == 0) {
                a[i] /= primes[j] * primes[j] * primes[j];
            }
        }
        cnt[a[i]]++;
    }

    int ans = 0;
    if (cnt[1] > 0) ans++;

    set<ll> used;

    for (auto& x : cnt) {
        if (x.first == 1) continue;

        if (used.count(x.first)) continue;

        ll y = x.first;
        ll z = 1;
        for (int j = 0; j < primes.size(); ++j) {
            auto divide = primes[j] * primes[j];
            if (y < divide) break;
            if (y % divide == 0) {
                y /= divide;
                z *= primes[j];
            }
        }

        if (binary_search(primeSqs.begin(), primeSqs.end(), y)) {
            auto index = lower_bound(primeSqs.begin(), primeSqs.end(), y) -
                         primeSqs.begin();
            y = 1;
            z *= primes[index];
        }

        z *= y * y;

        if (cnt.count(z)) {
            ans += max(x.second, cnt[z]);
            used.insert(z);
        } else {
            ans += x.second;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 7424
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(n)]
B = [list(map(int, input().split())) for _ in range(m)]
C = [[0 for _ in range(l)] for _ in range(n)]

for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += A[i][k]*B[k][j]

for i in range(n):
    print(" ".join(str(x) for x in C[i]))

Measured memory_bytes: 8836
n = int(input())
line = list(map(int, input().split()))
ans = 30
for i in range(n):
  count = 0
  x = line[i]
  while True:
    if x % 2 == 0:
      x = x//2
      count += 1
    else:
      break
  if count < ans:
    ans = count
print(ans)
      
    

Measured memory_bytes: 9168
from itertools import accumulate
from collections import deque
class SWAG:
    def __init__(self, operator_M, e_M):
        self.op_M = operator_M
        self.e_M = e_M
        self.q = deque([])
        self.accL = []
        self.accR = e_M
        self.L = self.R = 0

    def build(self,lst):
        self.q = deque(lst)
        self.L = len(lst)
        self.accL = list(accumulate(reversed(self.q),self.op_M))

    def __len__(self):
        return self.L + self.R

    def fold_all(self):
        if self.L: return self.op_M(self.accL[-1],self.accR)
        else: return self.accR

    def append(self,x):
        self.q.append(x)
        self.accR = self.op_M(self.accR,x)
        self.R += 1
    
    def popleft(self):
        if self.L:
            self.accL.pop()
            self.L -= 1
            return self.q.popleft()
        elif self.R:
            self.L,self.R = self.R-1,0
            self.accL = list(accumulate(reversed(self.q),self.op_M))
            self.accR = self.e_M
            self.accL.pop()
            return self.q.popleft()
        else:
            assert 0


# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

n,l,*a = [int(i) for i in read().split()]

q = SWAG(min,10**9)
q.build(a[:l])
ans = [q.fold_all()]
for i in a[l:]:
    q.popleft()
    q.append(i)
    ans.append(q.fold_all())

print(*ans)



Measured memory_bytes: 118832
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;
int main(){
    int n;
    cin >> n;
    map<string,int> mp;
    REP(i,n) {
        string s;
        cin >> s;
        mp[s]++;
    }

    int max = 0;

    for( const auto &e : mp){
        int v = e.second;
        if (v > max) max = v;
    }

    for (auto x= mp.begin();x!=mp.end();x++){
        if (x -> second == max){
            cout << x->first << endl;


        }
    }
    



    //REP(i,n) cout << s[i] << endl;
    return 0;





}

Measured memory_bytes: 25728
n = int(input())
a = list(map(int,input().split()))
num_list = [0] * 1000001
 
def solve():
    ans = 0
    for i in range(n):
        if num_list[a[i]] == 0:
            num_list[a[i]] += 1
            for j in range(2, (1000000 // a[i]) + 1):
                num_list[j * a[i]] += 1
        elif num_list[a[i]] == 1:
            num_list[a[i]] += 1
    for i in range(n):
        if num_list[a[i]] == 1:
            ans += 1
    return ans
 
print(solve())

Measured memory_bytes: 32232
using System;
using System.Linq;

public class Program
{
	static void Main(string[] args)
	{
		var InputValue = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).OrderBy(x => x).ToList<int>();

		Console.WriteLine(string.Format("{0} {1} {2}", InputValue[0], InputValue[1], InputValue[2]));

	}
}






Measured memory_bytes: 10180
#include <iostream>
using namespace std;
int main(void){
    
    //変数：ゲームの回数「　N　」と置く
    int N;
    //変数：石の総数「　K　」とゲームの参加人数「　P　」と置く
    int K, P;
    
    //入力：ゲームの回数「　N　」を入力する
    cin >> N;

    for(int i = 0; i < N; i++){
        cin >> K >> P;
        
        //条件：余りのが無いときは「　P　」が答え、余りがあるときは「　余り　」が答え
        if( (K % P) == 0 ) cout << P << endl;
        else cout << K % P << endl;
    }
    
    return 0;
}



Measured memory_bytes: 3100
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"

using namespace std;

typedef long int li;
typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pt;

#define fi first
#define se second
#define lson (p<<1)+1
#define rson (p<<1)+2
#define dump(x) cout << #x << " = " << x << endl
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

ll n, k, a[107], b[200007];

int main () {
    fastIO;
    cin >> n >> k;
    for(li i = 0; i < n; i ++) cin >> a[i];
    b[0] = 0;
    for(li i = 0; i < k; i ++) {
        if(b[i] == 1) continue;
        for(li j = 0; j < n; j ++) {
            b[i + a[j]] = 1;
        }
    }
    if(b[k] == 1) cout << "First";
    else cout << "Second";
}


Measured memory_bytes: 1792
def Graph(ab):
    G = [[] for i in range(n)]
    for a, b in ab:
        G[a - 1].append(b)
        G[b - 1].append(a)
    return G

from collections import deque
def dfs(pair):
    q = deque()
    q.append((1, -1, 0))
    log = [0] * n
    log[0] = 1
    while q:
        V, P, S = q.popleft()
        if S == 0:
        #下に遷移していく処理
        #q.append((V, P, 1))
            for new_v in G[V - 1]:
                if new_v == P:continue
                if set(pair) == {V, new_v}:continue 
                if log[new_v - 1]:continue 
                log[new_v - 1] = 1
                q.append((new_v, V, 0))
    return sum(log) == n 


n, m = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(m)]
G = Graph(ab)

res = 0
for t in ab:
    if dfs(t):
        #print(t)
        continue
    res += 1
print(res)

Measured memory_bytes: 9476
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  vector<int> hon = {2, 4, 5, 7, 9};
  vector<int> pon = {0, 1, 6, 8};
  vector<int> bon = {3};
  string ans ;
  int N;


  cin >> N;
  N = N % 10;

  for (int i = 0; i < hon.size(); i++) {
    if(N == hon[i]) {
      ans = "hon";
    }
  }

  for (int i = 0; i < pon.size(); i++) {
    if(N == pon[i]) {
      ans = "pon";
    }
  }

  for (int i = 0; i < bon.size(); i++) {
    if(N == bon[i]) {
      ans = "bon";
    }
  }

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

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

using namespace std;

int main(int argc, char *argv[])
{
	long long n, ans = 0;
	cin >> n;
	for (long long i = 1; i < n; i++)
		ans += (n - 1) / i;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;
int main() {
	long n;
	cin >> n;
	for (long i = n; ; i--) {
		if (floor(sqrt(i))*floor(sqrt(i)) == i) {
			cout << i << endl;
			break;
		}
	}
	
	return 0;
}

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

int main() {
	string S;
	cin >> S;
	int ANS = S.size();
	for (int i = 0; i < S.size() - 1; i++) {
		if (S[i] != S[i + 1]) {
			ANS = min(ANS, max(i + 1, (int)S.size() - i - 1));
		}
	}
	cout << ANS;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>x;
	ll ret=1;
	for(i=1;i<=x;i++) ret=ret*i%1000000007;
	cout<<ret<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


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

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

  Graph G(n);
  rep(i, n - 1) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    G[a].emplace_back(b, i);
    G[b].emplace_back(a, i);
  }

  int max_color = 0;
  rep(i, n) {
    int size = G[i].size();
    max_color = max(max_color, size);
  }

  vector<int> res(n - 1, -1);
  vector<int> dist(n, -1);
  queue<P> que;

  dist[0] = 0;
  que.push({0, -1});  // (頂点, 前回の色)

  while (!que.empty()) {
    auto p = que.front();
    que.pop();
    int v = p.first, c = p.second;
    int color = 1;
    if (color == c) ++color;

    for (auto e : G[v]) {
      if (dist[e.first] != -1) continue;

      dist[e.first] = dist[v] + 1;
      que.push({e.first, color});
      res[e.second] = color;
      ++color;
      if (color == c) ++color;
    }
  }

  cout << max_color << endl;
  for (auto v : res) cout << v << endl;
}

Measured memory_bytes: 10044
#include<iostream>

#define NUM 4
#define N 4000
#define X 1000

using namespace std;

int main(){

  int n, m, l;
  int comb[NUM][N+1] = {0};

  m = X + 1;
  for(int i=0; i<m; i++){
    comb[0][i] = 1;
  }

  for(int i=1; i<NUM; i++){
    l = X * i + m;
    for(int j=0; j<l; j++){
      for(int k=0; k<m; k++){
        if(j-k>=0){
          comb[i][j] += comb[i-1][j-k];
        }
      }
    }
  }

/*  for(int i=0; i<4; i++){
    for(int j=0; j<51; j++){
      cout << comb[i][j] << " ";
    }
    cout << endl;
  }
*/

  while(cin >> n){
    cout << comb[NUM-1][n] << endl;
  }

  return 0;
}

Measured memory_bytes: 1228
import java.math.BigDecimal;
import java.util.Scanner;

class vec2 {
	private double _x, _y;
	vec2(double x, double y) {
		_x = x;
		_y = y;
	}
	vec2 scalarMultiple(double k) {
		return new vec2(k * _x, k * _y);
	}
	vec2 plus(vec2 v) {
		return new vec2(_x + v._x, _y + v._y);
	}
	vec2 minus(vec2 v) {
		return this.plus(v.scalarMultiple(-1));
	}
	double innerMultiple(vec2 v) {
		return _x * v._x + _y * v._y;
	}
	double norm() {
		return Math.sqrt(_x * _x + _y * _y);
	}
	double getX() {
		return _x;
	}
	double getY() {
		return _y;
	}
}

class triangle {
	private vec2 _A, _B, _C;
	private double _a, _b, _c;
	triangle(vec2 A, vec2 B, vec2 C) {
		_A = A;
		_B = B;
		_C = C;
		_a = _B.minus(_C).norm();
		_b = _C.minus(_A).norm();
		_c = _A.minus(_B).norm();
	}
	vec2 circumcenter() {
		double x = _A.minus(_B).innerMultiple(_C.minus(_A));
		double y = _B.minus(_C).innerMultiple(_A.minus(_B));
		double z = _C.minus(_A).innerMultiple(_B.minus(_C));
		return _A.scalarMultiple(z * x + x * y).plus(_B.scalarMultiple(x * y + y * z)).plus(_C.scalarMultiple(y * z + z * x)).scalarMultiple(1.0 / (2 * (y * z + z * x + x * y)));
	}
	double area() {
		return Math.sqrt((_a + _b + _c) * (-_a + _b + _c) * (_a - _b + _c) * (_a + _b - _c)) / 4;
	}
	double radiusOfCircumscribedCircle() {
		double sinA = 2 * area() / _b / _c;
		return _a / sinA / 2;
	}
}

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		triangle tr;
		for (int i = 0; i < n; ++i) {
			vec2 v1 = new vec2(sc.nextDouble(), sc.nextDouble());
			vec2 v2 = new vec2(sc.nextDouble(), sc.nextDouble());
			vec2 v3 = new vec2(sc.nextDouble(), sc.nextDouble());
			tr = new triangle(v1, v2, v3);
			double qx = new BigDecimal(String.valueOf(tr.circumcenter().getX())).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
			double qy = new BigDecimal(String.valueOf(tr.circumcenter().getY())).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
			double R = new BigDecimal(String.valueOf(tr.radiusOfCircumscribedCircle())).setScale(3, BigDecimal.ROUND_HALF_UP).doubleValue();
			System.out.printf("%.3f %.3f %.3f\n", qx, qy, R);
		}
		sc.close();
	}
}


Measured memory_bytes: 29080
using System;
using System.Linq;
using System.Collections.Generic;

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var st = Console.ReadLine().Split();
        var s = st[0];
        var t = st[1];
        var rep = new char[n * 2];
        for (int i = 0; i < n; ++i)
        {
            rep[i * 2] = s[i];
            rep[i * 2 + 1] = t[i];
        }

        Console.WriteLine(new string(rep));
    }
}


Measured memory_bytes: 13140
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int C = sc.nextInt();

    int max = Math.max(C,Math.max(A,B));
    System.out.print(max*10+(A+B+C-max));
      }
}


Measured memory_bytes: 22612
/*  ex3_4
    Rikuta  */

#include <stdio.h>

int main(void){

    int number;
    //numberの読み込み
    scanf("%d",&number);
    //for文を二つ使って1*1から9*9まで全通りを考えて，numberと同じになった時にYesを出力して終わる．
    for (int i = 1; i <= 9; i++)
    {
        for (int j = 1; j <= 9; j++)
        {
            if (i*j==number)
            {
                printf("Yes\n");
                return 0;
            }
            
        }
        
    }
    
    printf("No\n");

    return 0;
}

Measured memory_bytes: 128
use std::collections::BinaryHeap;
use std::io::{stdin, Read};

macro_rules! parse {
    ($iter: ident) => {
        $iter.next().unwrap().parse().unwrap()
    };
    ($iter: ident,2) => {
        (parse!($iter), parse!($iter))
    };
    ($iter: ident,3) => {
        (parse!($iter), parse!($iter), parse!($iter))
    };
    ($iter: ident,4) => {
        (parse!($iter), parse!($iter), parse!($iter), parse!($iter))
    };
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    let mut iter = s.split_whitespace();
    let (n, m): (usize, usize) = parse!(iter, 2);
    let mut a: BinaryHeap<(usize, usize)> = (0..n).map(|_| (parse!(iter), 1)).collect();
    for _ in 0..m {
        let (b, c) = parse!(iter, 2);
        a.push((c, b));
    }
    let mut res = 0;
    let mut n = n;
    let mut a = a.into_sorted_vec();
    a.reverse();
    for (v, c) in a {
        if c > n {
            res += n * v;
            break;
        } else {
            res += v * c;
            n -= c;
        }
    }
    println!("{}", res);
}


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

#define int long long 

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}

void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long 

#define pii pair<int,int >
#define vec vector<int >

#define pb push_back
#define mp make_pair
#define fr first
#define sc second

#define data asd09123jdf02i3h

#define FOR(i,l,r) for(int i=l,i##_r=r;i<=i##_r;i++)

const int maxn = 1e6+10;
const int inf = 1e9;
const lf eps = 1e-8;
const int mod = 1e9+7;

int f[maxn][3],a[maxn],n,t[maxn];
char s[maxn];

void update(int &x,int y) {
    if(y>x) x=y;
}

signed main() {
    read(n);
    for(int i=1;i<=n;i++) {
        read(a[i]);
        if(i==n) break;
        scanf("%s",s+1);
        if(s[1]=='-') t[i+1]=-1;
        else t[i+1]=1;
    }t[1]=1;
    memset(f,-63,sizeof f);
    f[0][0]=0;
    for(int i=1;i<=n;i++) {
        if(t[i]<0) {
            f[i][0]=f[i-1][0]-a[i];
            f[i][1]=max(f[i-1][0],f[i-1][1])-a[i];
            f[i][2]=max(f[i-1][1],f[i-1][2])+a[i];
        } else {
            f[i][0]=max(max(f[i-1][0],f[i-1][1]),f[i-1][2])+a[i];
            f[i][1]=f[i-1][1]-a[i];
            f[i][2]=f[i-1][2]+a[i];
        }
    }
    write(max(max(f[n][0],f[n][1]),f[n][2]));
    return 0;
}


Measured memory_bytes: 26752
n,k = map(int,input().split())
A = list(map(int,input().split()))
#print(A)
L = []
ave = sum(A[:k])

L.append(ave)

for i in range(n-k):
    #print(A[i],A[k+i])
    ave = ave - A[i] + A[k+i]
    L.append(ave)

for i in range(len(L)-1):
    if L[i] < L[i+1]:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 31684
package main

import "fmt"

func printSlice(src []int) {
	for i, v := range src {
		if i == len(src)-1 {
			fmt.Printf("%d\n", v)
		} else {
			fmt.Printf("%d ", v)
		}
	}
}

func insertionSort(src []int, len int) []int {
	for i := 1; i < len; i++ {
		v := src[i]
		j := i - 1
		for j >= 0 && src[j] > v {
			src[j+1] = src[j]
			j--
		}
		src[j+1] = v
		printSlice(src)
	}
	return src
}

func main() {
	var n int
	fmt.Scan(&n)
	target := make([]int, n)
	for i := range target {
		fmt.Scan(&target[i])
	}
	// fmt.Println(target)
	printSlice(target)
	target = insertionSort(target, len(target))
}


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

typedef long long ll;

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

    string s;
    cin >> s;
    int n = s.length();
    int rec = 0, chg = 100;
    for (int i = 0; i < n; ++i) {
        int v = s[i] - '0';
        int nr = min(rec, chg) + v;
        int nc = min(rec + 1 + 10 - v, chg - 1 + 10 - v);
        rec = nr;
        chg = nc;
    }
    cout << min(rec, chg) << endl;

    return 0;
}



Measured memory_bytes: 1948
using System;
using System.Collections.Generic;
using System.Linq;

class Program{

  static int a, b, k;
  static int sum = 0;

  static int Main() {

    string[] nyu = Console.ReadLine().Split(' ');
    a = int.Parse(nyu[0]);
    b = int.Parse(nyu[1]);
    k = int.Parse(nyu[2]);

    for (int i = 0; i < k/2; i++) {
      a = a/2;
      b += a;

      // Console.WriteLine("{0} {1}", a, b);

      b = b/2;
      a += b;
      // Console.WriteLine("{0} {1}", a, b);
    }

    if (k%2 == 1) {
      a = a/2;
      b += a;
    }


    Console.WriteLine("{0} {1}", a, b);

    return 0;
  }

}


Measured memory_bytes: 11092
let s = read_int ()
let f n = if n mod 2 = 0 then n / 2 else 3 * n + 1
let cs, a = Array.make 1000001 0, Array.make 1000001 0
let _ = a.(1) <- s; cs.(s) <- 1;
  for i = 2 to 1000000 do a.(i) <- f a.(i - 1); if cs.(a.(i)) = 0 then cs.(a.(i)) <- 1 else (Printf.printf "%d\n" i; exit 0) done

Measured memory_bytes: 19580
# -*- coding: utf-8 -*-
import sys
from bisect import bisect_left, bisect_right
sys.setrecursionlimit(10**6)

N=int(sys.stdin.readline().strip())
A=[None]+map(int, sys.stdin.readline().split())

al=[ [] for _ in range(N+1) ]	#隣接リスト
for i in range(N-1):
	u,v=map(int, sys.stdin.readline().split())
	al[u].append(v)
	al[v].append(u)

LIS=[ float("inf") for _ in range(N+1)] 
LIS[0]=float("-inf")
ans={}  #頂点i:LISの長さ

def dfs(cur,par):
    idx=bisect_left(LIS, A[cur])
    old=LIS[idx]    #LISの更新前の値をoldに持っておく
    LIS[idx]=A[cur]
    ans[cur]=bisect_left(LIS, float("inf"))-1 #LISの長さ
    for to in al[cur]:
        if par==to: continue    #遷移先が親であれば遷移しない
        dfs(to,cur)
    LIS[idx]=old    #oldの値を戻して、LIS配列を頂点curまで遷移した時点の状態に復元する
        
dfs(1,-1)

for i in range(1,N+1):
    print ans[i]

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

int main() {
  int a, b;
  cin >> a >> b;
  
  if((a * b) % 2 == 0)
  {
    cout << "Even" << endl;
  }
  else
  {
    cout << "Odd" << endl;
  }
  
}


Measured memory_bytes: 256