akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for(int i=a;i<b;i++)

typedef tuple<int,int,int> tiii;

bool comp(tiii a, tiii b)
{
	int sa = get<0>(a)*get<1>(a);
	int sb = get<0>(b)*get<1>(b);

	if (get<2>(a) != get<2>(b))
		return get<2>(a) < get<2>(b);
	else
		return sa < sb;
}

bool comp2(tiii a, tiii b)
{
	int sa = get<0>(a)*get<1>(a);
	int sb = get<0>(b)*get<1>(b);

	return sa < sb;
}

int main()
{
	while (1)
	{
		int n, w, d;
		cin >> n >> w >> d;
		if (n == 0 && w == 0) return 0;

		vector<tiii> blocks(n + 1, make_tuple(1000, 1000, 1000));
		blocks[0] = make_tuple(w, d, 0);
		rep(i, 1, n+1)
		{
			int p, s;
			cin >> p >> s;
			p--;

			int ww = get<0>(blocks[p]);
			int dd = get<1>(blocks[p]);

			while (1)
			{
				if (s < ww)
				{
					blocks[p] = make_tuple(ww - s, dd, i);
					blocks[i] = make_tuple(s, dd, i);
					break;
				}

				s -= ww;

				if (s < dd)
				{
					blocks[p] = make_tuple(ww, dd - s, i);
					blocks[i] = make_tuple(ww, s, i);
					break;
				}

				s -= dd;
			}

			sort(blocks.begin(), blocks.end(), comp);
		}

		sort(blocks.begin(), blocks.end(), comp2);

		cout << get<0>(blocks[0])*get<1>(blocks[0]);
		rep(i, 1, n + 1)
			cout << " " << get<0>(blocks[i])*get<1>(blocks[i]);
		cout << endl;
	}
}

Measured memory_bytes: 3040
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A = INT()
B = INT()

if (A + B) == 3:
	print(3)
if (A + B) == 4:
	print(2)
if (A + B) == 5:
	print(1)

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

using namespace std;
typedef long long int ll;
typedef pair<ll, ll > pi;  
typedef pair<pair<ll, ll >, ll > pii;  
vector<ll > vec;
vector<vector<ll > > vec2;
ll MOD = 1000000007;
ll INF = 1145141919454519;

int main() {

    string A, B, C;

    cin >> A >> B >> C;

    cout << A[0] << B[0] << C[0] << endl;

}

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

int main() {
    while (true) {
        int a, b;
        char op;
        cin >> a >> op >> b;

        if (op == '+') {
            cout << a + b << endl;
        } else if (op == '-') {
            cout << a - b << endl;
        } else if (op == '*') {
            cout << a * b << endl;
        } else if (op == '/') {
            cout << a / b << endl;
        } else {
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 3084
import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))  # 計算誤差の関係で-1を2回かけてます
print(-sum(a))

Measured memory_bytes: 14252
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
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 int mod = 1000000007;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

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


struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
  mint p(int n,int k) {
      return fact[n]*ifact[n-k];
  }
};
int main() {
    int n,m;
    cin >> n >> m;
    mint ans(0);
    combination comb(510000);
    for(int k = 1;k<=n;k++) {
        if(k%2==1) ans += comb(n,k)*comb.p(m-k,n-k);
        else ans -= comb(n,k)*comb.p(m-k,n-k);
    }  
    ans *= comb.p(m,n);
    mint sum = comb.p(m,n).pow(2);
    
    cout << sum - ans << endl;
}

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

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

string S;

int main(){
    cin >> S;

    string ans = "Good";
    for(int i=0;i<S.size()-1;i++){
        if(S[i] == S[i+1])  ans = "Bad";
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
const ld EPS = 1e-10;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

int main(){
    int A, B;
    cin >> A >> B;
    cout << A*B << endl;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <climits>
#include <map>
using namespace std;

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

int main() {
	vector<int>a(3);
	for (int i = 0; i < 3; i++)cin >> a.at(i);
	sort(a.begin(), a.end());
	if (a.at(2) == a.at(0) + a.at(1)) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.Arrays;
public class Main{
    
    
    public static void main(String[] args){
       Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int ans = c-a+b;
        if(ans<=0){
            ans = 0;
            System.out.println(ans);
        }
        else{
            System.out.println(ans);
        }


        
        
    }
   
    
       
    
}

Measured memory_bytes: 23124
n=input()
size=len(n)
#print(n,size)

ans=0
for i in range(2**(size-1)):
    z=format(i,'b').zfill(size-1)
#    print(z)
    string=n[0]
    for j in range(size-1):
        if z[j]=='1':
            string+='0'+n[j+1]
        elif z[j]=='0':
            string+=n[j+1]
    string=string.replace('0','+')
    ans+=eval(string)

print(ans)

#12656242944

Measured memory_bytes: 3064
#include<stdio.h>

int main(){
	int c[4]={0,0,0,0};
	for(int i=0;i<6;i++){
		int d;
		scanf("%d",&d);
		c[d-1]++;
	}
	if(c[0]*c[1]*c[2]*c[3]==4)printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 128
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, D: int):
    print(max(A * B, C * D))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(A, B, C, D)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<sstream>
enum direction
{
	L, R, U, D
};
int main()
{
	int wall[9][5];
	for (int i = 0; i < 9; i++)
	{
		std::string foo;
		std::cin >> foo;
		std::stringstream bar(foo);
		for (int j = 0;; j++)
		{
			char baz;
			bar >> baz;
			wall[i][j] = static_cast<int>(baz - '0');
			if (i % 2 == 0 && j == 3 || j == 4)
			{
				break;
			}
		}
	}
	direction dir = R;
	std::cout << 'R';
	int crd[2] = { 0,0 };
	while (true)
	{
		switch (dir)
		{
		case L:
			if (crd[1] != 8 && wall[crd[1] + 1][crd[0]] == 1)
			{
				crd[1]++;
				dir = D;
				std::cout << 'D';
			}
			else if (crd[0] == 0 || wall[crd[1]][crd[0] - 1] == 0)
			{
				if (wall[crd[1] - 1][crd[0]] == 0)
				{
					dir = R;
					std::cout << 'R';
				}
				else
				{
					crd[1]--;
					dir = U;
					std::cout << 'U';
				}
			}
			else
			{
				crd[0]--;
				std::cout << 'L';
			}
			break;
		case R:
			if (crd[1] != 0 && wall[crd[1] - 1][crd[0] + 1] == 1)
			{
				crd[0]++;
				crd[1]--;
				dir = U;
				std::cout << 'U';
			}
			else if (crd[0] == 3 || wall[crd[1]][crd[0] + 1] == 0)
			{
				if (wall[crd[1] + 1][crd[0] + 1] == 0)
				{
					dir = L;
					std::cout << 'L';
				}
				else
				{
					crd[0]++;
					crd[1]++;
					dir = D;
					std::cout << 'D';
				}
			}
			else
			{
				crd[0]++;
				std::cout << 'R';
			}
			break;
		case U:
			if (crd[0] != 0 && wall[crd[1] - 1][crd[0] - 1] == 1)
			{
				crd[0]--;
				crd[1]--;
				dir = L;
				std::cout << 'L';
			}
			else if (crd[1] == 1 || wall[crd[1] - 2][crd[0]] == 0)
			{
				if (wall[crd[1] - 1][crd[0]] == 0)
				{
					dir = D;
					std::cout << 'D';
				}
				else
				{
					crd[1]--;
					dir = R;
					std::cout << 'R';
				}
			}
			else
			{
				crd[1] -= 2;
				std::cout << 'U';
			}
			break;
		case D:
			if (crd[0] != 4 && wall[crd[1] + 1][crd[0]] == 1)
			{
				crd[1]++;
				dir = R;
				std::cout << 'R';
			}
			else if (crd[1] == 7 || wall[crd[1] + 2][crd[0]] == 0)
			{
				if (wall[crd[1] + 1][crd[0] - 1] == 0)
				{
					dir = U;
					std::cout << 'U';
				}
				else
				{
					crd[0]--;
					crd[1]++;
					dir = L;
					std::cout << 'L';
				}
			}
			else
			{
				crd[1] += 2;
				std::cout << 'D';
			}
			break;
		}
		if (crd[0] == 0 && (crd[1] == 0 || crd[1] == 1))
		{
			std::cout << std::endl;
			break;
		}
	}
	return 0;
}


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

int main(){
  char a;
  cin >> a;
  if(a=='A'){
    cout << 'T' << endl;
  }else if(a=='C'){
    cout << 'G' << endl;
  }else if(a=='G'){
cout << 'C' << endl;
  }else if(a=='T'){
    cout << 'A' << endl;
  }
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0;i < n;i++){
        cin >> a[i];
        if(a[i] % 2 == 0 && !(a[i] % 3 == 0 || a[i] % 5 == 0)){
            cout << "DENIED" << endl;
            return 0;
        }
    }
    cout << "APPROVED" << endl;
}


Measured memory_bytes: 256
import sys
f = sys.stdin

def bomb(board, x, y):
    if x < 0 or y < 0 or len(board) <= x or len(board) <= y:
        return
    if board[y][x] == '0':
        return
    board[y] = board[y][:x] + '0' + board[y][x + 1:]
    for dx, dy in [[0, -3],[0, -2],[0, -1],[3, 0],[2, 0],[1, 0],[0, 3],[0, 2],[0, 1],[-3, 0],[-2, 0],[-1, 0]]:
        bomb(board, x + dx, y + dy)
    

n = int(f.readline())
for i in range(n):
    f.readline() #空行
    board = [f.readline().strip() for _ in range(8)]
    x, y = map(int, [f.readline() for _ in range(2)])
    
    bomb(board, x - 1, y - 1)
    
    print('Data {}:'.format(i + 1))
    for line in board:
        print(line)

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

// repetition
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

// const value
// const ll MOD = 1e9 + 7;
// const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
// const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

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

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll x;
  cin >> x;
  ll ans = 0;

  ans += (x / 500) * 1000;
  x %= 500;
  ans += (x / 5) * 5;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define rep(i, a, n) for(int i=a; i<n; i++)
#define ll long long
#define all(x) begin(x), end(x)
#define toInt(x) (x - '0')
#define pll pair<ll, ll>
#define pli pair<ll, int>

const long long INF = 1LL<<60;
const int inf = 1 << 30;
const int mod = 1e9+7;


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

long long f(long long a, long long b, long long x){
  return ((a * x) / b) - a * (x / b);
}

int main(){
  long long x;
  cin >> x;

  int ans = 0;
  long long  now = 100;
  while(now < x){
    now *= 1.01;
    now = floor(now);
    ans++;
  }
  cout << ans << endl;
}



Measured memory_bytes: 3632
a = [-1, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[int(input())])

Measured memory_bytes: 9028
import java.util.Scanner;




public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int N=sc.nextInt();
    	int X=sc.nextInt();

    	int[] M=new int[N];

    	int sum=0;

    	int min=9999;
    	for(int i=0;i<N;i++) {
    		int buf=sc.nextInt();

    		M[i]=buf;

    		sum+=buf;

    		if(min>buf) {
    			min=buf;
    		}

    	}

    	X-=sum;

    	int result=N+X/min;

    	System.out.println(result);
    }



}



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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

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

template<typename T>
constexpr T inf = static_cast<T>(pow(10, static_cast<int>(log10(numeric_limits<T>::max())))) + 7;
constexpr llong mod = 1e9+7;

int main() {
  llong X;
  cin >> X;

  cout << (X/500*1000) + (X%500/5*5) << endl;

  return 0;
}

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

using namespace std;
int main()
{
	char s[10];
	cin>>s;
	if(s[0]=='S')
	{ printf("Cloudy\n");
    
	}
    else if(s[0]=='C')
	{printf("Rainy\n");
    
	}
    else 
    {printf("Sunny\n");
    
	}
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
    string s;
    cin >> s;
    for(int i =0; i < s.length(); i++){
        if(i%2 == 0){
            cout << s[i];
        }
    }
    return 0;
}

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

using namespace std;

typedef unsigned long long ULL;

ULL n;
ULL r = 1;

int main() {
    scanf("%llu", &n);
    while(n) {
        r *= 2;
        n /= 2;
    }
    printf("%llu", r - 1);
    return 0;
}


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

using namespace std;

typedef long long LL;

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

    vector<int> a[200001];
    for (int i = 0; i < m; i++) {
        int tmpa, tmpb;
        cin >> tmpa >> tmpb;
        a[tmpa - 1].push_back(tmpb - 1);
        a[tmpb - 1].push_back(tmpa - 1);
    }

    stack<int> s;
    vector<bool> v(n, false);
    v[0] = true;
    s.push(0);
    while (!s.empty()) {
        int c = s.top();
        s.pop();

        for (int i = 0; i < a[c].size(); i++) {
            if (a[c][i] == n - 1) {
                cout << "POSSIBLE" << endl;
                return 0;
            }
            if (!v[a[c][i]] && c == 0) {
                v[a[c][i]] = true;
                s.push(a[c][i]);
            }
        }
    }

    cout << "IMPOSSIBLE" << endl;

    return 0;
}


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

using namespace std;

void solve()
{
	int N, sum = 0;
	cin >> N;

	vector<int> ls(N);

	for (int i = 0; i < N; i++)
	{
		cin >> ls[i];
		sum += ls[i];
	}

	sort(ls.begin(), ls.end());

	cout << (ls.back()*2 < sum ? "Yes" : "No") << endl;

}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


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

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

using namespace std;


int main() {
    int h,w; cin >> h >> w;
    char s[51][51];
    int f = true;
    int fb = false;

    rep(i,h){
        rep(j,w){
            cin >> s[i][j];
        }
    }

    rep(i,h){
        rep(j,w){
            fb = false;
            if(s[i][j] == '#') {
                if (i != 0 && s[i - 1][j] == '#') fb = true;
                if (i != h - 1 && s[i + 1][j] == '#') fb = true;
                if (j != 0 && s[i][j - 1] == '#') fb = true;
                if (j != w - 1 && s[i][j + 1] == '#') fb = true;

                if (!fb) {
                    f = false;
                    break;
                }
            }
        }
    }

    cout << ((f)?"Yes":"No");
    return 0;
}











Measured memory_bytes: 3640
#include<stdio.h>

int main(void)
{

  int n,a,b,c,d;
  scanf("%d",&n);
  a=n/1000;
  b=(n-1000*a)/100;
  c=(n-1000*a-100*b)/10;
  d=n-1000*a-100*b-10*c;
  if( ((a==b)&&((b==c)) || ((b==c)&&(c==d)) ))
    printf("Yes\n");
  else
    printf("No\n");
  
  return 0;
}



Measured memory_bytes: 128
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto ABC = RDR.ARR;
	ABC.sort();
	auto ab = ABC[0] * ABC[1];
	auto red = ab * (ABC[2]/2);
	auto blue = ab * (ABC[2]/2 + ABC[2]%2);
	
	writeln(blue - red);
	stdout.flush();
	debug readln();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
using vi=vector<int>;
using vl=vector<long long>;
using pii=pair<int,int>;
using pll=pair<long long,long long>;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##_len=(int)(n);i<i##_len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define REPW(i,n) for(i=0;i<(int)(n);++i)
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)   // c++14
#define SZ(c) ((int)c.size())
#define EXIST(c,x) (c.find(x)!=end(c))
#define OUTOFRANGE(y,x,h,w) (y<0||x<0||y>=h||x>=w)
#define dump(...)
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
#define INF (1001001001)
#define INFLL (1001001001001001001ll)
template<class T> ostream& operator << (ostream &os,const vector<T> &v) {
    ITR(i,v) os << *i << (i==end(v)-1 ? "" : " "); return os; }
template<class T> istream& operator >> (istream &is,vector<T> &v) {
    ITR(i,v) is >> * i; return is; }
template<class T> istream& operator >> (istream &is, pair<T,T> &p) {
        is >> p.first >> p.second; return is; }
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;}
//------------------------------------------------------------------------------
struct before_main_function {
    before_main_function() {
        #ifdef int
            #undef INF
            #define INF INFLL
            #define stoi stoll
        #endif
        cin.tie(0);ios::sync_with_stdio(false);
        cout<<setprecision(15)<<fixed;
    }
} before_main_function;
//------------------------------------------------------------------------------

const int MOD=1e9+7;
vi x,y;
signed main() {
    int n,m;
    cin>>n>>m;
    x=vi(n),y=vi(m);
    cin>>x>>y;
    int X=0,Y=0;
    REP(i,n) {
        X+=(i*x[i]-(n-i-1)*x[i])%MOD;
        X%=MOD;
    }
    REP(i,m) {
        Y+=(i*y[i]-(m-i-1)*y[i])%MOD;
        Y%=MOD;
    }
    cout<<(X*Y)%MOD<<endl;
    return 0;
}


Measured memory_bytes: 1792
nq = list(map(int, input().split()))
n = nq[0]
q = nq[1]
s = list(input())
l = []
r = []

for i in range(q):
    lr = list(map(int, input().split()))
    l.append(lr[0])
    r.append(lr[1])

hairetu = [0]
toukei = 0

for i in range(n - 1):
    if s[i] == "A" and s[i + 1] == "C":
        toukei = toukei + 1
    hairetu.append(toukei)

hairetu.append(toukei)

for i in range(q):
    if hairetu[l[i] - 1] != hairetu[l[i]]:
        print(hairetu[r[i] - 1] - hairetu[l[i]] + 1)
    else:
        print(hairetu[r[i] - 1] - hairetu[l[i]])


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

using namespace std;

int main(){
	int n,q;
	int S[100000];
	int T[50000];
	int cnt = 0;

	fill_n(S,100000,0);
	fill_n(T,50000,0);

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

	sort(S,S+n);

	for(int i = 0;i < q;i++){
		int left = 0;
		int right = n;
		int mid;
		int ave;
		while(left < right){
			ave = (left + right) / 2; 
			mid = S[ave];
			if(mid == T[i]){
				cnt++;
				break;
			}
			if(mid > T[i]){
				right = ave ;
			}
			if(mid < T[i]){
				left = ave +1;
			}
		}
	}
	cout << cnt << endl;
}

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

int main() {
	int a, b;
	cin >> a >> b;
	if( (a+b) % 2 == 0) {
		cout << (a+b)/2 << endl;
	}
	else {
		cout << (a+b)/2 + 1 << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#pragma O3
using namespace std;
struct node{
	int v,l,r;
};
struct no{
	int x,y,p;
};
struct cmp1{
	bool operator()(no a,no b){
		if(a.x!=b.x) return a.x<b.x;
		if(a.y!=b.y) return a.y<b.y;
		return a.p<b.p;
	}
};
struct cmp2{
	bool operator()(no a,no b){
		if(a.y!=b.y)return a.y<b.y;
		if(a.x!=b.x) return a.x<b.x;
		return a.p<b.p;
	}
};
struct cmppq{
	bool operator()(node a,node b){
		if(a.v!=b.v) return a.v>b.v;
		if(a.l!=b.l) return a.l>b.l;
		return a.r>b.r;
	}
};
vector<no> r;
priority_queue<node,vector<node>,cmppq> pq;
int par[100004];
int Find(int x){
	if(x!=par[x]) par[x]=Find(par[x]);
	return par[x];
}
void Union(int x,int y){
	int px=Find(x);
	int py=Find(y);
	if(px!=py) par[py]=px;
}
signed main(){
//	freopen(".inp","r",stdin);
//	freopen(".out","w",stdout);
//	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n,u,v,tmp,ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>u>>v;
		r.push_back({u,v,i});
		par[i]=i;
	}
	sort(r.begin(),r.end(),cmp1());
	for(int i=0;i<n-1;i++){
		tmp=min(abs(r[i].x-r[i+1].x),abs(r[i].y-r[i+1].y));
		pq.push({tmp,r[i].p,r[i+1].p});
	}
	sort(r.begin(),r.end(),cmp2());
	for(int i=0;i<n-1;i++){
		tmp=min(abs(r[i].x-r[i+1].x),abs(r[i].y-r[i+1].y));
		pq.push({tmp,r[i].p,r[i+1].p});
	}
	while(!pq.empty()){
		u=pq.top().l;
		v=pq.top().r;
		if(Find(u)!=Find(v)){
			ans+=pq.top().v;
			Union(u,v);
		}
		pq.pop();
	}
	cout<<ans;
}


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

int main(){
  int r;
  cin >> r;
  cout << 3*r*r << endl;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define ALL(n) begin(n),end(n)

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

    vector<int> a(A),b(B);
    int lowest_a=100001,lowest_b=100001;
    REP(i,A){
        cin>>a[i];
        if(a[i]<lowest_a){
            lowest_a=a[i];
        }
    }
    REP(i,B){
        cin>>b[i];
        if(b[i]<lowest_b){
            lowest_b=b[i];
        }
    }

    vector<int> x(m),y(m),c(m);
    REP(i,m){
        cin>>x[i]>>y[i]>>c[i];
    }

    int lowest_pair=lowest_a+lowest_b;
    int p=0;
    REP(i,m){
        p=a[x[i]-1]+b[y[i]-1]-c[i];
        if(p<lowest_pair){
            lowest_pair=p;
        }
    }

    cout<<lowest_pair<<endl;
}

Measured memory_bytes: 2176
// AOJ Volume 0 Problem 0026

#include <stdio.h>

typedef struct {
	int x;
	int y;
} PATTERN;

PATTERN small[] = {{0, 0},
                   {-1, 0}, {0, -1}, {1, 0}, {0, 1},
				   {256, 256}};

PATTERN middle[] = {{0, 0},
                    {-1, 0},  {0, -1}, {1, 0},  {0, 1},
                    {-1, -1}, {1, -1}, {-1, 1}, {1, 1},
				    {256, 256}};

PATTERN big[] = {{0, 0},
                 {-1, 0},  {0, -1}, {1, 0},  {0, 1},
                 {-1, -1}, {1, -1}, {-1, 1}, {1, 1},
                 {-2, 0},  {2,  0}, {0, -2}, {0, 2},
				 {256, 256}};

int map[10][10];

void ink(int x, int y)
{
	if (x < 0 || y < 0){
		return;
	}
	if (x > 9 || y > 9){
		return;
	}
	map[y][x]++;
}

void drop(int x, int y, PATTERN *p)
{
	while (p->x != 256){
		ink(x + p->x, y + p->y);
		p++;
	}
}


void print(void)
{
	int x, y, max;

		printf("\n");
	
	max = 0;
	for (y = 0; y < 10; y++){
		for (x = 0; x < 10; x++){
			printf("%d ", map[y][x]);
		}
		printf("\n");
	}
	return (max);
}

int main(void)
{
    int x, y, size;
	int max;
	int cnt_0;	
	
    while (scanf("%d,%d,%d", &x, &y, &size) != EOF){
		switch (size){
		  case 1:
		    drop(x, y, small);
			break;
		
		  case 2:
		    drop(x, y, middle);
			break;
		
		  case 3:
		    drop(x, y, big);
			break;
		}
//		print();
    }
    
	max = cnt_0 = 0;
	for (y = 0; y < 10; y++){
		for (x = 0; x < 10; x++){
			if (map[y][x] == 0){
				cnt_0++;
			}
			if (max < map[y][x]){
				max = map[y][x];
			}
		}
	}
	
	printf("%d\n%d\n", cnt_0, max);
	
    return (0);
}

Measured memory_bytes: 0
#include <stdio.h>

int main()
{
   int K,X;
   scanf("%d %d", &K, &X);
   
   for (int i=X-K+1; i < X+K; i++) {
      printf("%d", i);
      if (i != X+K-1)
         printf(" ");
      else
         printf("\n");
   }
   return 0;
}


Measured memory_bytes: 128
#include <iostream>

using namespace std;

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

	int ans = 0;
	for (auto i = 1; i <= n; i++) {
		if (i % 2 == 0) continue;
		int local = 0;
		for (int j = 1; j <= i; j++) {
			if (i % j == 0) local++;
		}
		if (local == 8) ans++;
	}

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

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

int main() {
    int n;  cin >> n;
    int p;
    int count = 0;

    for(int i = 0; i < n; i++) {
        cin >> p;
        if(p - 1 != i) count++;
    }

    if(count == 2 || count == 0) cout << "YES" << endl;
    else cout << "NO" << endl;


    return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; ++i) cin >> A[i];

    auto ma = max_element(begin(A), end(A));
    auto mi = min_element(begin(A), end(A));

    cout << 2 * N - 2 << endl;
    if(abs(*ma) >= abs(*mi)) {
        int index = ma - begin(A) + 1;
        for(int i=1; i<=N; ++i) {
            if(i != index) cout << index << ' ' << i << endl;
        }
        for(int i=1; i<N; ++i) cout << i << ' ' << i + 1 << endl;
    } else {
        int index = mi - begin(A) + 1;
        for(int i=1; i<=N; ++i) {
            if(i != index) cout << index << ' ' << i << endl;
        }
        for(int i=N; i>1; --i) cout << i << ' ' << i - 1 << endl;
    }
}

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

int main(){
  int N;
  cin>>N;
  int x=N;
  int S=0;
  while(x!=0){
    S+=x%10;
    x/=10;
  }
  
  if(N%S==0){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int a, b, c;
	
	scanf("%d %d %d", &a, &b, &c);

	int ctr = 0;
	int sum = 0;
	
	while (c > sum) {
		if(b >= a) {
			sum += b;
			ctr++;
		}
		else {
			sum += + a;
			ctr++;
		}
	}
	printf("%d\n", ctr);
	return 0;
}



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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int D, N;
  cin >> D >> N;
  if (N == 100) N++;
  cout << N * (D > 0 ? 100 : 1) * (D > 1 ? 100 : 1) << '\n';
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 10000
#define NIL -1

typedef struct {
  int p;
  int l;
  int r;
} Node;

Node T[MAX];

void preParse(int u){
  if(u==NIL) return;
  printf(" %d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u){
  if(u==NIL) return;
  inParse(T[u].l);
  printf(" %d",u);
  inParse(T[u].r);
}

void postParse(int u){
  if(u==NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d",u);
  return;
}
	    
int main(){
  int i, j, k;
  int n;
  int id,l,r;
  int root = 0;
  scanf("%d", &n);
  for(i=0; i<n; i++) T[i].p=NIL;
  
  for(i=0; i<n; i++){
    scanf("%d%d%d", &id,&l,&r);
      T[id].l = l;
      T[id].r=r;
      if(l!=NIL) T[l].p = id;
      if(r!=NIL) T[r].p = id;
  }
  for(i=0; i<n; i++){
    if(T[i].p ==NIL) root = i;
  }
  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");
  return 0;
}
  



Measured memory_bytes: 2056
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d; cin >> n >> d;
  double D = static_cast<double>(d);
  int t = 0;
  for (int i = 0; i < n; i++) {
    int64_t x, y; cin >> x >> y;
    double dd = sqrt(x * x + y * y);
    if (dd <= D) t++;
  }
  cout << t << endl;
  return 0;
}

Measured memory_bytes: 3676
#include <iostream>
#include <vector>
#include <algorithm>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::pair;

using std::vector;
using std::sort;
using std::lower_bound;
using std::upper_bound;
using std::find_if;
using std::copy;
using std::copy_if;

int n,m;

bool reach(int a,int b,bool v[],bool used[]){
    if(v[a*n+b]){
        return true;
    }
    for(int i=0;i<n;i++){
        if(v[a*n+i]&&(!used[i])){
            v[a*n+i]=false;
            v[i*n+a]=false;
            used[i]=true;
            if(reach(i,b,v,used)){
                v[a*n+i]=true;
                v[i*n+a]=true;
                used[i]=false;
                return true;
            }
            v[a*n+i]=true;
            v[i*n+a]=true;
            used[i]=false;
        }
    }
    return false;
}

int main(){
    cin >> n;
    cin >> m;
    bool v[n*n];
    bool used[n];
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            v[i*n+j]=false;
        }
        used[i]=false;
    }

    vector<pair<int,int>> e;

    for(int i=0;i<m;i++){
        int a,b;
        cin >> a;
        cin >> b;
        a--;
        b--;
        v[a*n+b]=true;
        v[b*n+a]=true;
        pair<int,int> eab(a,b);
        e.push_back(eab);
    }

    int count=0;
    for(const auto & eab : e){
        int a=eab.first;
        int b=eab.second;
        v[a*n+b]=false;
        v[b*n+a]=false;
        if(!reach(a,b,v,used)){
            count++;
        }
        v[a*n+b]=true;
        v[b*n+a]=true;
    }

    cout << count << endl;
    return 0;
}



Measured memory_bytes: 256
import sys

stdin = sys.stdin

mod = 1000000007
inf = 1 << 60

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n = ni()
w = na()

ans = inf
d = [0] * (n + 1)
b = [0] * (n + 1)
for i in range(1, n + 1):
	d[i] = w[i - 1] + d[i - 1]
	b[i] = w[n - i] + b[i - 1]
b.reverse()
for i in range(1, n):
	ans = min(ans, abs(d[i] - b[i]))

print(ans)


Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    string S, T; cin >> S >> T;

    int cnt = 0;
    for (int i = 0; i < 3; i++) {
        if (S[i] == T[i]) {
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    n, m = map(int,input().split())
    a = list(map(int,input().split()))
    count = 0
    all = sum(a)
    for a_i in a:
        if 4 * m * a_i >= all:
            count += 1
    if count >= m:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <algorithm>
#include <cassert>
#include <limits>
#include <numeric>
#include <type_traits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <complex>
#include <climits>
#include <time.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll, ll> P;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

ll gcd(ll a, ll b) {
  while (a && b) {
    if (a >= b) a %= b;
    else b %= a;
  }
  return a + b;
}
ll ketasum(ll n) { //桁の数字全ての和を返す 例: 112 -> 4
	ll sum=0;
	if (n<0) return 0;
	while (n>0) {
		sum += n%10;
		n /= 10;
	}
	return sum;
}

typedef pair<ll, ll> pair_t;

bool comp(const pair_t &a, const pair_t &b) {
        return a.first < b.first;
}

void sort2vectors(vector<ll> &av, vector<ll> &bv)
{ // ふたつの配列をまとめてそーと A[2,1] B[3,4] -> 1,4 2,3
        ll n = av.size();
        vector<pair_t> p(n);
        vector<ll> av2(n), bv2(n);
        for (ll i = 0; i < n; i++)
                p[i] = make_pair(av[i], bv[i]);
        sort(p.begin(), p.end(), comp);
        for (ll i = 0; i < n; i++) {
                av2[i] = p[i].first;
                bv2[i] = p[i].second;
        }
        av = av2;
        bv = bv2;
}
ll facctorialMethod(ll k){ //階乗
	ll s;
	if(k > 1){
		s = k*facctorialMethod(k-1);
	} else {
		s = 1;
	}
	return s;
}

map< int64_t, ll > prime_factor(int64_t n) {
  map< int64_t, ll > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}
const ll mod = 1000000007;
const ll INF = 1e9;

// 変数定義start(vectorはresizeしようね)
ll N;
// 変数定義end

void solve(){
	cin >> N;
	if(N%2 == 0){
		cout << (N-2)/2<< endl;
	}else {
		cout << (N-1)/2<< endl;
	}
}

int main(){

    //clock_t start = clock();

    cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	//clock_t end = clock();

    //const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC * 1000.0;
    //printf("time %lf[ms]\n", time);
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,sum=0;
    long long a[100005];
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    int x=a[0],y=1;
    for(int i=1;i<n;i++)
    {
        if(a[i]==a[i-1])
        {
            y++;
        }
        else
        {
            if(y%2!=0) sum++;
            y=1;
        }
    }
    if(y%2!=0) sum++;
        cout<<sum;
}


Measured memory_bytes: 1024
N = gets.to_i
a = gets.split.map(&:to_i)
sum = 0
for i in 0..a.length-1
  a[i] = a[i] - (i+1)
  sum += a[i]
end
a = a.sort

def bad(a,b)
  sum = 0
  for i in 0..a.length-1
    sum += (a[i]-b).abs
  end
  sum
end

if N==1
  puts 0
else
  puts [bad(a,a[(N-1)/2]),bad(a,a[(N-1)/2+1])].min
end


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

#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

#ifdef __WIN32
#define LLFORMAT "I64"
#define Rand() ((rand() << 15) + rand())
#else
#define LLFORMAT "ll"
#define Rand() (rand())
#endif

using namespace std;

const int maxn = 55, oo = 1e9 + 7, maxm = 50 * 50 * 50 + 10;

int n, v[maxn], W, x, par[maxn], sz, y, ans, id[maxn];
long long w[maxn], dp[maxm];

int main() {
	scanf("%d%d%d", &n, &W, &x); scanf("%d", w + 1); v[1] = 1; y = min(x, 50);
	for (int i = 2; i <= n; ++i) scanf("%d%d", w + i, par + i), v[i] = 1;
	for (int i = n; i; --i) w[par[i]] += w[i], v[par[i]] += v[i], id[i] = i;
	sort(id + 1, id + n + 1, [&](int i, int j) { return w[i] * v[j] < w[j] * v[i]; });
	for (int i = 1; i <= n; ++i) {
		int nsz = sz + v[i] * y;
		for (int j = sz + 1; j <= nsz; ++j) dp[j] = oo;
		for (int j = nsz; ~j; --j) for (int lim = min(y, j / v[i]), k = max(0, (j - sz) / v[i]); k <= lim; ++k) dp[j] = min(dp[j], dp[j - k * v[i]] + w[i] * k);
		sz = nsz;
	}
	for (int i = 0; i <= sz; ++i) if(dp[i] <= W) {
		int cur = i, W = ::W - dp[i];
		for (int j = 1; j <= n; ++j) {
			int t = min(id[j] == 1 ? (long long) oo : (long long) (x - y), W / w[id[j]]);
			cur += t * v[id[j]];
			W -= w[id[j]] * t;
		}
		ans = max(ans, cur);
	}
	printf("%d\n", ans);
	return 0;
}



Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int func(int x)
{
	if(x<10)return x;
	else return x%10+func(x/10);
}

int main()
{	
	int n;
	cin>>n;
	if(n%func(n))cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
mod = 10**9 + 7
ans = 0
for i in range(k, n+2):
    ans += max(0, n*(n+1)//2 - (n-i)*(n+1-i)//2 - i*(i-1)//2 + 1)
    ans %= mod
print(ans)

Measured memory_bytes: 9052
#include<iostream>
#include<algorithm>
using namespace std;
#define F(i,N) for(int i=0; i<N; i++)
int main(){
    int N; cin >> N;
    int a[N]; F(i,N) cin >> a[i]; //sort(a, a+N);

    //int s = a[0], e = a[N-1];
    //int mean = (s + e) / 2; 
    int ans = 10e8;
    for(int j=-100; j<=100; j++){
        int sum = 0;
        F(i, N) sum += (a[i] - j) * (a[i] - j);
        if(ans >= sum) ans = sum;
    }
    cout << ans;

}

Measured memory_bytes: 632
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include<math.h>
#include <queue>
using namespace std;
#define Minf -1e9
#define scan(n) scanf("%lld",&n)
typedef long long ll;
const int maxn = 1*1e5+10;
const ll INF = 1e9+100;
const int mod = 998244353;

int a[maxn];
int main()
{
	ll n, k;
	scanf("%lld%lld", &n, &k);
	ll ans = 0;
	for (int i = 0; i < n; i++){
		ll x, y;
		scanf("%lld%lld", &x, &y);
		if (x*x+y*y <=(ll)k*k)ans++;
	}
	printf("%lld", ans);
}

Measured memory_bytes: 3816
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
	int n =stdIn.nextInt();
	String S = stdIn.next();
	String T = stdIn.next();
	char[] s = new char[n];
	char[] t = new char[n];
	for(int i=0;i<n;i++){
	    s[i]=S.charAt(i);
	    t[i]=T.charAt(i);
	    System.out.print(s[i]);
	    System.out.print(t[i]);
	}
	System.out.println("");
    }
}
	    


Measured memory_bytes: 23636
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Solve s= new Solve();
		s.solve();
	}

}
class Solve{
	 Scanner sc = new Scanner(System.in) ;
	 void solve() {
		 int r =sc.nextInt();
		 int D =sc.nextInt();
		 int x_2000 =sc.nextInt();
		 int[] x_res = new int[10];
		 
		 x_res[0] = x_2000*r-D;
		 
		 for(int i=1;i<10;i++) {
			 x_res[i]=x_res[i-1]*r-D;
		 }
		 
		 for(int i=0;i<10;i++) {
			 System.out.println(x_res[i]);
		 }
		 
	 }
}

Measured memory_bytes: 23892
function main(input) {
  var answer = 0;

  for (var i = 1; i <= input; i++) {
    var counter = 0;
    for (var j = 1; j <= i; j++) {
      if(i % 2 == 0){
        continue;
      }
      if(i % j == 0) {
        counter++;
      }
    }
    if (counter == 8) {
      answer++;
    }
  }

  console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
#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 ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string s,t;
	cin >> s;
	REP(i,s.size()) t += "x";
	cout << t << '\n';
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <numeric>

#define roop(i, n) for(int i=0;i<n;i++)
#define DIV 1000000007

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

float myPower(int a, int n) { // aのn乗の計算
	float x = 1;
	while (n > 0) { // 全てのbitが捨てられるまで
		if ( n & 1) { // 一番右のbitが１のとき
			x *= a;
		}
		a *= a;
		n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
	}
	return x;
}

ll combination(ll n, ll r) {
	if (n < 0 || r < 0 || r > n) return -1;

	if (n - r < r) r = n - r;
	if (r == 0) return 1;
	if (r == 1) return n;

	vector<ll> num(r);
	vector<ll> den(r);

	for (ll i = 0; i < r; i++) {
		num[i] = n - r + i + 1;
		den[i] = i + 1;
	}

	for (ll p = 2; p <= r; p++) {
		ll pivot = den[p - 1];
		if (pivot > 1) {
			ll offset = (n - r) % p;
			for (ll k = p - 1; k < r; k += p) {
				num[k - offset] /= pivot;
				den[k] /= pivot;
			}
		}
	}
	ll result = 1;
	for (ll k = 0; k < r; k++) {
		if (num[k] > 1) result *= num[k];
	}
	return result;
}

vector<string> split(const string& src, const char* delim = ",") {
	vector<string> vec;
	string::size_type len = src.length();

	for (string::size_type i = 0, n; i < len; i = n + 1) {
		n = src.find_first_of(delim, i);
		if (n == string::npos) {
			n = len;
		}
		vec.push_back(src.substr(i, n - i));
	}

	return vec;
}

int main() {
	ll a, b, c, k;
	cin >> a >> b >> c >> k;
	if (a >= k) {
		cout << k << endl;
	} else if ((a+b) >= k) {
		cout << a << endl;
	} else if ((a+b+c) < k) {
		cout << a - c << endl;
	} else {
		cout << a - (k - a - b) << endl;
	}
	return 0;
}

Measured memory_bytes: 3632
import static java.lang.System.out;
import static java.lang.Double.parseDouble;
import java.io.File;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        new Main().simul();
    }

    public void simul() {
        try (Scanner scan = new Scanner(System.in)) {
            simulEqua(scan);
        } catch (Exception e) {
        }
    }

    public void simul(String inDataPath) {
        try (Scanner scan = new Scanner(new File(inDataPath))) {
            simulEqua(scan);
        } catch (Exception e) {
        }
    }

    public void simulEqua(Scanner scan) {
        String inData;
        while ((inData = scan.nextLine()) != null || !"".equals(inData)) {
            String[] abcdefList = inData.split(" ");
            double[] in = new double[6];
            for (int i = 0; i < 6; i++) {
                in[i] = parseDouble(abcdefList[i]);
            }
            double[] xy = getXY(in);
            out.printf("%4.3f %4.3f\n", xy[0], xy[1]);
        }
    }

    public double[] getXY(double[] in) {
        double[] xy = new double[2];
        xy[0] = (in[1] * in[5] - in[2] * in[4]) / (in[1] * in[3] - in[0] * in[4]);
        xy[0] = judge(xy[0]);
        xy[1] = (in[2] - in[0] * xy[0]) / in[1];
        xy[1] = judge(xy[1]);
        return xy;
    }

    public double judge(double num) {
        return (num == -0.0) ? 0.0 : num;
    }
}

Measured memory_bytes: 26472
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1e9+7;

#define vec     vector<int>
#define vecll   vector<ll>
#define vec2    vector<vector<int>>
#define vec2ll  vector<vector<ll>>
#define vpair   vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define mpair(v1, v2)    make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << var << "\n"
#define pYes()         prt("Yes")
#define pNo()          prt("No")
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(var)      rep(i,var.size()){cout << var[i] << " ";} cout << "\n"

//----------------------------------------------------------------

int main(void) {
  int n;
  cin >> n;
  arr(l,n);

  sortall(l);

  int tot=0;
  rep(i,n-1){
    tot+=l[i];
  }
  if(l[n-1]<tot){
    pYes();
  } else {
    pNo();
  }

}


Measured memory_bytes: 256