akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(v) (v).begin(),(v).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
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; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a/gcd(a,b)*b; }
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int MAXN=200005;
int n, k;
vector<int> a(MAXN);

bool chk(int x) {
    int cnt = 0;
    rep(i,n) {
        cnt += (a[i]-1)/x;
    }
    if(cnt<=k) return true;
    return false;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
	cin >> n >> k;
    rep(i,n) cin >> a[i];
    int l=1, r=1000000000, now;
    while (r>l) {
        now = (l+r)/2;
        if(chk(now)) {
            r = now;
        } else {
            l = now+1;
        }
    }
    cout << r << "\n";
	return 0;
}


Measured memory_bytes: 3900
#include <iostream>
#include <stdio.h>

int main() {
	int array[5];
	for (int i = 0; i < 5; i++) {
		scanf("%d", &array[i]);
	}
	int min = 0;
	int sum = 0;
	for (int i = 0; i < 5; i++) {
		int mod =array[i] % 10;
		if (mod == 0) {
			mod = 10;
		}
		if (array[min] % 10 >mod) {
			min = i;
		}
	}
	for (int i = 0; i < 5; i++) {
		if (i==min) {
			sum += array[i];
		}
		else {
			if (array[i] % 10 != 0) {
				sum += 10;
			}
			sum += array[i] -array[i]%10 ;
		}
	}
	printf("%d", sum);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

#define ll long long
#define INF 100000000000000

using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a + b + c >= 22) {
    cout << "bust" << endl;
  } else {
    cout << "win" << endl;
  }
}


Measured memory_bytes: 256
n = int(input())
a_inputs = [int(i) for i in input().split()]

dic_l={}
dic_r={}
for i in range(n):
    a = a_inputs[i]+(i+1)
    b = (i+1)-a_inputs[i]
    dic_l[a]=dic_l.get(a,0)+1
    dic_r[b]=dic_r.get(b,0)+1

ans=0
for key in dic_l.keys():
    ans+=dic_l[key]*dic_r.get(key,0)
    
print(ans)

Measured memory_bytes: 56756
<?php

if (!empty($argv[1])) {
    Util::enablingDebug();
}

myMain();

// bench
Util::printBench();

class Util
{
    private static $isDebug = false;
    private static $startTime;

    public static function input($isSplitSpace = false)
    {
        $input = trim(fgets(STDIN));
        if (!$isSplitSpace) {
            return $input;
        }

        return explode(' ', $input);
    }

    public static function arrToStr($arr)
    {
        return implode(",", $arr);
    }

    public static function enablingDebug()
    {
        self::$isDebug = true;
        self::$startTime = time();
    }

    public static function isDebug()
    {
        return self::$isDebug;
    }

    public static function debugLog($text, $isReturn = true)
    {
        if (self::$isDebug) {
            echo $text;
            if ($isReturn) {
                echo PHP_EOL;
            }
        }
    }

    public static function varDump($obj)
    {
        if (self::$isDebug) {
            var_dump($obj);
        }
    }

    public static function arrFirst($arr)
    {
        if (empty($arr) || !is_array($arr)) {
            return null;
        }

        return current($arr);
    }

    public static function arrLast($arr)
    {
        if (empty($arr) || !is_array($arr)) {
            return null;
        }

        return end($arr);
    }

    public static function printBench()
    {
        if (!self::$isDebug) {
            return;
        }

        echo sprintf("Fin. Time: %.3f s  MemoryPeakUsage: %.3f KB" . PHP_EOL, time() - self::$startTime, memory_get_peak_usage() / 1024);
    }
}


function myMain()
{
    // START
    $n = Util::input();

    $fibonacci = new Fibonacci();
    echo $fibonacci->getN($n) . PHP_EOL;
}

class Fibonacci
{
    private $_memo = [];

    public function getN($n)
    {
        if (isset($this->_memo[$n])) {
            return $this->_memo[$n];
        }

        if ($n <= 1) {
            return 1;
        }

        $this->_memo[$n] = self::getN($n - 2) + self::getN($n - 1);
        return $this->_memo[$n];
    }
}


Measured memory_bytes: 9360
def cycle_cnt(start, graph)
  current = graph[start]
  cnt = 1
  while start != current
    current = graph[current]
    cnt += 1
  end

  cnt
end

require "set"

N, K = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)
A.unshift(nil)

traversed = Set.new
traversed.add(1)

current = 1
cnt = 0
detect_flg = true
while cnt != K
  cnt += 1
  current = A[current]
  if traversed.member?(current) && detect_flg
    cycle_cnt = cycle_cnt(current, A)
    cnt += cycle_cnt * ((K - cnt) / cycle_cnt).floor
    detect_flg = false
  end

  traversed.add(current)
end

puts current


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

void merge_sort(long long x[], int n)
{
	static long long y[100001] = {};
	if (n == 1) return;
	merge_sort(&(x[0]), n/2);
	merge_sort(&(x[n/2]), (n+1)/2);
	
	int i, p, q;
	for (i = 0, p = 0, q = n/2; i < n; i++) {
		if (p >= n/2) y[i] = x[q++];
		else if (q >= n) y[i] = x[p++];
		else y[i] = (x[p] < x[q])? x[p++]: x[q++];
	}
	for (i = 0; i < n; i++) x[i] = y[i];
}

int main()
{
	int i, N;
	long long A[100001];
	scanf("%d", &N);
	for (i = 0; i < N; i++) scanf("%lld", &(A[i]));
	
	merge_sort(A, N);
	long long sum = 0;
	for (i = 0; i < N / 2; i++) sum -= A[i];
	for (i = (N + 1) / 2; i < N; i++) sum += A[i];
	sum *= 2;
	if (N % 2 == 0) sum -= A[N/2] - A[N/2-1];
	else if (A[N/2-1] - A[N/2] > A[N/2] - A[N/2+1]) sum += A[N/2-1] - A[N/2];
	else sum += A[N/2] - A[N/2+1];
	
	printf("%lld\n", sum);
	fflush(stdout);
	return 0;
}

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

int main() {
    string s;
    int k;
    cin >> k >> s;
    if(s.size() <= k) {
        cout << s << endl;
    } else {
        string ans = s.substr(0, k);
        ans += "...";
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3636
using System;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Collections.Generic;
class Program
{
    private static int[] a;
    private static int[] b;
    private static int[] c;
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        a = Console.ReadLine().Split().Select(s => -int.Parse(s)).ToArray();
        b = Console.ReadLine().Split().Select(int.Parse).ToArray();
        c = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Array.Sort(a);
        Array.Sort(b);
        Array.Sort(c);
        long ans = 0;
        foreach (var bi in b)
        {
            if (bi >= c[n - 1] || bi <= -a[n - 1])
                continue;
            ans += (n - (long)Search(a, -bi, 0, n - 1)) * (n - Search(c, bi, 0, n - 1));
        }
        Console.WriteLine(ans);
    }
    private static int Search(int[] array, int n, int s, int e)
    {

        if (s == e)
            return s;
        int m = s + (e - s) / 2;
        if (array[m] <= n)
            return Search(array, n, m + 1, e);
        else
            return Search(array, n, s, m);
    }
}

Measured memory_bytes: 41116
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Numerics;

class p
{

    static int ConvertChar(char ch)
    {
        if (ch == 'A') return 1;
        else return 2;
    }
    

    static void Main(string[] args)
    {
        //解説みて実装した
        string S = Console.ReadLine();
        string T = Console.ReadLine();
        int q = int.Parse(Console.ReadLine());

        int[] SiSum = new int[S.Length];
        int[] TiSum = new int[T.Length];

        SiSum[0] = ConvertChar(S[0]);
        for (int i = 1; i < S.Length; i++)
        {
            SiSum[i] = SiSum[i - 1] + ConvertChar(S[i]);
        }

        TiSum[0] = ConvertChar(T[0]);
        for (int i = 1; i < T.Length; i++)
        {
            TiSum[i] = TiSum[i - 1] + ConvertChar(T[i]);
        }


        for (int i = 0; i < q; i++)
        {
            int Svalue = 0;
            int Tvalue = 0;
            string[] inputs = Console.ReadLine().Split();
            int SSindex = int.Parse(inputs[0]) - 1;
            int SEindex = int.Parse(inputs[1]) - 1;
            int TSindex = int.Parse(inputs[2]) - 1;
            int TEindex = int.Parse(inputs[3]) - 1;

            if (SSindex == 0) Svalue = SiSum[SEindex];
            else Svalue = SiSum[SEindex] - SiSum[SSindex - 1];
            Svalue %= 3;

            if (TSindex == 0) Tvalue = TiSum[TEindex];
            else Tvalue = TiSum[TEindex] - TiSum[TSindex - 1];
            Tvalue %= 3;

            if (Svalue == Tvalue) Console.WriteLine("YES");
            else Console.WriteLine("NO");
        }
    }   
}

Measured memory_bytes: 17648
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	float d;
	cin>>d;
	b=ceil(d/1.08);
	a=b*(1.08);
	c=(b-1)*(1.08);
	if(b<=0)
	{
		cout<<":("<<endl;
	}
	else if(a==d || c==d)
	{
		cout<<b<<endl;
	}
	else
	{
		cout<<":("<<endl;
	}
	
	
}

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

int main() {
    int k,ans=0;
    cin>>k;
    rep(i,k)rep(j,k)rep(l,k)ans+=gcd(i+1,gcd(j+1,l+1));
    cout << ans <<endl;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,f,ans;
long long gcd(int x,int y){
    if(y==0) return x;
    return gcd(y,x%y);
}
int main(){
	cin>>a>>b>>c>>d;
	cout<<b-a+1-(b/c-a/c)-(b/d-a/d)+(b/(c/gcd(c,d)*d)-a/(c/gcd(c,d)*d))-(a%c==0)-(a%d==0)+(a%(c/gcd(c,d)*d)==0)<<endl;
	return 0;
}

Measured memory_bytes: 256
#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<cctype>
#include <fstream>
#include <time.h>
#include <iterator>




#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 FORR(i, m, n) for(int i = m;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(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
#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 all(x) (x).begin(), (x).end()
using namespace std;
int MOD = (ll)1000000000 + 7;
const ll INF = 1e17;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;

int s_toi(string s) {
	ll ans = 0;
	REP(i, s.size()) {
		ans *= 10;
		ans += s[i] - '0';
	}
	return ans;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string S; cin >> S;
	int N = S.size();
	int ans = INF;
	REP(i, N - 2) {
		string str = S.substr(i, 3);
		int res = s_toi(str);
		ans = min(ans, abs((ll)753 - res));
	}
	print(ans);
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
  int num,n[200],i,k[200]={0},min;

  scanf("%d",&num);
  
  for(i=0; i<num; i++){
    scanf("%d",&n[i]);
  }
  
  for(i=0; i<num; i++){
    while(n[i]%2==0){
      k[i]++;
      n[i]=n[i]/2;
    }
  }
     
  

  min=k[0];
  for(i=1; i<num; i++){
    if(min>k[i]){
      min=k[i];
    }
  }

  printf("%d",min);

  return 0;
}




Measured memory_bytes: 128
import java.util.Scanner;

/**
 *
 * @author k16075kk
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int[][] array = new int[4][13];
        for (int i = 0; i < a; i++) {
            String b = scanner.next();
            int c = scanner.nextInt();
            if (b.equals("S"))
                array[0][c - 1] = 1;
            else if (b.equals("H"))
                array[1][c - 1] = 1;
            else if (b.equals("C"))
                array[2][c - 1] = 1;
            else
                array[3][c - 1] = 1;
        }
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < 13; j++) {
                if (array[i][j] == 0)
                    if (i == 0)
                        System.out.println("S " + (j + 1));
                    else if (i == 1)
                        System.out.println("H " + (j + 1));
                    else if (i == 2)
                        System.out.println("C " + (j + 1));
                    else
                        System.out.println("D " + (j + 1));
            }
        }
    }
}
    




Measured memory_bytes: 26476
//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define double long double 
#define fi first
#define se second
#define pii pair<int, int>

const int N = 1e5 + 1000, mod = 1e9 + 7;
vector<vector<int>> g(N);
vector<int> child(N, 0), ans(N, 0);
vector<bool> visited(N, false);
int n, k;

void dfs(int v) {
  visited[v] = true;
  for (auto &u : g[v]) {
    if (!visited[u]) {
      if (v == 1) {
        ans[u] = k - (1 + child[v]);
      } else {
        ans[u] = k - (2 + child[v]);
      }
      child[v]++;
      dfs(u);
    }
  }
}
signed main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
  cin >> n >> k;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  ans[1] = k;
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (ans[i] <= 0) {
      cout << "0\n";
      return 0;
    }
  }
  int res = 1;
  for (int i = 1; i <= n; i++) {
    res *= ans[i];
    res %= mod;
  }
  cout << res << "\n";
}



Measured memory_bytes: 10880
package main

import "fmt"

func main() {
	group := make([]int, 12+1)
	for _, b := range []int{4, 6, 9, 11} {
		group[b] = 1
	}
	for _, c := range []int{2} {
		group[c] = 2
	}
	
	var x, y int
	fmt.Scanf("%d %d", &x, &y)
	if group[x] == group[y] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


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

using namespace std;

typedef long long ll;

ll solve(int n, int k) {
    ll a[n+1];
    a[0] = 0;
    for(int i=1;i<=n;++i){
        cin >> a[i];
        a[i] += a[i-1];
    }

    ll ans = 0LL;
    for(int i=1;i<=n-k;++i) {
        ans = max(ans, a[i+k-1]-a[i-1]);
    }
    return ans;
}

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

    while(n) {
        cout << solve(n, k) << endl;
        cin >> n >> k;
    }
}


Measured memory_bytes: 3780
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
//#pragma warning(disable : 4996)

#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif

#include <limits.h>
#include <math.h>
#include <time.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

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 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> pii;
typedef pair<long long, long long> pll;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 998244353;
constexpr int MAX = 5050;
const double pi = acos(-1);
// constexpr double EPS = 1e-10;
constexpr ll INF = 1e16;
void yes(bool c) {
	if (c)
		print("Yes");
	else
		print("No");
};


vector<int>G[200020];
void solve() {
	int N, M; cin >> N >> M;
	REP(i, M) {
		int u, v; cin >> u >> v;
		u--, v--;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	queue<int>que;
	que.push(0);
	vector<bool>vis(N);
	vector<int>ans(N);
	while (true) {
		vector<int>v;
		while (!que.empty()) {
			int pos = que.front(); que.pop();
			vis[pos] = true;
			for (auto nxt : G[pos]) {
				if (vis[nxt])continue;
				ans[nxt] = pos;
				vis[nxt] = true;
				v.push_back(nxt);
			}
		}
		if (v.empty())break;
		for (auto x : v)que.push(x);
	}

	print("Yes");
	FOR(i, 1, N) {
		print(ans[i] + 1);
	}
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	// int q;
	// cin >> q;
	// while (q--)
	solve();
}


Measured memory_bytes: 15904
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <math.h>
#include <utility>
#include <vector>
#include <map>

#define div1 1000000007

using namespace std;

int main(void)
{
    int N, a[101], i, j, min, max, ans=100000000, num;

    cin >> N;

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

    sort(a+1, a+N+1);

    min = a[1];
    max = a[N];

    for(i=min; i<=max; i++){
        num = 0;

        for(j=1; j<=N; j++){
            num += pow((i-a[j]), 2);
        }

        if(ans > num){
            ans = num;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
using namespace std;

int main() {

    int n;
    cin >> n;

    long long power = 1;

    for (int i = 1; i <= n; i++) {
        power = i * power % 1000000007; 
    }
    
    cout << power << endl;

}

Measured memory_bytes: 256
import std.stdio;
import std.algorithm;
import std.string;
import std.functional;
import std.array;
import std.conv;
import std.math;
import std.typecons;
import std.regex;
import std.range;

void main(){

    int n = readln().chomp().to!int;
    int[101][101] mat;
    int[][] num;
    num ~= new int[n+1];
    for(int i=0;i<n;i++){
	num ~= (0 ~ split(readln()).to!(int[]));
    }
    for(int i=0;i<num.length;i++){
	for(int j=0;j<num[i].length;j++){
	    for(int k=0;k<=i;k++){
		for(int l=0;l<=j;l++){
		    mat[i][j] += num[k][l];
		}
	    }
	}
    }
    long ans = -10000000001;
    for(int i=1;i<num.length;i++){
	for(int j=1;j<num[i].length;j++){
	    for(int k=0;k<i;k++){
		for(int l=0;l<j;l++){
		    ans = max(ans,mat[i][j] - mat[i][l] - mat[k][j] + mat[k][l]);
		}
	    }
	}
    }

    writeln(ans);
}

Measured memory_bytes: 2948
#include<vector>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<string>
#include<map>
#include<queue>
#include<algorithm>
#include<ctime>
#include<cmath>
#include<cstdlib>
#define lson (o<<1)
#define rson (o<<1|1)
#define fi first
#define sc second
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define rg register
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
using namespace std;
const double pi=acos(-1);
const double eps=1e-6;
inline int lowbit(int x){return x&(-x);}

template<typename A,typename B,typename C> inline A fpow(A x,B p,C yql){
	A ans=1;
	for(;p;p>>=1,x=1LL*x*x%yql)if(p&1)ans=1LL*x*ans%yql;
	return ans;
}


inline int read()
{
    int X=0,w=1;
    char c=getchar();
    while(c<'0'||c>'9')
    {
        if (c=='-')
        {
            w=-1;
        }
        c=getchar();
    }
    while(c>='0'&&c<='9')
    {
        X=(X<<3)+(X<<1)+(c^48);
        c=getchar();
    }
    return X*w;
}
//inline void w(int x) { if(x>9) w(x/10); putchar(x%10+'0'); }

ll T,N;

void solve(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b<<endl;
}


int main(){
	std::ios::sync_with_stdio(0);
	std::cin.tie(0);
	T=1;
	//cin>>T;
	while(T--){
		solve();
	}
	return 0;
}








Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    private final static String YES = "Yes";
    private final static String NO = "No";

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

        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();

        int[] array = { a, b, c };

        for (int i : array) {
            if (0 > i && i > 100) {
                System.exit(0);
            }
        }

        if (a < b && a < c) {
            System.out.println(b < c ? YES : NO);
        } else if (a < c && b < c) {
            System.out.println(a < b ? YES : NO);
        } else {
            System.out.println(NO);
        }

    }
}



Measured memory_bytes: 26276
n ,m = map(int,input().split())

grid = []

for i in range(n):
  temp = list(input())
  grid.append(temp)
  
#dp[n][m]
mod = 10**9+7
dp = [[0 for i in range(m)] for j in range(n)]
dp[0][0] = 1

for i in range(n):
  for j in range(m):
    if grid[i][j]=='#':
      continue
    if i>0:
      dp[i][j] += dp[i-1][j]%mod
    if j>0:
      dp[i][j] +=dp[i][j-1]%mod
      
print(dp[n-1][m-1]%mod)

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

struct edge {
  int cost, time;
};

int main() {
  int n, t; cin >> n >> t;
  vector<edge> G(n);
  for (auto &v : G) cin >> v.cost >> v.time;
  const int INFTY = 1e9;
  int cost = INFTY;
  for (auto &v : G) {
    if (v.time <= t) {
      cost = min(cost, v.cost);
    }
  }
  if (cost == INFTY) cout << "TLE\n";
  else cout << cost << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
 
int N, M, C;
const int MAX_NM = 20;
int B[MAX_NM], A[MAX_NM][MAX_NM];

int main() {
    cin >> N >> M >> C;
    for (int i = 0; i < M; i++) cin >> B[i];
    for (int i = 0; i < N; i++){
        for (int j = 0; j < M; j++) {
            cin >> A[i][j];
        }
    }

    int ans = 0;
    for (int i = 0; i < N; i++){
        int isCollect = C;
        for (int j = 0; j < M; j++){
            isCollect += A[i][j] * B[j];
        }
        if (isCollect > 0) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

#include <x86intrin.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;

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

#define mp make_pair
#define in insert
#define er erase
#define con continue
#define pb push_back
#define sc scanf
#define pr printf
#define ub upper_bound
#define lb lower_bound
#define s second
#define f first
#define int long long

const long long infl = 1e18; 
const int N = 3e5 + 300, N2 = 2e3, inf = infl;

set <pair <int, int> > S;
vector <pair <int, int> > g[N];
int n, m, k;
int a[N], d[N];
string ss;

main (){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	for (int i = 2; i <= n; i++){
		g[i].pb(mp(i - 1, 0));
		d[i] = inf;
	}
	for (int i = 0; i < m; i++){
		int x, y, z;
		cin >> x >> y >> z;
		g[x].pb(mp(y, z));
		g[y].pb(mp(x, z));
	}
	S.in(mp(0, 1));
	while(S.size()){
		int v = S.begin() -> s;
		//cout << v << endl;
		S.er(S.begin());
		for (auto i: g[v]){
			int to = i.f;
			int w = i.s;
			if(d[to] > d[v] + w){
				S.er({d[to], to});
				d[to] = d[v] + w;
				S.in({d[to], to});
			}
		}
	}
	if (d[n] >= inf) cout << -1;
	else cout << d[n];
	return 0;
}












Measured memory_bytes: 18304
#include<cstdio>
#include<queue>
using namespace std;
#define MAXN 100
int Map[5][MAXN+5];
int Get[5][MAXN+5];
struct node{
	int x,y,get;
};
queue <node> que;
int main(){
	int n;
	scanf("%d",&n);
	for(int j=1;j<=2;j++)
		for(int i=1;i<=n;i++)
			scanf("%d",&Map[j][i]);
	Get[1][1]=-1;
	node q;q.x=1;q.y=1;q.get=Map[1][1];
	que.push(q);
	int next[2][2]={{1,0},{0,1}};
	while(!que.empty()){
		node p=que.front();
		que.pop();
		for(int i=0;i<=1;i++){
			q=p;
			q.x+=next[i][0];
			q.y+=next[i][1];
			q.get+=Map[q.x][q.y];
			if(Get[q.x][q.y]==0) Get[q.x][q.y]=q.get-1;
			if(q.x>2||q.x<1||q.y>n||q.y<1||Get[q.x][q.y]>=q.get) continue;
			Get[q.x][q.y]=max(Get[q.x][q.y],q.get);
			que.push(q);
		} 
	}
	printf("%d",Get[2][n]);
	return 0;
} 

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int d,t,s;

int main(){
	cin>>d>>t>>s;
	cout<<(d<=t*s?"Yes":"No")<<endl;
}

Measured memory_bytes: 3684
import java.util.Scanner;

public class Main {

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

        int n = sc.nextInt();

        for (int i=0; i<50000; i++) {
            int p = (int)(i * 1.08);
            if (p == n) {
                System.out.println(i);
                return;
            }
        }
        System.out.println(":(");
    }
}

Measured memory_bytes: 22608
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

#define lpsbd(i, s, b, d) for(size_t i = s; i < b; i+=d)
#define lpsb(i, s, b) for(size_t i = s; i < b; i++)
#define lpn(i, n) for(size_t i = 0; i < n; i++)
#define fa(i, x) for(auto &i: x)
#define vcd(t, n, d) vector<t>(n, d)
#define vc(t, n) vector<t>(n)

using namespace std;
using ull = unsigned long long;

const ull MOD = 1000000007;

int main(void)
{
    int N, L;
    cin >> N >> L;
    int temp = 10000;
    lpn(i, N) temp = (abs(L + int(i)) < abs(temp) ? L + int(i) : temp);
    cout << (L * N + N * (N - 1) / 2 - temp) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<algorithm>

int sum[202];
int card[202][3];

int main() {
	memset(sum, 0, sizeof(sum));
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < 3; ++j) {
			scanf("%d", &card[i][j]);
		}
	}
	for (int i = 0; i < 3; ++i) {
		for (int j = 0; j < n; ++j) {
			bool flg = true;
			for (int j2 = 0; j2 < n; ++j2) {
				if (j == j2) { continue; }
				if (card[j][i] == card[j2][i]) {
					flg = false;
					break;
				}
			}
			if (flg) { sum[j] += card[j][i]; }
		}
	}

	for (int i = 0; i < n; ++i) {
		printf("%d\n", sum[i]);
	}

	return 0;
}

Measured memory_bytes: 2740
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int N;
string s;

char c[2] = {'S','W'};

char rev(char cc){
    if(cc=='S') return 'W';
    else return 'S';
}

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

    rep(a,2) rep(b,2){
        vector<char> t(N,0);
        t[0] = c[a];
        t[1] = c[b];

        for(int i=1;i<N;i++){
            int l=(i-1+N)%N;
            int r=(i+1+N)%N;
            if(t[i]=='S'){
                if(s[i]=='o') t[r] = t[l];
                else t[r] = rev(t[l]);
            }else{
                if(s[i]=='o') t[r] = rev(t[l]);
                else t[r] = t[l];
            }
        }
        bool f=false;
        if(t[0] == c[a]){
            if(t[0] == 'S'){
                if(s[0]=='o' and t[N-1]==t[1]) f=true;
                else if(s[0]=='x' and t[N-1]!=t[1]) f=true;
            }else{
                if(s[0]=='o' and t[N-1]!=t[1]) f=true;
                else if(s[0]=='x' and t[N-1]==t[1]) f=true;
            }
        }

        if(f){
            rep(i,N) cout << t[i];
            cout << endl;
            return 0;
        }
    }

    cout << -1 << endl;
}


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

int a, b, k;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> a >> b >> k;
	int c = 0;
	for(int i=min(a, b); i>=1; --i){
		if(a % i == 0 && b % i == 0){
			++c;
//			cout << i << " " << c << "\n";
			if(c == k){
				cout << i << "\n";
				return 0;
			}
		}
	}
}

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

using namespace std;

int N, M;
string A, B;

int gcd(int x, int y){
    return y==0? x:gcd(y, x%y);
}

int main(){
    ios_base::sync_with_stdio(false);
    cin >> N >> M >> A >> B;
    int val = gcd(N, M);
    for(int i=0;i<val;++i) if(A[N/val*i]!=B[M/val*i]){
        puts("-1"); return 0;
    }
    printf("%lld", (long long)N*M/val);
    return 0;
}


Measured memory_bytes: 640
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
 
using namespace __gnu_pbds;
using namespace std;

#define double      	long double
#define int         	long long
#define pb          	push_back
#define pii         	pair<int,int>
#define vi          	vector<int>
#define vii         	vector<pii>
#define mi          	map<int,int>
#define mii         	map<pii,int>
#define all(a)      	(a).begin(),(a).end()
#define sz(x)       	(int)x.size()
#define endl        	"\n"
#define repp(i,a,b) 	for(int i=a;i<b;i++)
#define rep(i,a,b) 		for(int i=a;i<=b;i++)
#define brep(i,a,b)     for(int i=a;i>=b;i--)
#define deb1(x)      	cout << #x << "=" << x << endl
#define deb2(x, y)  	cout << #x << "=" << x << "," << #y << "=" << y << endl
#define deb3(x, y, z)  	cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define trace(v) 		for(auto it=v.begin();it!=v.end();it++)cout<<*it<<" ";cout<<endl;
#define tracearr(a,l,r) for(int iii=l;iii<=r;iii++)cout << a[iii] << " ";cout << endl;
#define PI          	3.1415926535897932384626
#define F 				first
#define S 				second
#define clr(x,y) 		memset(x, y, sizeof(x))
#define IOS         	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);


typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
// *s.find_by_order(1) - gives the 2nd samllest element in set
// s.order_of_key(x)   - gives the number of elements in the set which are strictly smaller than x


const int N=1e5 + 5;
const int MOD=1e9 + 7;

char a[8][8];
int n,m,k;
int ans = 0;
int yo = 0;

void printArray(vector<int> arr) 
{ 
    yo++;
	vi vr;
    vi vc;
    //deb1(yo);
    char b[8][8];
    rep(i,1,n)
    {
    	rep(j,1,m)
    		b[i][j] = a[i][j];
	}
    for(int x:arr)
    {
    	if(x<=n)
    		vr.pb(x);
    	else
    		vc.pb(x - n);
	}
	for(int x: vr)
	{
		for(int i=1;i<=m;i++)
		{
 			b[x][i] = 'X';
		}
	}
	for(int x: vc)
	{
		for(int i=1;i<=n;i++)
		{
 			b[i][x] = 'X';
		}
	}
	int cur = 0;
	rep(i,1,n)
	{
		rep(j,1,m)
		{
			if(b[i][j]=='#')
				cur++;
		}
	}
	if(cur==k)
		ans++;
} 

void printSubsequences(vector<int> arr, int index,  
                       vector<int> subarr) 
{ 
    if (index == arr.size()) 
    { 
        int l = subarr.size(); 
        printArray(subarr); 
    } 
    else
    { 
        printSubsequences(arr, index + 1, subarr); 
  
        subarr.push_back(arr[index]); 
  
        printSubsequences(arr, index + 1, subarr); 
    } 
    return; 
} 

int32_t main()
{
	//IOS;
	int T=1;
	//cin >> T;
	// int numOfSetBits = __builtin_popcountll(n);
	std::cout << std::fixed << std::setprecision(12);
	while(T--)
	{
		cin >> n >> m >> k;
		rep(i,1,n)
		{
			rep(j,1,m)
				cin >> a[i][j];
		}
		vi arr;
		rep(i,1,n)
		{
			arr.pb(i);
		}
		rep(i,1,m)
		{
			arr.pb(n+i);
		}
	    vector<int> b; 
	  
	    printSubsequences(arr, 0, b); 
	  	//deb1(yo);
	    cout << ans << endl;
	}
}



Measured memory_bytes: 3608
#include<bits//stdc++.h>
using namespace std;
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
typedef long long int ll;
ll  ans = 0, h = 1, now = 0;
int main() {
    string s; cin >> s;
    vector<int> as(2020, 0); as[0]++;
    rrep(i, s.size()) {
        now = (now + (s[i] - '0') * h) % 2019;
        h = h * 10 % 2019;
        ans += as[now];
        as[now]++;
    }cout << ans << endl;
}


Measured memory_bytes: 3716
/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/+---test
2 3
---+/

void main(string[] args) {
  long A, B;
  readf(" %d %d ", &A, &B);

  (A*B/gcd(A, B)).writeln;
}


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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
void tostr(ll x,string& res){while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return;}
template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; }
template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; }
//end

template<unsigned mod=998244353>struct mint {
   unsigned val;
   static unsigned get_mod(){return mod;}
   unsigned inv() const{
      int tmp,a=val,b=mod,x=1,y=0;
      while(b)tmp=a/b,a-=tmp*b,swap(a,b),x-=tmp*y,swap(x,y);
      if(x<0)x+=mod; return x;
   }
   mint():val(0){}
   mint(ll x):val(x>=0?x%mod:mod+(x%mod)){}
   mint pow(ll t){mint res=1,b=*this; while(t){if(t&1)res*=b;b*=b;t>>=1;}return res;}
   mint& operator+=(const mint& x){if((val+=x.val)>=mod)val-=mod;return *this;}
   mint& operator-=(const mint& x){if((val+=mod-x.val)>=mod)val-=mod; return *this;}
   mint& operator*=(const mint& x){val=ll(val)*x.val%mod; return *this;}
   mint& operator/=(const mint& x){val=ll(val)*x.inv()%mod; return *this;}
   mint operator+(const mint& x)const{return mint(*this)+=x;}
   mint operator-(const mint& x)const{return mint(*this)-=x;}
   mint operator*(const mint& x)const{return mint(*this)*=x;}
   mint operator/(const mint& x)const{return mint(*this)/=x;}
   bool operator==(const mint& x)const{return val==x.val;}
   bool operator!=(const mint& x)const{return val!=x.val;}
};
template<unsigned mod=998244353>struct factorial {
   using Mint=mint<mod>;
   vector<Mint> Fact, Finv;
public:
   factorial(int maxx){
      Fact.resize(maxx+1),Finv.resize(maxx+1); Fact[0]=Mint(1); rep(i,0,maxx)Fact[i+1]=Fact[i]*(i+1);
      Finv[maxx]=Mint(1)/Fact[maxx]; rrep(i,maxx,0)Finv[i-1]=Finv[i]*i;
   }
   Mint fact(int n,bool inv=0){if(inv)return Finv[n];else return Fact[n];}
   Mint nPr(int n,int r){if(n<0||n<r||r<0)return Mint(0);else return Fact[n]*Finv[n-r];}
   Mint nCr(int n,int r){if(n<0||n<r||r<0)return Mint(0);else return Fact[n]*Finv[r]*Finv[n-r];}
};
using Mint=mint<>;

factorial<> fact(2010000);

// sum<=3M && max<=2M && #odd<=M
Mint solve(int n,int sum,int odd){
   chmin(odd,n); Mint res;
   rep(k,0,odd+1)if(sum>=k&&((sum-k)%2==0)){
      res+=fact.nCr((sum-k)/2+n-1,n-1)*fact.nCr(n,k);
   } return res;
}

int main(){
   int n,m; scanf("%d%d",&n,&m);
   Mint res=solve(n,3*m,m)-(solve(n,m,m)-solve(n-1,m,m))*n;
   printf("%d\n",res.val);
   return 0;
}

Measured memory_bytes: 16000
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>
#include <utility>


using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// const ll INF = 1LL <<60;
// const int INF = 10000;

//最大公約数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


//階乗
ll kaijo(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum *= i;
        sum%=1000000000+7;
    }
    return sum;
}

//for(int i = ; i < ; i++){}

ll lmax(ll s,ll t){
  if(s>t){
    return s;
  }
  else{
    return t;
  }
}

ll lmin(ll s,ll t){
  if(s<t){
    return s;
  }
  else{
    return t;
  }
}

long long modpow(long long res,long long a, long long n, long long mod) {
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
// ここから開始
int main(){
  string s;
  cin>>s;
  for(int i = 0; i < s.length(); i++){
    cout<<s[i];
    if(i==3) cout<<' ';
  }
  cout<<endl;
  return 0;
}



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

const int MAXN = 100010;
int h[MAXN], dp[MAXN];
int main() {
	int n, k;
	cin>>n>>k;
	for (int i=0; i<n; i++)
		cin>>h[i];
	memset(dp, 0xff, sizeof(dp));
	dp[0] = 0;
	for (int i=0; i<n; i++)
		for (int j=1; j<=k; j++)
			if (dp[i+j] == -1 || dp[i+j] > dp[i] + abs(h[i] - h[i+j]))
				dp[i+j] = dp[i] + abs(h[i] - h[i+j]);
	cout<<dp[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
#define Max(a) (*max_element(ALL(a)))
#define Min(a) (*min_element(ALL(a)))
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  map<string,ll>cnt;
  for(int i=0;i<n;i++){
    string s;cin>>s;
    cnt[s]++;
  }
  cout<<"AC x "<<cnt["AC"]<<endl;
   cout<<"WA x "<<cnt["WA"]<<endl;
   cout<<"TLE x "<<cnt["TLE"]<<endl;
   cout<<"RE x "<<cnt["RE"]<<endl; 
  return 0;
}


Measured memory_bytes: 3668
fun main(args: Array<String>) = IO().exec {
    val n = int()
    val a = LongArray(n){long()}
    var s = 0.0
    for (b in a) s += 1.0 / b
    println(1.0 / s)
}

// region template
operator fun Int.iterator() = 0.until(this).iterator()

class IO {
    val printable = 33..126
    val buffer = ByteArray(1024)
    var ptr = 0
    var buflen = 0
    val out = java.io.PrintWriter(System.out)
    fun hasNextByte(): Boolean = if (ptr < buflen) true else {
        ptr = 0
        buflen = System.`in`.read(buffer)
        buflen > 0
    }

    fun readByte(): Byte = if (hasNextByte()) buffer[ptr++] else -1
    fun hasNext(): Boolean {
        while (hasNextByte() && buffer[ptr] !in printable) ptr++
        return hasNextByte()
    }

    fun string(): String {
        if (!hasNext()) throw java.util.NoSuchElementException()
        val sb = StringBuilder()
        var b = readByte()
        while (b in printable) {
            sb.appendCodePoint(b.toInt())
            b = readByte()
        }
        return sb.toString()
    }

    fun long(): Long {
        if (!hasNext()) throw java.util.NoSuchElementException()
        var n = 0L
        var minus = false
        var b = readByte()
        if (b == '-'.toByte()) {
            minus = true
            b = readByte()
        }
        if (b !in '0'.toByte()..'9'.toByte()) {
            throw NumberFormatException()
        }
        while (true) {
            if (b in '0'.toByte()..'9'.toByte()) {
                n *= 10
                n += b - '0'.toByte()
            } else if (b == (-1).toByte() || b !in printable) {
                return if (minus) -n else n
            } else {
                throw NumberFormatException()
            }
            b = readByte()
        }
    }

    fun int(): Int {
        val nl = long()
        if (nl !in Integer.MIN_VALUE..Integer.MAX_VALUE) throw NumberFormatException()
        return nl.toInt()
    }

    fun double(): Double = string().toDouble()
    fun print(obj: Any) = out.print(obj)
    fun print(i: Int) = out.print(i)
    fun print(l: Long) = out.print(l)
    fun println(obj: Any) = out.println(obj)
    fun println(i: Int) = out.println(i)
    fun println(l: Long) = out.println(l)
    inline fun exec(block: IO.() -> Unit) {
        block()
        out.flush()
    }
}
// endregion

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

int main() {
    long long A, B, C, K, ans = 0;
    cin >> A >> B >> C >> K;
    if(K <= A) {
        ans = K;
    } else if(K <= A+B) {
        ans = A;
    } else {
        ans = A - (K - (A+B));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
/* C - management */

#include <stdio.h>
#include <stdlib.h>

int main(void){
  int N, i, A, *ans;
  scanf("%d", &N);
  ans = (int*)malloc(sizeof(int) * N);
  for(i = 0; i < N; i++){
    ans[i] = 0;
  }
  for(i = 2; i <= N; i++){
    scanf("%d", &A);
    ans[A - 1] += 1;
  }
  for(i = 0; i < N; i++){
    printf("%d\n", ans[i]);
  }

  return 0;
}


Measured memory_bytes: 2496
import sys
input = sys.stdin.buffer.readline


n = int(input())
res = 0
for i in range(n):
    res += (i+1)*(n-i)


for i in range(n-1):
    u,v = map(int,input().split())
    if u > v:
        u,v = v,u
    res -= u*(n-v+1)
print(res)

Measured memory_bytes: 79676
s = input()
ns = s.replace('x', '')
if s == s[::-1]:
    print(0)
elif ns != ns[::-1]:
    print(-1)
else:
    cnt = 0
    i = 0
    j = len(s)-1
    while(i<j):
        if s[i]=='x' and s[j]!='x':
            cnt += 1
            j += 1
        elif s[i]!='x' and s[j]=='x':
            cnt += 1
            i -= 1
        i += 1
        j -= 1
    print(cnt)
    


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define whlie while
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repr(i,N) for(auto i = (N) - 1; i >= 0; i -= 1)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define vrep(v,it) for(auto it = v.begin(); it != v.end(); it++)
#define vrepr(v,it) for(auto it = v.rbegin(); it!= v.rend(); it++)
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) ll __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define rand mtrand
#ifdef NyaanDebug
  #include "NyaanDebug.h"
  #define trc(...) do { cout << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
  #define trca(v,...) do { cout << #v << " = "; array_out(v , ##__VA_ARGS__);cout << endl;} while(0)
#else
  #define trc(...)
  #define trca(...)
#endif
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector< vector<int> >;
constexpr int inf = 1001001001;
constexpr ll infLL = 0x1FFFFFFFFFFFFFFFLL;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}

random_device seed_gen; mt19937_64 mtrand(seed_gen());
#define MOD 1000000007
//////////////////////////////////////////

int main(){
  ini(a,b);
  out(a+b==15 ? "+" : a*b==15 ? "*" : "x");
}

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

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

using ll = long long;

void solve()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    map<ll, ll> mp;
    ll ans = 0;
    REP(i, n)
    {
        cin >> a[i];
        ans += mp[i - a[i]];
        mp[i + a[i]] += 1;
    }
    cout << ans << endl;
}

signed main()
{
    solve();
}

Measured memory_bytes: 27304