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

int main() {
    double h;
    cin>>h;
    int ans2 =0;
    long long ans = 0;
    for(double i = h; i>=2; i/=2){
        ans2++;
    }

    ans = pow(2,ans2+1) -1;    
    cout<<ans;


  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{

        int[] a = new int[10];
        //List<int> a = new List<int>();
        //List<int> b = new List<int>();

        //long[] a = new long[n];


		//string[] s = Console.ReadLine().Split(' ');

		// int a = int.Parse(Console.ReadLine());

        for (int i = 0; i < 10; i++)
        {
            a[i] = int.Parse(Console.ReadLine());
        }

        Array.Sort(a);

        Console.WriteLine("{0}",a[9]);
        Console.WriteLine("{0}",a[8]);
        Console.WriteLine("{0}",a[7]);

		//Console.WriteLine("");


	}
}

Measured memory_bytes: 9360
#include<iostream>
#include<iomanip>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
#include<memory>
using namespace std;
using ll=long long;

int main(){
    int a,b;
    cin>>a>>b;
    if(a>b) swap(a,b);
    for(int i=0;i<b;i++) cout<<a;
    
    
    return 0;
}


Measured memory_bytes: 256
#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()
using namespace std;
typedef long long ll;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;

	if (a == b && b == c) cout << 1 << endl;
	else if (a == b || b == c || a == c) cout << 2 << endl;
	else cout << 3 << endl; 
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
typedef long long ll;
ll deg(ll n){
    ll count = 0;
    while(n!= 0){
        n/=10;
        count++;
    }
    return count;
}
bool jd(ll n){
    bool f1 = false,f2 = false,f3 = false;
    while(n != 0){
        if(n%10 == 3) f1 = true;
        if(n%10 == 5) f2 = true;
        if(n%10 == 7) f3 = true;
        n/=10;
    }
    if(f1&& f2&&f3) return true;
    return false;
}

ll N;
ll make_sft(ll n){
    if(n > N ){
        return 0;
    }
    int ret = 1;
    if(!jd(n)){
        ret = 0;
    }
    ret += make_sft(n*10+3)+make_sft(n*10+5)+make_sft(n*10+7);
    return ret;
}

int main(){
    cin >> N;
    cout << make_sft(0) << endl;
    
}

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

int main() {
  string S;
  cin >> S;
  
  string subS;
  vector <int> P;
  
  int cnt = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == 'x') {
      cnt++;
    } else {
      subS += S[i];
      P.push_back(cnt);
      cnt = 0;
    }
    
    if (i == S.size()-1) {
      if (S[i] == 'x') {
        P.push_back(cnt);
      } else {
        P.push_back(0);
      }
    }
  }
  
//  cout << subS << endl;

/*
  for (int i = 0; i < P.size(); i++) {
    cout << P[i] << " ";
  }
*/
  
  
  // subSの回文チェック
  int N = subS.size();
  for (int i = 0; i < N; i++) {
    if (subS[i] != subS[N-1-i]) {
      cout <<  -1 << endl;
      return 0;
    }
  }
  
  
  // Pを鏡対象に比較してmaxをとっていく
  int M = P.size();
  vector<int> MAX_mirrorP(M);

  for (int i = 0; i <= M /2; i++) {
    MAX_mirrorP[i] = max(P[i], P[M-1-i]);
    MAX_mirrorP[M-1-i] = max(P[i], P[M-1-i]);
  }
  
  int sum = 0;
  
  for (int i = 0; i < M; i++) {
    sum += MAX_mirrorP[i] - P[i];
  }
  cout << sum << endl;
}

Measured memory_bytes: 1400
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, 
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;

int main()
{
    string s;
    cin>>s;
    int result=0;
    
    if(s[0]=='R' && s[1]=='R' && s[2]=='R'){
    cout<< 3;
    return 0 ;
    }
    
    if(s[0]=='R' && s[1]=='R'){
    cout<< 2;
    return 0 ;
    }
    
    if(s[2]=='R' && s[1]=='R'){
        cout<<2;
        return 0;
    }
    
    if(s[0]=='S' && s[1]=='S' && s[2]=='S'){
    cout<< 0;
    return 0;
    }
    
    cout<<1;
    

    return 0;
}


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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
using tp = tuple<ll, ll, ll>;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll)1e9 + 7;
constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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;
}

//グラフ関連
struct Edge {
    ll to, cap, rev;
    Edge(ll _to, ll _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph &G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve() {
    string s;
    cin >> s;
    if(s.back() == 's')
        s += "es";
    else
        s += "s";
    cout << s << en;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /*
    ll t;
    cin >> t;
    while(t--)*/
    solve();

    return 0;
}


Measured memory_bytes: 3664
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp35 {
    class Program {
        static void Main(string[] args) {
            string S = Console.ReadLine();

            //Sの桁数
            int S_len = S.Length;

            int sum = 0;
            for (int i = 0; i < S_len; i++) {
                sum += int.Parse(S[i].ToString());
            }

            //Console.WriteLine(sum);

            if (int.Parse(S) % sum == 0) {
                Console.WriteLine("Yes");
            } else {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 11092
/*
 ╔═══╦═══╦═══╗
 ║╔═╗║╔══╩╗╔╗║
 ║║░║║╚══╗║║║║
 ║║░║║╔══╝║║║║
 ║╚═╝║╚══╦╝╚╝║
 ╚══╗╠═══╩═══╝
 ░░░╚╝░░░░░░░░
 */

#include <bits/stdc++.h>
#define ll					long long
#define MOD					1000000007
#define MAX					1e9
#define MIN                 -1e9
#define PI					acos(-1.0)
#define vi					vector<int>
#define vii					vector<vi>
#define vll					vector<ll>
#define mid(s,e)			(s+(e-s)/2)
#define clz(n)				__builtin_clzll(n))

using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
template<typename T>
void printVec(const T &v, char sep=' ') {for (auto &i: v) cout << i << sep;}
template<typename T>
void printVecPair(const T &v, char sep=' ') {for (auto &i: v) cout << i.first <<" " << i.second<< sep;}


#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

int main() {
	ios::sync_with_stdio(false);
 	cin.tie(0);
	int n;
	cin>>n;
	vi h(n);
	vi dp(n+1,0x3F);
	for(int& t: h) cin>>t;
	debug(h);
	dp[0] = 0;
	dp[1] = abs(h[1] - h[0]);
	for(int i=2;i<n;i++) {
			dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]), dp[i-2] + abs(h[i] - h[i-2]));


	}
	cout<<dp[n-1];
	return 0;
}





Measured memory_bytes: 1408
x,k,d=map(int,input().split())
#xを絶対値に変換
x=abs(x)
#場合分けxがdより十分に大きい。つまり近づける価値がある。
if x>=d:
    #ゼロ直前までは何回？
    n=x//d
    #ゼロ直前の値は？
    mina=x%d
    #場合分けゼロ直前まで十分な回数ある
    if k>=n:
        #偶数(k-nがゼロの場合含む)
        if (k-n)%2==0:
            print(mina)
        else:
            print(abs(mina-d))
    #十分な回数ない
    else:
        print(x-d*k)
else:
    if k%2==0:
        print(x)
    else:
        print(abs(x-d))

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

using namespace std;

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

    vector<int> v(100001);
    for (int i = 1; i <= n; ++i) {
        cin >> v[i];
    }

    int cnt = 1;
    int i = 1;
    while (n--) {
        if (v[i] == 2) {
            cout << cnt << endl;
            return 0;
        }
        i = v[i];
        ++cnt;
    }
    cout << -1 << endl;
}

Measured memory_bytes: 640
import java.io.*;

class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// 入力を読むのに必要
            String line; 
            String lineA[] = null;
            String lineB[] = null;;
            
            int i = 0;
            while ((line = br.readLine()) != null) {
            	if (i % 2 == 0) {
            		lineA = line.split(" ");
            	} else {
            		lineB = line.split(" ");
            		String result = compareLines(lineA, lineB);
            		System.out.println(result);
            	}
            	i++;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

	private static String compareLines(String[] lineA, String[] lineB) {
		int hit = 0;
		int blow = 0;
		
		for (int j = 0; j < 4; j++) {
			if(lineA[j].equals(lineB[j])){
				hit++;
			}
		}
		
		for (String intA : lineA) {
			for (String intB : lineB) {
				if(intA.equals(intB)) {
					blow++;
				}
			}
		}
		
		blow -= hit;
		return hit + " " + blow;		
	}

}


Measured memory_bytes: 23988
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
A = [A1, A2, A3]
N = int(input())
l = [[-1] * 3 for _ in range(3)]
for _ in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if A[i][j] == b:
                l[i][j] = 0
    if sum(l[0]) == 0 or sum(l[1]) == 0 or sum(l[2]) == 0:
        print('Yes')
        break
    if l[0][0] + l[1][0] + l[2][0] == 0 or l[0][1] + l[1][1] + l[2][1] == 0:
        print('Yes')
        break
    if l[0][2] + l[1][2] + l[2][2] == 0 or l[0][0] + l[1][1] + l[2][2] == 0:
        print('Yes')
        break
    if l[0][2] + l[1][1] + l[2][0] == 0:
        print('Yes')
        break
else:
    print('No')


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

typedef pair<int, int> pii;

#define fi first
#define se second

const int MAXN = 100010;

int A[MAXN], B[MAXN];
vector<pii> ed[MAXN];
int ans[MAXN];

void f(int x, int p, int c) {
	int cc = 1;
	for(auto a : ed[x]) if(a.fi != p) {
		if(cc == c) cc++;
		ans[a.se] = cc;
		f(a.fi, x, cc);
		cc++;
	}
}

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

	cin >> N;
	for(int i = 0; i < N - 1; i++) cin >> A[i] >> B[i];

	for(int i = 0; i < N - 1; i++) {
		ed[A[i]].emplace_back(B[i], i);
		ed[B[i]].emplace_back(A[i], i);
	}

	int deg = 0;
	for(int i = 1; i <= N; i++) deg = max(deg, (int)ed[i].size());

	f(1, 0, 0);
	cout << deg << "\n";
	for(int i = 0; i < N - 1; i++) cout << ans[i] << "\n";
	return 0;
}


Measured memory_bytes: 9728
// inputに入力データ全体が入る
function Main(input) {
	ans = 0
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.trim().split("\n");
	s = input[0].split(' ')
	n = input[1].split(' ').map((n) => (parseInt(n)))
	if (s[0] === input[2]) {
		n[0] = n[0] -1
	} else {
		n[1] = n[1] -1
	}



	//出力
	console.log(n[0] + ' ' + n[1])
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// Main(require('fs').readFileSync('./input.txt', 'utf-8'));

Measured memory_bytes: 11468
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <queue>
#include <unordered_map>

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

using namespace std;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

int main(){
    int a,b; cin >> a >>b;
    cout << 6 - a - b << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
double sol[10000][2];
int main()
{
    double a, b, e, c, d, f;
    int i = 0;
    while (std::cin >> a >> b >> e >> c >> d >> f)
    {
        double det = a * d - b * c;
 
        double aa = d / det, bb = -b / det, cc = -c / det, dd = a / det;
        sol[i][0] = aa * e + bb * f;
        sol[i][1] = cc * e + dd * f;
 
        i++;
    }
    for (int j = 0; j < i; j++)
        printf("%.3f %.3f\n", sol[j][0], sol[j][1]);
    return 0;
}

Measured memory_bytes: 3192
H,W=map(int,input().split())
a=[list(map(int,input().split())) for i in range(H)]
A=[]
for y in range(H):
	for x in range(W):
		if y%2==0:
			A.append([y,x,a[y][x]])
		else:
			A.append([y,W-1-x,a[y][W-1-x]])
OUTPUT=[]
for i in range(H*W-1):
	if A[i][2]%2==1:
		OUTPUT.append((A[i][0]+1,A[i][1]+1,A[i+1][0]+1,A[i+1][1]+1))
		A[i+1][2]+=1
print(len(OUTPUT))
for out in OUTPUT:
	print(*out)

Measured memory_bytes: 55932
#include <stdio.h>

int main(){
  
  int A[110][110];
  int a,b,i,j,sum,sumsum=0;
  scanf("%d %d",&a,&b);
  
  for(i=0;i<a;i++){
    sum=0;
    for(j=0;j<b;j++){
      scanf("%d ",&A[i][j]);
      sum += A[i][j];
      printf("%d ",A[i][j]);
    }
    sumsum += sum;
    printf("%d\n",sum);
  }
  
  for(j=0;j<b;j++){
    sum = 0;
  	for(i=0;i<a;i++){
    sum += A[i][j];
    }
    printf("%d ",sum);
  }
  printf("%d\n",sumsum);
  
  return 0;
  
  
  
}



Measured memory_bytes: 2112
let printf = Printf.printf
let scanf = Scanf.scanf

module Array = struct
  include Array

  let create x ~len = make len x
end

module List = struct
  include List

  let rec repf' ~init ~n ~f =
    if n = 0 then init else repf' ~init:(f () :: init) ~f ~n:(n-1)

  let repf ~n ~f =
    assert (n >= 0);
    rev (repf' ~init:[] ~f ~n)

  let rec iteri' i t ~f =
    match t with
    | [] -> ()
    | hd::tl ->
      f i hd;
      iteri' (i+1) tl ~f

  let iteri t ~f = iteri' 0 t ~f

  let rec range' acc stride start_i stop_i =
    if (stop_i - start_i) * stride <= 0 then acc
    else
      range' (start_i::acc) stride (start_i + stride) stop_i

  let range ?(stride=1) start_i stop_i =
    rev (range' [] stride start_i stop_i)

  let fold t ~init ~f = fold_left f init t
end

module Fn = struct
  let id x = x
end

let () =
  scanf "%d " (fun n ->
      let aa = List.repf ~n ~f:(fun () -> scanf "%d " Fn.id) in
      let idxs = Array.create ~len:(n+1) 0 in
      List.iteri aa ~f:(fun i a -> idxs.(a) <- i);
      let ranges = Array.create ~len:(n+2) (0,0) in
      for i = 0 to n-1 do ranges.(i+1) <- (i,i) done;

      let ks = List.range ~stride:(-1) n 0 in
      let ans = List.fold ks ~init:0 ~f:(fun acc k ->
          let idx = idxs.(k) in
          let (l,r) = ranges.(idx+1) in
          let (l_of_l,_), (_,r_of_r) = ranges.(l), ranges.(r+2) in
          ranges.(l) <- (l_of_l, r);
          ranges.(r+2) <- (l, r_of_r);
          acc + k * (idx-l + 1) * (r-idx + 1)
        )
      in
      printf "%d\n" ans
    )


Measured memory_bytes: 26672
<?php

function chmax(&$a, $b) {
    if ($a < $b) {
        $a = $b;
    }
}

fscanf(STDIN, "%d", $n);
$inptus = [];
for ($i = 0; $i < $n; ++$i) {
    $tmp = explode(' ', trim(fgets(STDIN)));
    $inputs[] = $tmp;
}

$dp = [];
for ($i = 0; $i < $n; ++$i) {
    $dp[] = array_fill(0, 3, PHP_INT_MIN);
}
$dp[0] = $inputs[0];

for ($i = 1; $i < $n; ++$i) {

    // 当日に選ぶやつ
    for ($j = 0; $j < 3; ++$j) {
        // 前日に選んだやつ
        for ($k = 0; $k < 3; ++$k) {
            if ($j === $k) {
                continue;
            }

            chmax($dp[$i][$j], $dp[$i - 1][$k] + $inputs[$i][$j]);
        }
    }

}

echo max($dp[$n - 1]);


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

int main() {
  
  int N;
  cin >> N;
  
  int cnt=0;
  
  vector<int> A(N);
  for(int i=0; i<N; i++){
    A.at(i) = i+1;
  }
  
  while(true){
    bool tf = false;
    for(int i=0; i<N; i++){
      if(A.at(i) % 2 == 0){
        tf = true;
        A.at(i) /= 2;
        cnt = i;
      }
    }
    
    if(tf == false){
      break;
    }

  }
  
  cout << cnt + 1 << endl;
  
}


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

int main() {
  int N;
  cin >> N;
  vector<string> s(N);
  for (int i = 0; i < N; i++) {
    cin >> s.at(i);
  }
  sort(s.begin(), s.end());
  int x = 0;
  vector<pair<int, string>> p;
  bool q = true;
  for (int i = 0; i < N-1; i++) {
    if (s.at(i) == s.at(i + 1)) {
      x--;
      q = true;
    }
    else {
      p.push_back(make_pair(x, s.at(i)));
      q = false;
      x = 0;
    }
  }
  p.push_back(make_pair(x, s.at(N - 1)));
  int y = p.size();
  sort(p.begin(), p.end());
  int l;
  string k;
  tie(l, k) = p.at(0);
  cout << k <<endl;
  if (y > 1) {
  for (int i = 1; i< y; i++) {
    int w;
    string z;
    tie(w, z) = p.at(i);
    if (w == l) {
      cout << z <<endl;
    }
    else {
      break;
    }
  }
  }
}

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

int main() {
  int N, A, B;
  cin >> N >> A;
  
  B = N % 500;
  
  if (A < B) {
    cout << "No" << endl;
  }
  else if (A >= B) {
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 3604
package main

import (
	"fmt"
)

func main() {
	var a, b, c int
	fmt.Scanf("%d %d %d", &a, &b, &c)
	if (a == b && a != c) || (a == c && a != b) || (b == c && a != b){
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using boost::multiprecision::cpp_int;

typedef long long ll;
typedef pair<ll, ll> pll;

const ll INF = 1e17;
const ll MOD = 1e9+7;

// https://math.nakaken88.com/textbook/cp-binary-exponentiation-and-recursive-function/
ll modPow(long long a, long long n) {
  if (n == 1) return a % MOD;
  if (n % 2 == 1) return (a * modPow(a, n - 1)) % MOD;
  long long t = modPow(a, n / 2);
  return (t * t) % MOD;
}

ll comb(ll n, ll p) {
	if (p * 2 > n) p = n - p;
	if (p > n - p) p = n - p;
	ll a = 1, b = 1;
	for(int i=1; i< p+1; i++) {
		a = (a * (n - i + 1)) % MOD;
		b = (b * i) % MOD;
	}
	return a * (modPow(b, MOD - 2)) % MOD;
}

int main() {
    // input, ready
    string O,E;
    cin >> O >> E;


  
   for (int i=0; i < O.size () ; i++) {
cout << O[i];

 if(i < E.size () ) cout << E[i];
 }

    // output

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define RL R_1_or_L_2(x[0],y[0],x[1],y[1],x[2],y[2])

int R_1_or_L_2(
    double x1,double y1,
    double x2,double y2,
    double x3,double y3){
  int i;

  if(x1==x2)
    return (y1<y2)?
      (x3>x1?1:2):
      (x3<x1?1:2);
  if(y1==y2)
    return (x1<x2)?
      (y3<y1?1:2):
      (y3>y1?1:2);
  if(y3<(x3-x1)*(y2-y1)/(x2-x1)+y1)
    return (x1<x2)?1:2;
  return (x2<x1)?1:2;
}

int main(void){
  double x[4],y[4];
  char hoge;

  for(;scanf("%lf%c%lf%c%lf%c%lf%c%lf%c%lf%c%lf%c%lf",
        &x[0],&hoge,&y[0],&hoge,
        &x[1],&hoge,&y[1],&hoge,
        &x[2],&hoge,&y[2],&hoge,
        &x[3],&hoge,&y[3])==15;){
    if( RL==R_1_or_L_2(x[0],y[0],x[2],y[2],x[3],y[3]) &&
        RL==R_1_or_L_2(x[1],y[1],x[2],y[2],x[3],y[3]) &&
        RL==R_1_or_L_2(x[1],y[1],x[3],y[3],x[0],y[0]) &&
        RL==R_1_or_L_2(x[2],y[2],x[3],y[3],x[0],y[0]) &&
        RL==R_1_or_L_2(x[2],y[2],x[0],y[0],x[1],y[1]) &&
        RL==R_1_or_L_2(x[3],y[3],x[0],y[0],x[1],y[1]) &&
        RL==R_1_or_L_2(x[3],y[3],x[1],y[1],x[2],y[2]))
      printf("YES\n");
    else
      printf("NO\n");
  }

  return 0;
}

Measured memory_bytes: 0
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        ArrayList<HashSet<Integer>> edge = new ArrayList<HashSet<Integer>>();
        for (int i=0;i<N;i++) {
            HashSet<Integer> add = new HashSet<Integer>();
            edge.add(add);
        }
        int[] in = new int[N];
        int[] A = new int[N+M-1];
        int[] B = new int[N+M-1];
        for (int i=0;i<N+M-1;i++) {
            A[i] = sc.nextInt()-1;
            B[i] = sc.nextInt()-1;
            edge.get(A[i]).add(B[i]);
            in[B[i]]++;
        }

        int index = -1;
        for (int i=0;i<N;i++) {
            if (in[i]==0) {
                index = i;
                break;
            }
        }

        ArrayList<Integer> topo = new ArrayList<Integer>();
        ArrayDeque<Integer> q = new ArrayDeque<Integer>();
        q.add(index);
        while (!q.isEmpty()) {
            Integer rem = q.poll();
            topo.add(rem);
            for (Integer to : edge.get(rem)) {
                in[to]--;
                if (in[to]==0) q.add(to);
            }
        }

        int[] inv = new int[N];
        for (int i=0;i<N;i++) {
            inv[topo.get(i)] = i;
        }

        ArrayList<TreeSet<Integer>> edge_reverse = new ArrayList<TreeSet<Integer>>();
        for (int i=0;i<N;i++) {
            TreeSet<Integer> add = new TreeSet<Integer>();
            edge_reverse.add(add);
        }
        for (int i=0;i<N+M-1;i++) {
            edge_reverse.get(inv[B[i]]).add(inv[A[i]]);
        }

        for (int i=0;i<N;i++) {
            int root = 0;
            if (inv[i]!=0) root=topo.get(edge_reverse.get(inv[i]).last())+1;
            System.out.println(root);
        }
    }
}


Measured memory_bytes: 112848
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>

using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define pb(a) push_back
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
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 pair<int, int>P;
const int MOD = 1e9 + 7; const int MAX = 200020;
const double pi = acos(-1); const double EPS = 1e-12;
const ll INF = 1e18;

int G[10][10];
void solve() {
	int N, M; cin >> N >> M;
	REP(i, M) {
		int u, v; cin >> u >> v;
		u--, v--;
		G[u][v] = G[v][u] = 1;
	}
	int ans = 0;
	int perm[10];
	REP(i, N)perm[i] = i;
	do {
		if (perm[0] != 0)continue;
		bool ok = true;
		REP(i, N - 1) {
			int now = perm[i], nxt = perm[i + 1];
			if (!G[now][nxt])ok = false;
		}
		if (ok)ans++;
	} while (next_permutation(perm, perm + N));;
	print(ans);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
	solve();
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
	int n;
	string s;
	cin >> n >> s;
	int left[26] = {0},right[26] = {0};
	int ans = 0;

	for(int i = 0; i < n; i++){
		for(int j = 0; j < 26; j++){
			left[j] = 0;
			right[j] = 0;
		}

		for(int j = 0; j < i; j++){
			left[s[j]-'a']++;
		}
		for(int j = i; j < n; j++){
			right[s[j]-'a']++;
		}
		int res = 0;
		for(int j = 0; j < 26; j++){
			if(left[j]!= 0 && right[j]!= 0) res++;
		}
		ans = max(ans,res);

	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
int main()
{
    ll a,b,c; cin>>a>>b>>c;
    ll x=a+b;
    ll y=b+c;
    ll z=a+c;
    cout<<min(x,min(y,z));
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    char in[4];
    char out[4];
    
    for (int i = 0; i< 3; i++){
        cin >> in;
        out[i] = in[i];
    }
    out[3] = '\0';

    cout << out << endl;

    return 0;
}


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

#define  SZ(items) (int)items.size()
#define  CLR(a)  memset(a,0,sizeof(a))
#define  SET(a)  memset(a,-1,sizeof(a))


#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1)
{
    cerr << name << " is " << arg1 << std::endl;
}
template < typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args)
{
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " is " << arg1 << " | ";
    __f(comma + 1, args...);
}
#else
#define debug(...)
#endif


void solve()
{
 string s;
 cin>>s;
 set<char> st;
 for(int i=0;i<s.size();i++){
    st.insert(s[i]);
 }
 
 if(st.size()==2){
    cout<<"Yes"<<endl;
 }
 else{
    cout<<"No"<<endl;
 }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    cout.tie(nullptr);
    cin.tie(nullptr);

    int t = 1;

    while (t--)
    {

        solve();
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
// rep(i, 1, 5) --> {1,2,3,4}
// rep(i, 5, 1) --> {4,3,2,1}
// rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int ans = 1;
    rep(i, 0, n)
    {
        int minn = min(ans*2, ans+k);
        ans = minn;
        // cout << ans << endl;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
object Main extends App {
  val abcInput =  scala.io.StdIn.readLine()
  val abcArray = abcInput.split(" ").map(_.toInt).toSeq
  val distinctAbc = abcArray.distinct
  if (distinctAbc.length == 2) {
    println("Yes")
  } else {
    println("No")
  }

}

Measured memory_bytes: 25428
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scin = new Scanner(System.in);
		
		int[] nums = new int[Integer.parseInt(scin.nextLine())];
		
		for (int i = 0; i < nums.length; i++) {
			nums[i] = Integer.parseInt(scin.nextLine());
		}
		
		System.out.println(primeNumberCounter(nums));
	}
	
	public static int primeNumberCounter(int nums[]) {
		
		int output = 0;
		
		for (int i = 0; i < nums.length; i ++) {
			int tgt_num = nums[i];
			boolean isPrime = true;
			if (tgt_num%2==0) {
				isPrime= false;
			}
		    //if not, then just check the odds
		    for(int x=3;x*x<=tgt_num;x+=2) {
		        if(tgt_num%x==0) {
		        	isPrime= false;
		        	break;
		        }
		            
		    }
			if (isPrime || tgt_num == 2) {
				output += 1;
			}
		}
		
		
		return output;
	}
}


Measured memory_bytes: 61124
<?php
fscanf(STDIN,'%d',$n);
$dp=array();

//幸福度の配列作成
for ($i=0;$i<$n;$i++){
	fscanf(STDIN,'%d %d %d',$a,$b,$c);
	$arrayA[$i] = $a;
	$arrayB[$i] = $b;
	$arrayC[$i] = $c;
}

//初期値は0
$dpA[0] = $arrayA[0];
$dpB[0] = $arrayB[0];
$dpC[0] = $arrayC[0];

//各A、B、Cが選ばれるパターンを見て最後に最大を見る
for ($i=1;$i<$n;$i++){
	$dpA[$i]=$arrayA[$i]+max($dpB[$i-1],$dpC[$i-1]);
	$dpB[$i]=$arrayB[$i]+max($dpA[$i-1],$dpC[$i-1]);
	$dpC[$i]=$arrayC[$i]+max($dpA[$i-1],$dpB[$i-1]);
}
$ans = max($dpA[$n-1],$dpB[$n-1],$dpC[$n-1]);
echo $ans;

Measured memory_bytes: 90740
#include <bits/stdc++.h>
using namespace std;
// #define rep(i,n) for(int i=0;i<n;++i)
#define rep(i,i0,n) for(int i=i0;i<n;++i)
#define ALL(x) (x).begin(),(x).end()
#define pb = push_back;
#define INF12 1000000000000 //10^12
#define INF9 1000000000 //10^9
#define MOD 1000000007 //10^9+7
using ll=long long;
using pii=pair<ll,ll>;
using vi=vector<int>;



int main() {
    string O, E;
    cin >> O >> E;
    string ans = "";
    int lO = O.size();
    int lE = E.size();
    rep(i,0,E.size()) {
        ans = ans + O[i] + E[i];
    }
    if(lO > lE) ans += O[lO-1];
    cout << ans.c_str() << endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;

int N;
int D[100];

int dp[100][30][30];
int solve(int i, int l, int r) {
  int &res = dp[i][l][r];
  if (res != -1) {
    return res;
  }
  if (i >= N) {
    return res = r - l;
  }
  // left
  res = max(res, min(D[i] - l, solve(i + 1, D[i], r)));
  // right
  res = max(res, min(r - (24 - D[i]), solve(i + 1, l, 24 - D[i])));
  return res;
}

int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> D[i];
  }
  sort(D, D + N);
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0, 24) << endl;
  return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<math.h>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<algorithm>
#include<bitset>
#include <climits>
using namespace std;
#define _GLIBCXX_DEBUG
#define pq priority_queue
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define vit vector<lint>::iterator
#define all(x) (x).begin(),(x).end()
#define rep(x) for(int i = 0;i < (x);i++)
#define repj(x) for(int j = 0;j < (x);j++)
#define REP(i,x) for(int (i) = 0;(i) < (x);(i)++)
#define rrep(x) for(int i = (x);i >= 0;i--)
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define mod 1000000007
#define graph_set(n) struct edge{int to,int cost;} vector<edge> G((n))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define range(x,y) ((x) >= 0 && (x) < h && (y) >= 0 && (y) < w)
#define pyes cout << "Yes" << endl
#define pno cout << "No" << endl
#define fin return 0
typedef vector<long long> vi;
typedef vector<pair<long long, long long>> vp;
typedef vector<vector<long long>> vvi;
typedef pair<long long, long long> pi;
typedef long long lint;
typedef long long ll;
lint qp(ll a, ll b) { ll ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
lint qp(ll a, ll b, int mo) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
lint gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
long long INF = 1000000000000000;

int r[100], l[100];
int a, b;

#define MAX 9223372036854775807
/*********************** */

int main() {
	int n;cin >> n;
	int a = 0;
	for(int i = 1;i <= n;i++){
		if((int)log10(i) %2 == 0) a++;
	}
	cout << a << endl;
	return 0;
}


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

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


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define ALL(x) (x).begin(),(x).end()
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)


int main() {
  int N; cin >> N;
  vector<int> G[100005], C, d, edge;
  int a, b, cost, M;
  rep(i,N-1){
    cin >> a >> b;
    a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  rep(i,N){
    cin >> cost;
    C.push_back(cost);
    M += cost;
  }
  sort(ALL(C));
  M -= C[C.size()-1];
  int next = 0;
  rep(i,N){
    edge.push_back(G[i].size());
    d.push_back(-1);
  }

  while(true){
    bool flag = false;
    rep(i,N){
      if(edge[i] == 1){
        flag = true;
        d[i] = C[next];
        next++;
        edge[i]--;
        rep(j,G[i].size()) edge[G[i][j]]--;
      }
    }
    if(!flag) break;
  }

  cout << M << endl;
  rep(i,N){
    if(d[i] == -1){
      cout << C[C.size()-1] << ' ';
    }else{
      cout << d[i] << ' ';
    }
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3200
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <tuple>
#include <set>
#include <map>

#define FOR0(var, max) for (ul (var) = 0; (var) < (max); ++(var))
#define FORi(var, min, max) for (ul (var) = (min); (var) < (max); ++(var))
#define FORi_INV(var, min, max) for (ul (var) = (max) - 1; (var) + 1 > (min); --(var))
#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))
#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))
#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))
#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;

using sc = signed char;
using si = signed int;
using sl = signed long long int;

template <class T>
T gcd(T a, T b) {
  while (b) {
    T t = a % b;
    a = b;
    b = t;
  }
  return a;
}

/* (identity element, operation) */
template <class T>
using Monoid = pair<T, function<T(T, T)>>;

template <class T, ul K>
class SegmentTree {
  const Monoid<T> monoid;
  const ul N = (1 << K);
  T tree[2 * (1 << K) - 1];

  ui parent(ui i) {
    if (i == 0) {
      return 0;
    }
    return (i - 1) / 2;
  }

  ui child1(ui i) {
    return i * 2 + 1;
  }

  ui child2(ui i) {
    return i * 2 + 2;
  }

  bool is_leaf(ui i) {
    return (N - 1 <= i);
  }

  void propagate_from_leaf(ui i) {
    ui cur = N - 1 + i;
    while (cur != 0) {
      cur = parent(cur);
      auto x1 = tree[child1(cur)];
      auto x2 = tree[child2(cur)];
      tree[cur] = monoid.second(x1, x2);
    }
  }

  T query_impl(ui a, ui b, ui k, ui l, ui r) {
    if (r <= a || b <= l) {
      return monoid.first;
    } else if (a <= l && r <= b) {
      return tree[k];
    } else {
      auto ta = query_impl(a, b, child1(k), l, (l + r) / 2);
      auto tb = query_impl(a, b, child2(k), (l + r) / 2, r);
      return monoid.second(ta, tb);
    }
  }
public:
  /* Initialize Segment Tree with Monoid `_monoid` */
  SegmentTree(const Monoid<T>& _monoid) : monoid(_monoid) {
    FOR0(i, 2 * (1 << K) - 1) {
      tree[i] = monoid.first;
    }
  }

  void update(ui i, T x) {
    tree[N - 1 + i] = x;
    propagate_from_leaf(i);
  }

  // [a, b)
  T query(ui a, ui b) {
    return query_impl(a, b, 0, 0, N);
  }
};

string S;

bool solve(void) {
  const char *str = S.c_str();
  FOR0(i, strlen(str)) {
    if (i % 2 == 0) {
      if (str[i] == 'R' || str[i] == 'U' || str[i] == 'D') {
        continue;
      }
    } else {
      if (str[i] == 'L' || str[i] == 'U' || str[i] == 'D') {
        continue;
      }
    }
    return false;
  }
  return true;
}

int main(void) {
  cin >> S;
  cout << (solve() ? "Yes" : "No") << endl;
  return 0;
}

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

int main() {
  int N, K;
  long Min=1000000000;
  cin >> N >> K;
  vector<long> H(N);
  rep(i, N) cin >> H.at(i);
  sort(H.begin(), H.end());
  rep(i, N-K+1) Min=min(Min,H.at(i+K-1)-H.at(i));
  cout << Min << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<queue>
#include<bitset>
#include<algorithm>
#include<climits>
#include<vector>
#include<deque>
#include<cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> P;
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define dump(a) rep(i,a.size()){ cout<<a[i]<<" "; } cout<<endl;
#define dumparr(a,n) rep(i,n){ cout<<a[i]<<" "; } cout<<endl;
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define INF INT_MAX/3
#define FINF DBL_MAX/3
#define EPS 1e-7

/*
 *
 */

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

  if(k%2 == 0){
    ll t = n/k;
    ll t2 = n/(k/2) - n/k;
    cout<<t2*t2*t2 + t*t*t<<endl;
  }else{
    ll t = n/k;
    cout<<t*t*t<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
const int N = 1e7+5;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	ll ans = 0;
	for(int i=1; i<=n; ++i){
		for(int j=i; j<=n; j+=i){
			ans += j;
		}
	}
	cout<<ans<<'\n';

	return 0;
}


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

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

    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    a.push_back(a[0] + k);

    int l = 0;
    for (int i = 0; i < n; i++)
    {
        l = max(l, a[i + 1] - a[i]);
    }
    int ans = k - l;
    cout << ans << endl;
}

Measured memory_bytes: 1792
import math

a, b, x = map(int, input().split())

if x == a*a*b//2:
    print(45)
elif x > a*a*b//2:
    print(math.degrees(math.atan(2*(a*a*b-x)/a**3)))
else:
    print(math.degrees(math.atan((a*b*b)/(2*x))))

Measured memory_bytes: 3188
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<queue>
#include<list>
#include<stdio.h>
#include<stdlib.h>
#include<map>
#include<cstdio>
#include <iomanip>

#define rep(i,b) for(int i=0;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

using namespace std;
typedef long long ll;

int main() {

	int n, k;
	cin >> n >> k;
	//探索用にソートした列
	//内部にあるか判定するために素の入力の2つをもっておく。
	vector<int> x(n), y(n);
	vector<int>xary, yary;

	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i];

		xary.push_back(x[i]);
		yary.push_back(y[i]);
	}

	//ソートする。
	sort(begin(xary), end(xary));
	sort(begin(yary), end(yary));

	ll ans = 1LL * (xary[n - 1] - xary[0])*(yary[n - 1] - yary[0]);


	//4点全探索。幅をもたせる。
	for (int xi = 0; xi < n; xi++) {
		for (int xj = xi + 1; xj < n; xj++) {
			for (int yi = 0; yi < n; yi++) {
				for (int yj = yi + 1; yj < n; yj++) {

					int num = 0;
					ll lx = xary[xi], rx = xary[xj];
					ll by = yary[yi], uy = yary[yj];

					//現在決めた長方形に含まれているか全ての点を数え上げ。
					for (int i = 0; i < n; i++) {
						if (lx <= x[i] && x[i] <= rx && by <= y[i] && y[i] <= uy) {
							num++;
						}
					}
					
					//更新処理。決めた4点から面積を求める。
					if (num >= k)ans = min(ans, 1LL * (rx - lx)*(uy - by));

				}
			}
		}
	}

	cout << ans << endl;

	return 0;
}

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

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

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

const int MXN = 1e6 + 200;
const long long MNN = 2e3 + 200;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
const int OO = 1e9 + 500;

typedef long long llong;
typedef unsigned long long ullong;

using namespace std;

llong ans;
string s;
int cnt = 0;

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

int main () {
    ios;
    cin >> s;
    llong n = s.size();
    s = '#' + s;
    for(int i = 1; i <= n; i++){
        if(s[i] == '1'){
            cnt++;
            ans = (ans + binpow(2, cnt - 1) * binpow(3, n - i)) % MOD;
        }
    }
    cout << (ans + binpow(2, cnt)) % MOD;
    return 0;
}

//162261460
//162261460


Measured memory_bytes: 512
f = lambda: map(int,input().split())


class UnionFind(object):
    def __init__(self, size):
        self.parent = [i for i in range(size)]
        self.rank = [0 for _ in range(size)]

    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            return self.find(self.parent[x])

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
        else:
            self.parent[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def same(self, x, y):
        return self.find(x) == self.find(y)


n,m = f()
p = list(f())

u = UnionFind(n)
for _ in range(m):
    x,y = f()
    u.unite(x-1, y-1)


ans = 0
for i in range(n):
    if u.find(i)==u.find(p[i]-1):
        ans += 1
print(ans)


Measured memory_bytes: 14452
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define inf 1e9
#define INF 1000000000000000000

int main() {
    int N, M, Q;
    cin >> N >> M >> Q;
    vector<vector<int>> grid(510, vector<int>(510, 0));
    rep(i, M) {
        int l, r;
        cin >> l >> r;
        grid[l][r]++;
    }

    rep(i, 501) {
        rep(j, 501) {
            grid[i + 1][j + 1] +=
                (grid[i][j + 1] + grid[i + 1][j] - grid[i][j]);
        }
    }

    rep(i, Q) {
        int p, q;
        cin >> p >> q;
        int x1 = p - 1, x2 = q, y1 = p - 1, y2 = q;
        cout << grid[x2][y2] - grid[x1][y2] - grid[x2][y1] + grid[x1][y1]
             << endl;
    }
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define REP(i,j,n) for(int i = j;i < (n);i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl
int main(){
  string O, E;
  cin >> O >> E;
  string ans;
  rep(i, O.size()){
    ans = ans + O.substr(i,1) + E.substr(i,1);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int N, M;
pair <int, int> X[100005];

int main() {
    ios_base::sync_with_stdio(false);
    cin >> N >> M;
    for(int i = 1; i <= N; i++)
        cin >> X[i].second >> X[i].first;
    
    sort(X + 1, X + N + 1);
    reverse(X + 1, X + N + 1);
    set <int> s;
    for(int i = 1; i <= M; i++)
        s.insert(i);
    int ans = 0;
    for(int i = 1; i <= N; i++) {
        auto it = s.upper_bound(M - X[i].second + 1);
        if(it == s.begin()) 
            continue;
        it--;
        ans += X[i].first;
        s.erase(it);
    }
    cout << ans;
}


Measured memory_bytes: 5760
N = int(input())

ac = wa = tle = re = 0

for i in range(N):
	s = str(input())
	if s == "AC":
		ac += 1
	elif s == "WA":
		wa += 1
	elif s == "TLE":
		tle += 1
	else:
		re += 1

print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

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

using namespace std;
int dp[100000],n,h[100000];
int main()
{

ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

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

dp[0]=0;
dp[1]=abs(h[1]-h[0]);

for(int i=2;i<n;i++){
	dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
}
cout<<dp[n-1];

}

Measured memory_bytes: 1024
c1 = list(map(int, input().split()))
c2 = list(map(int, input().split()))
c3 = list(map(int, input().split()))
c1_c1 = [0] * 3
c2_c1 = [0] * 3
c3_c1 = [0] * 3

for i in range(3):
   c1_c1[i] = c1[i] - c1[i]
   c2_c1[i] = c2[i] - c1[i]
   c3_c1[i] = c3[i] - c1[i]

if(c1_c1[0] == c1_c1[1] and c1_c1[1] == c1_c1[2] and c2_c1[0] == c2_c1[1] and c2_c1[1] == c2_c1[2] and c3_c1[0] == c3_c1[1] and c3_c1[1] == c3_c1[2] ):
   print("Yes")
else:
   print("No")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ll n,x,t;
    cin>>n>>x>>t;
    ll p;
    if(n%x==0){
        p=n/x;
    }
    else p=(n/x)+1;
    cout<<p*t<<endl;
}


Measured memory_bytes: 3620
program main
   implicit none
   integer:: r(3),n,i,j,k,counter=0,a(3)
   read(*,*)r,n
   a(1)=maxval(r)
   a(3)=minval(r)
   r(maxloc(r))=0
   a(2)=maxval(r)

   do i=0,n
      
      do j=0,n
         if(n-a(2)*j-a(3)*i>=0.and. mod(n-a(2)*j-a(3)*i,a(1))==0)counter=counter+1
      ENDDO
   enddo
   write(*,*)counter
end program main


Measured memory_bytes: 256