akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($arg:expr),*) => {
        #[cfg(debug_assertions)]
        $(writeln!(stderr(), "{} = {:?}", stringify!($arg), $arg).unwrap());*
    };
}

#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (H, W) = read!(usize, usize);
    let B = read![String; H].into_iter().map(|s| s.bytes().vec()).vec();

    let mut blue = vec![vec![b'.'; W]; H];
    let mut red = vec![vec![b'.'; W]; H];

    for y in 0..H {
        for x in 0..W {
            if B[y][x] == b'#' || y == 0 || (y < H - 1 && x % 2 == 0) {
                blue[y][x] = b'#';
            }

            if B[y][x] == b'#' || y == H - 1 || (y > 0 && x % 2 != 0) {
                red[y][x] = b'#';
            }
        }
    }

    fn print_board(board: &Vec<Vec<u8>>) {
        let stdout = std::io::stdout();
        let mut lock = stdout.lock();
        for line in board {
            lock.write(line).unwrap();
            lock.write(&[b'\n']).unwrap();
        }
        lock.flush().unwrap();
    }

    print_board(&blue);
    println!("");
    print_board(&red);

    // debug!({
    //     let mut cross = vec![vec![b'.'; W]; H];
    //     for y in 0..H {
    //         for x in 0..W {
    //             if blue[y][x] == b'#' && red[y][x] == b'#' {
    //                 cross[y][x] = b'#';
    //             }
    //         }
    //     }
    //     println!("");
    //     print_board(&cross);
    // });
}


Measured memory_bytes: 4860
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

long long n, l[100009], r[100009], sum;
vector<long long>D1, D2;

int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> l[i] >> r[i];
		D1.push_back(l[i]);
		D2.push_back(r[i]);
	}
	sort(D1.begin(), D1.end(), greater<long long>());
	sort(D2.begin(), D2.end());
	long long S = 0;
	for (int i = 0; i < n; i++) {
		sum = max({ sum,S,S + D1[i],S - D2[i],S + D1[i] - D2[i] });
		S += D1[i] - D2[i];
	}
	cout << sum * 2 << endl;
	return 0;
}

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

ll dp[100007];
ll vis[100007];
ll arr[100007];
int n,k;

ll rec( int now )
{
    if(now>=n)
        return inf;
    if(now==n-1)
        return 0;
    if(vis[now])
        return dp[now];

    ll ans= inf;

    for(int i=1;i<=k;i++)
    {
        ans= min(ans,llabs(arr[ now+i ]-arr[ now ])+rec(now+i));
    }

    vis[now]= 1;

    return dp[now]= ans;
}

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

   for(int i=0;i<n;i++)
        cin>>arr[i];

   cout<< rec( 0 ) <<endl;
}


Measured memory_bytes: 7296
#include <bits/stdc++.h>
using namespace std;
int main(){
    string m;
    cin >> m;
    int s1,s2,s3;
    s1 = int(m[0]) - 48;
    s2 = int(m[1]) - 48;
    s3 = int(m[2]) - 48;
    cout << s1 + s2 + s3 << endl;
}

Measured memory_bytes: 3600
def gcd(x,y):
    while y:
        x,y=y,x%y
    return x

def lcm(x, y):
    return x * y // gcd(x, y)

def kosu(b, c, d):
    return b - ((b // c) + (b // d) - (b // lcm(c, d)))

a, b, c, d = map(int, input().split())
print(kosu(b, c, d) - kosu(a - 1, c, d))


Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <climits>
#include <math.h>
#include <iomanip>
#include <set>
using namespace std;
int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    int n;
    int m,l;
    int si,ti;
    string s,t;
    cin>>n;
    m=0;l=n-1;
    cout<<0<<endl;
    cin>>s;
    si=0;
    if(s=="Vacant"){return 0;}
    for(int i=0;i<20;++i){
        cout<<(l+m+1)/2<<endl;//" "<<m<<" "<<l<<endl;
        cin>>t;
        ti=(l+m+1)/2;
        if(t=="Vacant"){return 0;}
        if((s.compare(t)==0&&(ti-si)%2==0)||(s.compare(t)!=0&&(ti-si)%2==1)){m=(l+m+1)/2;s=t;si=ti;}else{l=(l+m+1)/2;//cout<<s.compare(t)<<" "<<si<<" "<<ti<<endl;
            
        }
    }
    return 0;
}

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

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
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 mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}

int b[200005][22];
int cnt[22];

signed main() {
	int n, ans = 0;
	cin >> n;
	int a[200005];
	rep(i, n) cin >> a[i];
	rep(i, n) {
		rep(j, 21) {
			b[i][j] = a[i] / (1 << j) % 2;
		}
	}
	int r = -1;
	rep(l, n) {
		bool bou = true;
		while (r < n) {
			rep(i, 21) {
				if (cnt[i] > 1) {
					bou = false;
					break;
				}
			}
			if (!bou) break;
			r++;
			rep(i, 21) cnt[i] += b[r][i];
		}
		rep(i, 21) {
			cnt[i] -= b[l][i];
		}
		if (left == right) break;
		ans += r - l;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 36224
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                   \
  ifstream in("abc178/abc178_d.txt"); \
  cin.rdbuf(in.rdbuf());
#define print_vec(v) \
rep(l, v.size()) { cout << v[l] << " "; } \
cout << endl;
#else
#define INPUT_FILE
#define print_vec(v)
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
typedef pair<ll, ll> pl;
const int INF = 100100100;
const ll LINF = 1e18+100;
const int MOD = 1e9 + 7;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

vector<mint> m(2001, 0);
mint solve(int n) {
  if (m[n].x != 0) return m[n];

  int i = 3;
  mint ret = 0;
  ret += solve(n - 1);
  ret += solve(n - 3);
  return m[n] = ret;
}

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N;
  cin >> N;
  if (N < 3) {
    cout << 0 << endl;
    return 0;
  }

  m[3] = 1;
  m[4] = 1;
  m[5] = 1;

  cout << solve(N) << endl;
}

Measured memory_bytes: 3728
#include <iostream>

using namespace std;

int main(void)
{
    long long N, a[100001], i, count=0, light=1;

    cin >> N;

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

    while(1){
        count++;

        light = a[light];

        if(light == 2){
            cout << count << endl;
            break;
        }

        if(count > N*2){
            cout << -1 << endl;
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
using namespace std;
long long k,a[50][51];
int main()
{
    ios::sync_with_stdio(false);
    cin>>k;
    for(int i=1;i<=50;++i)
        a[0][i]=49;
    for(int i=1;i<50;++i)
        for(int j=1;j<=50;++j)
        {
            if(i==j) a[i][j]=a[i-1][j]+50;
            else a[i][j]=a[i-1][j]-1;
        }
    long long w=k/50,g=k%50;
    cout<<50<<endl;
    for(int i=1;i<=50;++i)
        cout<<w+a[g][i]<<' ';
    cout<<endl;
    return 0;
}

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

using namespace std;

using ll = long long;

template<typename T> using V = std::vector<T>;
using Vi = V<int>;
using VVi = V<V<int>>;
using Vll = V<ll>;
using VVll = V<V<ll>>;
using Vs = V<string>;

template<typename T1, typename T2> using P = std::pair<T1, T2>;
using Pii = P<int, int>;
using Pll = P<ll, ll>;
using Pdd = P<double, double>;

template<typename T1, typename T2> using M = std::map<T1, T2>;
using Mii = M<int, int>;
using Msi = M<string, int>;

const double PI = acos(-1);
const ll MOD = 1e9+7;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define REP2(i,s,e) for(int i=(int)(s);i<(int)(e);++i)
#define RREP(i,s,e) for(int i=(int)(s);i>=(int)(e);--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin(),ie=(c).end();i!=ie;++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
    int n, d, a;
    cin >> n >> d >> a;

    auto cmp = [](const pair<Pll, int>& a, const pair<Pll, int>& b){
        if (a.first.first == b.first.first) {
            return a.second > b.second;
        }
        return a.first.first > b.first.first;
    };
    priority_queue<pair<Pll, int>, vector<pair<Pll, int>>, decltype(cmp)> q(cmp);

    REP(i, n) {
        ll x, h;
        cin >> x >> h;
        q.push({{x, h}, 1});
    }

    ll res = 0;
    ll bomb = 0;
    while (!q.empty()) {
        ll x = q.top().first.first;
        ll h = q.top().first.second;
        int op = q.top().second;
        q.pop();
        if (op == 1) {
            h -= a * bomb;
            if (h > 0) {
                ll cnt = (h + a - 1) / a;
                bomb += cnt;
                res += cnt;
                q.push({{x+2*d, cnt}, 2});
            }
        } else {
            bomb -= h;
        }
    }
    std::cout << res << '\n';

    return 0;
}


Measured memory_bytes: 8176
using System;

namespace AtCoderConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            // 標準入力から1行を取得
            string input = Console.ReadLine();

            // いくらのものを買いたいかを取得
            int price = int.Parse(input.Split(' ')[0]);

            // いろはちゃんの嫌いな数字がいくつあるかを取得
            int num = int.Parse(input.Split(' ')[1]);
            int[] ngNums = new int[num];

            // いろはちゃんの嫌いな数字を取得
            input = Console.ReadLine();

            // 嫌いな数字を格納
            for(int i = 0; i < num; i++)
            {
                ngNums[i] = int.Parse(input.Split(' ')[i]);
            }

            // 嫌いな数字が出現しなくなるまで繰り返す
            while (true)
            {
                // きらいな数字があるか判定する、無かったらbreak
                if (check(price, ngNums))
                {
                    break;
                }

                // priceをインクリメントする
                price++;
            }

            // 標準出力に出力
            Console.WriteLine(price);
        }

        // きらいな数字が含まれているか判定する関数
        static bool check(int price, int[] ng)
        {
            // priceを文字列に変換する。
            string priceStr = price.ToString();

            // きらいな数字が含まれていたらfalseを返す
            for (int i = 0; i < ng.Length; i++)
            {
                if (priceStr.Contains(ng[i].ToString()))
                {
                    return false;
                }
            }
            // 含まれていない場合trueを返す
            return true;
        }
    }
}

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

long long int factorial[100002];

long long int reciprocal[100002];

long long int MOD = static_cast<long long int>(1e9) + 7;

long long int my_pow(long long int a, long long int k) {
    if (k == 0) return 1;
    long long int res = my_pow(a, k / 2);
    res = res * res % MOD;
    if (k & 1) res = res * a % MOD;
    return res;
}

long long int comb(long long int n,long long int r){

    if(n < r){
        return 0;
    }

    if(r == 0){
        return 1;
    }

    return (factorial[n] * reciprocal[n-r] % MOD * reciprocal[r]) % MOD;

}

int main() {

    factorial[0] = 1;
    reciprocal[0] = 1;

    for(long long int i=1; i<100002; i++){
        factorial[static_cast<int>(i)] = factorial[static_cast<int>(i-1)]*i;
        factorial[static_cast<int>(i)] %= MOD;
        reciprocal[static_cast<int>(i)] = my_pow(factorial[static_cast<int>(i)],MOD - 2);
        reciprocal[static_cast<int>(i)] %= MOD;
    }

    int n;

    cin >> n;

    int a[n];

    for(int i=0; i<n+1; i++){
        cin >> a[i];
    }

    set<int> s;
    int my_left=0,my_right=0;

    for(int i=0; i<n+1; i++){
        if(s.find(a[i]) != s.end()){
            my_right = i;
            for(int j=0; j<n+1; j++){
                if(a[j] == a[i]){
                    my_left = j;
                    break;
                }
            }
            break;
        }
        s.insert(a[i]);
    }

    for(int k=1; k<=n+1; k++){

        long long int all_c = comb(n+1,k);
        long long int same_c = comb(my_left+n-my_right,k-1);

        cout << (all_c - same_c + MOD)%(MOD) << endl;
    }

    return 0;
}

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

ans = 0
for i in range(n):
    t, x, y = map(int, input().split())
    # print(t[i], x[i], y[i])
    if (t - (x + y)) < 0:
        ans += 1
    elif (t - (x + y)) % 2 == 0:
        pass
    else:
        ans += 1
if ans:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <string>
#include  <queue>
#include <vector>
#include  <cstdio>
#include <cstring>
//#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T mul(T p, T e, T M)
{
    ll ret = 0;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret + p) ;
        p = (p + p) ;
        if(ret>=M)ret-=M;
        if(p>=M)p-=M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 

#define  mx 200004
#define base 193ll
 
typedef pair<int,int >P;
//////////////////////////
////////////////////////
#define F(i,a,b) for(int i=a;i<b; i++)
#define LL long long
#define MX  200007
#define md 998244353ll
///////////////////////////
///////////////////////////
///

int main(){
	ll n;
	L(n);


	ll res = 0;

	for(int i = 1;i<=n;i++){
		if(i%3 == 0 ||  i%5==0){
		}
		else res+= i;
	}

	cout<<res<<endl;

	return 0;
}

Measured memory_bytes: 3764
n = int(input())
a = list(map(int, input().split()))
ans = 0
div_2 = True
while div_2:
    for i in range(n):
        if a[i] % 2 != 0:
            div_2 = False
    if div_2:
        ans += 1
    a = [i // 2 for i in a]
print(ans)

Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    void solve() {
        input();
        char c;
        cin >> c;
        if(c == 'A'){
            cout << 'T' << endl;
        }else if(c == 'T'){
            cout << 'A' << endl;
        }else if(c == 'G'){
            cout << 'C' << endl;
        }else{
            cout << 'G' << endl;
        }

    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 760
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let s = input_line_str();
        let split_result = s.split(SPLIT_DELIMITER);
        let mut vec_line: Vec<T> = Vec::new();
        for z in split_result {
            let buf = match z.parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            vec_line.push(buf);
        }
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

fn main() {
    let n: usize;
    input!(n);
    let mut i = 1;
    let mut ans = 0;
    while i <= n {
        let mut r = 0;
        for j in 1..i + 1 {
            if i % j == 0 {
                r += 1;
            }
        }
        if r == 8 {
            ans += 1;
        }

        i += 2;
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
import java.util.*;

class Main {
  	public static void main (String[] args) throws java.lang.Exception {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
      	int M = scanner.nextInt();
      	int nPlusMChoose2 = (N+M) * (N+M-1) / 2;
		int oddCombos = N * M;
	    int result = nPlusMChoose2 - oddCombos;
		System.out.printf("%d\n", result);
    }
}

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

using namespace std;

long double w,w1;
int n,k,x;

int main()
{
	cin >> n >> k;
	for (int i=1; i<=n; i++)
	{
		w1=1;
		x=i;
		while (x<k) {w1/=2; x*=2;}
		w1/=n;
		w+=w1;
	}
	cout << fixed << setprecision(12) << w << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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 main(){
    string s;
    cin>>s;
    string t=s;
    sort(ALL(t));
    t.erase(unique(ALL(t)),t.end());
    if(s.size()==t.size()){
        cout<<"yes"<<endl;
    }
    else{
        cout<<"no"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
k=int(input())
from collections import deque

q=deque()
for i in range(1,10):
  q.append(i)

for j in range(0,k):
  t=q.popleft()
  if t%10 != 0:
    q.append(t*10+t%10-1)
  q.append(t*10+t%10)
  if t%10 != 9:
    q.append(t*10+t%10+1)
print(t)
    

Measured memory_bytes: 11908
#include <stdio.h>
#include <math.h>

#define SQ(x) ((x) * (x))

int main(void)
{
    int s;
    int i;
    double x1, x2, x3;
    double y1, y2, y3;
    double a, b, c, d, e, f;
    double l, m, n;
    
    scanf("%d", &s);
    for (i = 0; i < s; i++){
        scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3);
        
        a = (x1 - x2);
        b = (y1 - y2);
        c = -1 * (SQ(x1) - SQ(x2) + SQ(y1) - SQ(y2));
        d = (x1 - x3);
        e = (y1 - y3);
        f = -1 * (SQ(x1) - SQ(x3) + SQ(y1) - SQ(y3));
        
        l = (c * e - b * f) / (e * a - b * d);
        m = (d * c - a * f) / (d * b - e * a);
        
        n = -1 * (SQ(x1) + SQ(y1) + l * x1 + m * y1);
        
        printf("%.3f %.3f %.3f\n", l / -2.0, m / -2.0, sqrt(SQ(l) + SQ(m) - 4 * n) / 2.0);
    }
    
    return (0);
}

Measured memory_bytes: 1092
#include <stdio.h>

int main(){
	int n,ret,temp;
	if((ret = scanf("%d",&n))==EOF){return -1;}
	
	
	int ans = 0;
	int smallest = n;
	
	for(int i = 0; i<n; i++){
		if((ret = scanf("%d",&temp))==EOF){return -1;}
		if(temp <= smallest){ans++; smallest =temp;}
		//<でなく<=とした時に問題になるのは最初が最大の数の時のみ
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
N=int(input())
data=[]
a=[]
for i in range(0,N):
  a=list(map(int,input().split()))
  data.append(a)
  
data=sorted(data,key=lambda x: x[1])
#print(data)
b=[]
time=0
out=0

for j in range(0,N):
  b=data[j]
  time=time+b[0]
  #print(j,time)
  if time>b[1]:
    out=out+1
    #print(j,time,b[1])
    
if out>0:
  print("No")
  
else:
  print("Yes")

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

const int vmax=100010;

vector<int> graph[vmax],ord,low,scc,par;
stack<int>s;

void dfs(int v,int p,int &k){
	ord[v]=k++;
	low[v]=ord[v];
	par[v]=p;
	s.push(v); // S
	for(auto &i:graph[v]){
		if(ord[i]==-1){
			dfs(i,v,k);
			low[v]=min(low[v],low[i]);
		//}else if(i!=p){    // B,A
		}else if(scc[i]==-1){ // S
			low[v]=min(low[v],ord[i]);
		}
	}
	if(ord[v]==low[v]){
		while(1){
			int u=s.top();s.pop();
			scc[u]=v;
			if(u==v) break;
		}
	}  //S
}

void lowlink(int n){
	int k=0;
	ord.assign(n,-1),low.resize(n);
	scc.assign(n,-1),par.resize(n);
	rep(i,n) if(ord[i]==-1) dfs(i,-1,k);
}

int main(void){
	int v,e;
	cin >> v >> e;
	rep(loop,e){
		int a,b;
		cin >> a >> b;
		graph[a].push_back(b);
		// graph[b].push_back(a); // B,A

	}
	lowlink(v);

/*	rep(i,v){
		cout << "ord[" << i << "]=" << ord[i]  << endl;
		cout << "low[" << i << "]=" << low[i]  << endl;
	}
*/

// Bridge
/*	vector<pair<int,int>> bridge;
	rep(i,v){
		int j=par[i];
		if(j==-1)
			continue;
		if(ord[i] < low[j] || ord[j] < low[i] ){
			auto in=make_pair(i,j);
			if(in.second<=in.first) swap(in.first,in.second);
			bridge.pb(in);
		}
	}
	sort(bridge.begin(),bridge.end());
	for(auto &i:bridge)
		cout << i.first << " " << i.second << endl;
*/

// Articulation Points
/*	vi articulation_point;
	rep(i,v){
		if(i){
			bool ok=false;
			for(auto &j:graph[i]){
				if(i==par[j]&&ord[i]<=low[j])
					ok=true;
			}
			if(ok) articulation_point.push_back(i);
		}else{
			int d=0;
			rep(j,v) if(par[j]==0) d++;
			if(d>=2) articulation_point.push_back(i);
		}
	}
	sort(articulation_point.begin(),articulation_point.end());
	for(auto &i:articulation_point)
		cout << i << endl;
*/
// Strongly Connected Components

	int q;
	cin >> q;
	rep(loop,q){
		int a,b;
		cin >> a >> b;
		cout << (scc[a]==scc[b]) << endl;
	}

	return 0;
}

Measured memory_bytes: 4688
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include<algorithm>
#include<sstream>
#include<iomanip>
#include<deque>
#include<list>


using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const ll MOD_CONST = 1000000007;
const ll BIG_NUM = 1000000000000000000;
const int BIG_INT = 1000000000;

int main() {

	int n;
	string s;
	cin >> n >> s;
	list<char> ls;
	stack<char> st;
	for (int i = 0; i < n;i++) {

		if (s[i] == '(') {
			st.push('(');
		}
		else {
			if (!st.empty() && st.top() == '(') {
				
				st.pop();
				
			}
			else {
				st.push(')');
			}
		}
		ls.emplace_back(s[i]);
	}



	while (!st.empty()) {
		if (st.top() == '(') {
			ls.emplace_back(')');
		}
		else {
			ls.emplace_front('(');
		}
		st.pop();
	}

	for (auto it = ls.begin();it != ls.end();it++) {
		cout << *it;
	}




	
}



Measured memory_bytes: 256
X = [[i for i in range(1, 10)]]
for i in range(9):
    Y = []
    for x in X[-1]:
        s = x % 10
        if s == 0:
            Y.append(x * 10 + s)
            Y.append(x * 10 + s + 1)
        elif s == 9:
            Y.append(x * 10 + s - 1)
            Y.append(x * 10 + s)
        else:
            Y.append(x * 10 + s- 1)
            Y.append(x * 10 + s)
            Y.append(x * 10 + s + 1)
    X.append(Y)
XX = []
for x in X:
    XX += x[:]
XX = sorted(XX)
print(XX[int(input()) - 1])

Measured memory_bytes: 14752
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);

        int a = stdin.nextInt();
        int b = stdin.nextInt();

        if (a * b % 2 == 0)
            System.out.println("Even");
        else
            System.out.println("Odd");
    }
}


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

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl
#define inc(a, b) cin >> a >> b;

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vd = vector<double>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vii = vector<pair<int, int>>;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
int dx[4] = { 0,  0, 1, -1 };
int dy[4] = { 1, -1, 0,  0 };
//int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
//int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

constexpr auto MAX = 100010;

// ────────────────────────────────────────────────────

int main() {
	int n; cin >> n;
	int color[9] = {};
	vi a(n); rep(i, n) {
		cin >> a[i];
		if (a[i] >= 3200) color[8]++;
		else if (a[i] >= 2800) color[7]++;
		else if (a[i] >= 2400) color[6]++;
		else if (a[i] >= 2000) color[5]++;
		else if (a[i] >= 1600) color[4]++;
		else if (a[i] >= 1200) color[3]++;
		else if (a[i] >= 800) color[2]++;
		else if (a[i] >= 400) color[1]++;
		else color[0]++;
	}
	
	int mini = 0;
	rep(i, 8) {
		if (color[i] > 0) mini++;
	}
	int maxi = 0;
	if (mini == 0 && color[8] > 0) maxi = color[8];
	else {
		maxi = mini + color[8];
	}
	if (mini == 0 && color[8] > 0) mini = 1;
	
	cout << mini << endl << maxi << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N = input.nextInt();
        long[] A = new long[N];
        for (int i = 0; i < N; i++) {
            A[i] = input.nextLong();
        }

        long maxHeight = A[0];
        long ans = 0;

        for (int i = 1; i < N; i++) {
            if (maxHeight > A[i]) {
                ans += maxHeight - A[i];
            } else {
                maxHeight = A[i];
            }
        }

        System.out.println(ans);
    }
}

Measured memory_bytes: 51204
// {{{ Boilerplate Code <--------------------------------------------------
// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}}

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

#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define ALL(A)     (A).begin(), (A).end()

using namespace std;

// }}}

int main(){
        string S;
        cin>>S;
        if(S[S.length()-1]=='s'){
                cout<<S<<"es"<<endl;
        }else{
                cout<<S<<"s"<<endl;
        }
        return 0;

}


Measured memory_bytes: 3620
S = str(input())
Q = int(input())
query=[]
a=""
b=""
# for line in range(Q):
# 	query.append(list(input().split()))
t=True

for i in range(Q):
	q=list(input().split())
	if int(q[0])==1:
		t= not t
	else:
		if int(q[1])==1:
			if t:
				a=q[2]+a
			else:
				b=b+q[2]

		else:
			if t:
				b=b+q[2]
			else:
				a=q[2]+a

if t:
	print(a+S+b)
else:
	print(b[::-1]+S[::-1]+a[::-1])




Measured memory_bytes: 4460
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

const int MAX_SIZE = 1000000;

int prime[MAX_SIZE];
bool isPrime[MAX_SIZE];
int p;

int main(){

	fill(isPrime,isPrime+MAX_SIZE,true);
	p = 0;
	isPrime[0] = isPrime[1] = false;
	for(int i = 2; i <= MAX_SIZE; i++){
		if(isPrime[i]){
			prime[p++] = i;
		}
		else
			continue;
		for(int j = 2*i; j <= MAX_SIZE; j+=i){
			isPrime[j] = false;
		}
	}
	
	int a,d,n;
	while(cin >> a >> d >> n && !(a == 0 && d == 0 && n == 0)){
		int cnt = 0;
		for(int i = 0; ;i++){
			int num = a + i*d;
			if(isPrime[num]){
				cnt++;
			}
			if(cnt == n){
				cout << num << endl;
				break;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>
#include <string>
#include <bitset>
#include <functional>
#include <iomanip>

using namespace std;
using lint = long long;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<int>;
using pii = pair<int, int>;
using pll = pair<lint, lint>;
using pqi = priority_queue<int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define repf(i, f, n) for (int i = (f); i < (n); i++)
#define mp(x, y) make_pair((x), (y))
#define all(x) (x).begin(), (x).end()
#define foreach(it, x) for (auto it = (x).begin(); it != (x).end(); it++)
#define space (char)0x20

constexpr lint MOD = 1e9 + 7;
int A, B, C, D, E, F, G, H, I, J, K, L, M, N;
int O, P, Q, R, S, T, U, V, W, X, Y, Z;
// string s;
// int ans;
vb flags;

void sieve(lint x) {
    flags.assign(x, true);
    flags[0] = false;
    flags[1] = false;
    for (lint i = 2; i*i < x; i++) {
        if (!flags[i]) continue;
        for (lint mult = 2*i; mult < x; mult += i) {
            flags[mult] = false;
        }
    }
}
 
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
 
	cin >> X;

    sieve(10e5);
    for (int i = X; i < 10e5 + 1; i++) {
        if (flags[i]) {
            cout << i << endl;
            return 0;
        }
    }

	return 0;
}

Measured memory_bytes: 1020
n,k=map(int,input().split())
d={}
for i in range(n):
    a,b=map(int,input().split())
    if a in d.keys():
        d[a]+=b
    else:
        d[a]=b
l=sorted(d.keys())
cnt=0
for i in l:
    cnt+=d[i]
    if cnt>=k:
        print(i)
        exit()

Measured memory_bytes: 10592
if __name__ == "__main__":
	d = {}
	n = int(input())
	for _ in range(n):
		command = input().split()
		if command[0] == "insert":
			d[command[1]] = ''
		if command[0] == "find":
			if command[1] in d:
				print("yes")
			else:
				print("no")


Measured memory_bytes: 33112
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rep1(i,n) for(int i=1;i<=int(n);i++)
#define per(i,n) for(int i=int(n)-1;i>=0;i--)
#define per1(i,n) for(int i=int(n);i>0;i--)
#define foreach(i,n) for(auto &&i:n)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define GSORT(x) sort(all(x), greater<int>())
#define REV(x) reverse(all(x))
#define MAX(x) *max_element(all(x))
#define MIN(x) *min_element(all(x))
#define LOWitr(x, n) lower_bound(all(x), n)
#define UPRitr(x, n) upper_bound(all(x), n)
#define cii(x) int x;cin >> x
#define cill(x) LL x;cin >> x
#define cis(x) string x;cin >> x
#define co(x) cout << x << endl
#define dump(x)  cout << #x << " = " << (x) << endl
#define truecheck assert
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fastcin() cin.tie(0);ios::sync_with_stdio(false)
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef long long int64;
template<class T,class U>bool chmax(T &a, const U &b) { if (a<b) { a=b; return true; } return false; }
template<class T,class U>bool chmin(T &a, const U &b) { if (b<a) { a=b; return true; } return false; }
const int INF = 1e9, MOD = 1e9 + 7;
const LL LLINF = 1e16;

int main() {
    fastcin();
    cout << fixed << setprecision(10);
    cii(h);
    cii(b);
    auto ans = h / b + ((h % b == 0)?0:1);
    co(ans);
    return 0;
}

Measured memory_bytes: 256
#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 _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

int n,a,b,c,d;
char s[252521];

int main(){
    scanf("%d%d%d%d%d",&n,&a,&b,&c,&d);
    scanf("%s",s);
    --a;--b;--c;--d;
    bool ok = true;
    if(c<d){
        // greedy
        while(b<d){
            if(b+1<=d && s[b+1]=='.'){
                b += 1;
            }else if(b+2<=d && s[b+2]=='.'){
                b += 2;
            }else{
                ok = false;
                break;
            }
        }
        while(a<c){
            if(a+1<=c && s[a+1]=='.'){
                a += 1;
            }else if(a+2<=c && s[a+2]=='.'){
                a += 2;
            }else{
                ok = false;
                break;
            }
        }
    }else{
        // through
        while(b<d){
            if(b>0 && b<n-1 && s[b-1]=='.' && s[b+1]=='.'){
                // through point
                break;
            }
            if(b+1<=d && s[b+1]=='.'){
                b += 1;
            }else if(b+2<=d && s[b+2]=='.'){
                b += 2;
            }else{
                ok = false;
                break;
            }
        }
        s[b] = '#';
        while(a<c){
            if(a+1<=c && s[a+1]=='.'){
                a += 1;
            }else if(a+2<=c && s[a+2]=='.'){
                a += 2;
            }else{
                ok = false;
                break;
            }
        }
        while(b<d){
            if(b+1<=d && s[b+1]=='.'){
                b += 1;
            }else if(b+2<=d && s[b+2]=='.'){
                b += 2;
            }else{
                ok = false;
                break;
            }
        }
    }
    puts(ok ? "Yes" : "No");
    return 0;
}


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



signed main(){
    int n;
    cin >> n;
    int a[3*n];
    for(int i=0;i<3*n;i++){
        cin >> a[i];
    }
    int sum1[n+1]={},sum2[n+1]={};
    priority_queue<int, vector<int>, greater<int> >  que1;
    priority_queue<int> que2;
    for(int i=0;i<n;i++){
        que1.push(a[i]);
        sum1[0]+=a[i];

    }
    for(int i=0;i<n;i++){
        que1.push(a[n+i]);
        sum1[i+1]=sum1[i]-que1.top()+a[n+i];
        que1.pop();
    }
    for(int i=0;i<n;i++){
        que2.push(a[3*n-1-i]);
        sum2[n]+=a[3*n-1-i];

    }
    for(int i=0;i<n;i++){
        que2.push(a[2*n-1-i]);
        sum2[n-i-1]=sum2[n-i]-que2.top()+a[2*n-1-i];
        que2.pop();
    }
    int ans=sum1[0]-sum2[0];
    for(int i=1;i<=n;i++){
        if(ans<sum1[i]-sum2[i])ans=sum1[i]-sum2[i];
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 6516
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vi;
typedef vector<bool> vb;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sq(x) ((x)*(x))
#define fo(i,n) for(int i=0;i<n;i++)
#define fp(i,k,n) for(int i=k;i<n;i++)
#define Fo(i,n) for(int i=1;i<=n;i++)
#define all(x) x.begin(),x.end()
#define deb(x) cout<<#x<<"="<<x<<"\n"
#define deb2(x,y) cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<"\n"
#define fi first
#define se second
const double pi = 3.14159265358979323846;
#define uni(c) (c).resize(unique(all(c))-(c).begin())
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)
//pair <int, int> w[4] = {mp(-1, 0), mp(0, -1), mp(1, 0), mp(0, 1)};   // for matrix movement:
void cp()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE
}
vi fact(20000015, 0);
void solve()
{
    ll n; cin >> n;
    for (int i = 1; i <= n; i++)
    {
        for (int j = i; j <= n; j += i) {
            fact[j]++;
        }
    }
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        ans += i * fact[i];
    }
    cout << ans;


}
int main()
{
    fast;
    //cp();
    ll t = 1;
    //cin >> t;
    while (t--)
        solve();


    return 0;
}

Measured memory_bytes: 159324
#include<iostream>

using namespace std;

int main(void){
    double W, H, x, y;
    cin >> W >> H >> x >> y;
    int n = 0;
    if(x == W/2 && y == H/2){
        n = 1;
    }
    if(W*H==0){
        n = 1;
    }
    cout << W*H/2 << " " << n << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define endl "\n"
#define fo for(int i=0;i<n;i++)
#define clear cin.clear();cin.ignore(numeric_limits<streamsize>::max(), '\n');
#define loopSolve int t; cin>>t; while(t--){solve();}
//INT_MAX         2,147,483,647                       <10^10
//U_INT_MAX       4,294,967,295                       <10^10
//LONG_LONG_MAX   9,223,372,036,854,775,807           <10^18
//U_LONG_LONG_MAX 18,446,744,073,709,551,615          <10^18
//ll power(int a, int b){
//    return (ll)(pow(a,b)+0.5);
//}

vector<int> gV(int n){
    vector<int> v(n);
    int input;
    fo { cin>>v[i];  }
    return v;
}

int* gA(int n){
    int* arr = new int[n];
    fo cin>>arr[i];
    return arr;
}


void solve(){
    int* arr = new int[5];
    for(int i=0;i<5;i++){
        cin>>arr[i];
        if(arr[i]==0){
            cout<<i+1<<endl;
            return;
        }
    }

}


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

    solve();
    //loopSolve;

	return 0;
}


Measured memory_bytes: 3648
#selectcaseは辞書型で可能

print({'A' : 'T', 'T' : 'A', 'C' : 'G', 'G' : 'C'}[input()])



# 
# #ifの連続でも可能
# kigou = input()
# 
# if kigou == 'A':
#     print('T')
# elif kigou == 'T':
#     print('A')

Measured memory_bytes: 9016
<?php

$num = explode(" ",trim(fgets(STDIN)));
$a = $num[0];
$b = $num[1];
$c = $num[2];
$count=0;

for($i = $a; $i <= $b; $i++){
    if($c % $i == 0){
        $count++;
    }
}
echo $count.PHP_EOL;

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

int main() {
  int K, S; cin >>K >>S;
  
  int ans = 0;
  for (int x=0; x<=K; x++) {
    for (int y=0; y<=K; y++) {
      
      int z = S-x-y;
      if (z >= 0 && z <=K)
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define INF 10000000
#define INF_LL 1e18
#define REP(i, n) for(int i = 0;i < (n);i++)
#define all(n) n.begin(),n.end()

using namespace std;

using ll = long long;
using PII = pair<int, int>;

int main(void){
	int V, E, r;
	cin >> V >> E;
	vector<PII> G[10000];
	ll d[10000];
	fill(d, d+10000, INF_LL);
	ll res = 0;
	REP(i, E){
		int a, b, c;
		cin >> a >> b >> c;
		G[a].push_back(PII(c, b));
		G[b].push_back(PII(c, a));
	}
	priority_queue<PII, vector<PII>, greater<PII> > que;
	que.push(PII(0, 0));
	while(que.size()){
		PII p = que.top();que.pop();
		int v = p.second;
		if(d[v] != INF_LL) continue;
		res += p.first;
		d[v] = 1;
		REP(i, G[v].size()){
			que.push(PII(G[v][i].first, G[v][i].second));
		}
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 7920
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>

using namespace std;

typedef long long ll;

long long GCD(long long a, long long b){if(b==0)return a;return GCD(b,a%b);}

int main() {
    int A, B; cin >> A >> B;

    if (A < 6) cout << 0 << endl;
    else if (A < 13) cout << (B/2) << endl;
    else cout << B << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a,b,c;
    a = sc.nextInt();
    b = sc.nextInt();
    c = sc.nextInt();
    if(a + b == c || b + c == a || c + a == b){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 10192
import java.util.Scanner;

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

		int a = sc.nextInt();
		int b = sc.nextInt();
		int x = sc.nextInt();

		if (a <= x && x <= a + b)
			System.out.println("YES\n");
		else
			System.out.println("NO\n");
	}
}


Measured memory_bytes: 23764
import bisect,collections,copy,heapq,itertools,math,string
# from fractions import gcd
import numpy as np
import sys
sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

# N = I()
A,B = LI()
#AB = [LI() for _ in range(N)]
#A,B = zip(*AB)
#Ap = np.array(A)
#C = np.zeros(N + 1)

# 最小公倍数 = A * B // 最大公約数
ans = A * B // math.gcd(A,B)
print(ans)

# if ans:
#     print('Yes')
# else:
#     print('No')

Measured memory_bytes: 27004
#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;


int main(){
    int n,q,ans=0,chk=0;
    scanf("%d",&n);
    vector<int> s(n);
    for(auto&e:s){
        scanf("%d",&e);
    }
    sort(s.begin(),s.end());

    scanf("%d",&q);
    vector<int> t(q);
    for(auto&e:t){
        scanf("%d",&e);
    }
    sort(t.begin(),t.end());

    for(int i=0;i<q;i++){
        for(int j=chk;j<n;j++){
            if(t[i]==s[j]){
                ans++;
                break;
            }else if(t[i]<s[j]){
                break;
            }
            chk=j;
        }
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 1224
####### 二項係数 C(n,k) mod pの計算 #######

MOD=10**9+7

## a**b mod p by 繰り返し二乗法 ##
def pow(a,b)
  return 1 if b==0
  return a*pow(a,b-1)%MOD if b%2==1
  return pow(a**2%MOD,b/2)
end

## n! mod p ##
def fact(n)
  ret=1
  n.times do |i|
    ret=ret*(i+1)%MOD
  end
  ret
end

## a**(-1) mod p ##
def inv(n)
  pow(n,MOD-2)%MOD
end

## C(n,k) mod p ##
def com(n,k)
  (fact(n)*inv(fact(k)))%MOD*inv(fact(n-k))%MOD
end

## C(n,k) mod p (n>>>k version) ##
def frac(n,k)
  a=1
  b=1
  k.times do |i|
    b*=i+1
    b%=MOD
  end
  k.times do |i|
    j=i+1
    a*=n-i
    a%=MOD
  end
  a*inv(b)%MOD
end

##########################################

N,a,B=gets.split.map(&:to_i)
ans=pow(2,N)-1
ans+=MOD-frac(N,a)
ans+=MOD-frac(N,B)
puts ans%MOD


Measured memory_bytes: 1788
#include <iostream>
#include <vector>
using namespace std;
using ll=long long;

int main() {
  string S; cin>>S;
  int N=S.size();
  vector<int> A(N+1);
  for(int i=0; i<N; i++){
    if(S.at(i)=='<') A.at(i+1)=A.at(i)+1;
  }
  for (int i=N-1; i>=0; i--){
    if(S.at(i)=='>' && A.at(i)<=A.at(i+1)) A.at(i)=A.at(i+1)+1;
  }
  ll answer=0;
  for(int i=0; i<=N; i++) answer+=A.at(i);
  cout<<answer<<endl;
}


Measured memory_bytes: 2820