akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sys import stdin
import math

# 標準入力をスペースで区切って、intに変換 listに収納
int_list  = [int(x) for x in stdin.readline().rstrip().split()]


K = int_list[0]
X = int_list[1]

min_point = X - K + 1
max_point = X + K 


for i in range(min_point,max_point):
    if i == max_point-1:
        print(i,end='')
    else:print(i,end=' ')


Measured memory_bytes: 3060
#include <stdio.h>
#define N 100
int main(){
  int flag=1,n,num=0;
  int i,k,A[N];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  while(flag){
    flag=0;
    for(i=n-1;i>=1;i--){
      if(A[i]<A[i-1]){
	k=A[i];
	A[i]=A[i-1];
	A[i-1]=k;
	flag=1;
	num++;
      }
    }
  }
  for(i=0;i<n;i++){
    if(i==n-1){
printf("%d",A[i]);
 continue;
    }
    printf("%d ",A[i]);
  }
  printf("\n%d\n",num);
  return 0;
}



Measured memory_bytes: 2140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N=2e5+100;
int head[N],nxt[N*2],to[N*2],val[N],tot=0;
void add(int x,int y)
{
    to[++tot]=y;
    nxt[tot]=head[x];
    head[x]=tot;
}
int n,q;
void dfs(int v,int fa)
{
    for(int i=head[v];i;i=nxt[i]){
        int y=to[i];
        if(y==fa)continue;
        val[y]+=val[v];
        dfs(y,v);
    }
}
int main()
{
    scanf("%d%d",&n,&q);
    for(int i=1;i<n;i++)
    {
        int u,v;cin>>u>>v;
        add(u,v);add(v,u);
    }
    for(int i=1;i<=q;i++){
        int pos,x;cin>>pos>>x;
        val[pos]+=x;
    }
    dfs(1,0);
    for(int i=1;i<n;i++){
        printf("%d ",val[i]);
    }
    printf("%d\n",val[n]);
    return 0;
}

Measured memory_bytes: 16512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<string>;
using vb = vector<bool>;
template<class T> using vc = vector<T>;
template<class T> using vvc = vector<vector<T>>;
using Graph = vector<vector<ll>>;
const ll INF = 1LL << 60;
void init() {cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(15);}
#define tl 1'000'000'007
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REREP(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
#define REFOR(i, n, a) for (ll i = n; i >= a; i--)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define debug cout << "line : " << __LINE__ << " debug" << endl;
#define in(a) cin >> a;
#define in2(a,b) cin >> a >> b;
#define in3(a,b,c) cin >> a >> b >> c;
#define out(a) cout << a << endl;
#define inV(A) REP(i,A.size()) in(A[i]);
struct Point{ ld x,y; };
ld dist(Point a, Point b){return sqrt(abs(a.x-b.x)*abs(a.x-b.x)+abs(a.y-b.y)*abs(a.y-b.y));} // ２点間の距離 
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b;} 
ll fact(ll n){ if(n < 2) return 1; return (n * fact(n-1))%tl; } //階乗
inline ll updiv(ll a,ll b){ return (a + b - 1) / b; } //切り上げ
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
//-----------------------------------
int main(){
    init();
    ll n,y;
    in2(n,y);
    REP(i,n+1){
        REP(j,n+1-i){
            ll sen= y-(i*10000+j*5000);
            if(sen>=0 && sen/1000==n-i-j){
                cout << i << " " << j << " " << n-i-j << endl;
                return 0;
            } 
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
    // out(n);
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_set>
#include <bitset>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define szz(x) (int)x.size()
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
typedef tuple<int, int, int> t3;

const int P1 = 1e9 + 103;
const int P2 = 1e9 + 289;
const int PV = 1e9 + 7;

pii PW[10010];
pii operator-(pii a, pii b) { return pii(a.Fi-b.Fi<0 ? a.Fi-b.Fi+P1 : a.Fi-b.Fi, a.Se-b.Se<0 ? a.Se-b.Se+P2 : a.Se-b.Se); }
pii operator+(pii a, pii b) { return pii(a.Fi+b.Fi>=P1 ? a.Fi+b.Fi-P1 : a.Fi+b.Fi, a.Se+b.Se>=P2 ? a.Se+b.Se-P2 : a.Se+b.Se); }
pii operator*(pii a, pii b) { return pii((ll)a.Fi*b.Fi%P1, (ll)a.Se*b.Se%P2); }

int N, K;
int dp[10010];
string s[2020];
char buf[100010];

char ans[10010];
pii sans[10010];
int dl;
int min_index[10010];

void write(int x, char c) {
	ans[x] = c;
	sans[x] = sans[x-1] + pii(c, c) * PW[x];
}

pii get_h1(int l, int r) {
	return (sans[r] - sans[l-1]) * PW[10005 - r];
}

vector <pii> In[2020];
pii get_h2(int x, int idx) {
	return In[x][idx] * PW[10005 - idx];
}

pair<string, int> X[2020];
int main() {
	PW[0] = pii(1, 1); for(int i=1;i<10010;i++) PW[i] = pii(PV, PV) * PW[i-1];
	scanf("%d%d", &N, &K);
	for(int i=1;i<=N;i++) {
		scanf("%s", buf);
		s[i] = (string)buf;
		X[i] = make_pair(s[i], i);
		pii now = pii(0, 0);
		for(int j=0;buf[j];j++) {
			now = now + pii(buf[j], buf[j]) * PW[j];
			In[i].pb(now);
		}
	}
	sort(X+1, X+1+N);
	
	for(int i=0;i<=K;i++) dp[i] = -1;
	dp[0] = N+1;
	for(int i=N;i;i--) {
		int x = szz(s[i]);
		for(int j=K;j>=x;j--) if(dp[j] == -1) {
			if(dp[j-x] != -1) dp[j] = i;
		}
	}
	for(int i=0;i<10010;i++) min_index[i] = N + 1, write(i, 'z' + 1);
	min_index[0] = 0;
	
	for(int L=0;L<=K;L++) {
		if(min_index[L] == N + 1) continue;
		int idx = min_index[L];
		for(int a=1;a<=N;a++) {
			int j = X[a].Se;
			if(j <= idx) continue;
			int lj = szz(X[a].Fi);
			if(L + lj > K || dp[K-L-lj] <= j) continue;
			
			int op = 0;
			int low = 0, high = lj - 1, fd = -1;
			while(low <= high) {
				int mid = (low + high) >> 1;
				if(get_h1(L+1, L+1+mid) != get_h2(j, mid)) fd = mid + 1, high = mid - 1;
				else low = mid + 1;
			}
			if(fd != -1) {
				op = (ans[L+fd] > X[a].Fi[fd-1]) ? 1 : -1;
			}
			if(op == -1) break;
			if(op == 0) {
				if(min_index[L+lj] > j) {
					min_index[L+lj] = j;
				}
			}
			else {
				for(int b=L+fd;b<=L+lj;b++) min_index[b] = N + 1, write(b, X[a].Fi[b-L-1]); // ans[b] = X[a].Fi[b-L-1];
				for(int b=L+lj+1;b<=K;b++) min_index[b] = N + 1, write(b, 'z'+ 1); // ans[b] = 'z' + 1;
				min_index[L+lj] = j;
			}
		}
	}
	for(int i=1;i<=K;i++) printf("%c", ans[i]); puts("");
	
	return 0;
}

Measured memory_bytes: 11264
X, Y = tuple(map(int, input().split()))

# Calculate prize for "Coding Contest"
prize_code = 0;
if X == 1:
    prize_code = 300000;
elif X == 2:
    prize_code = 200000;
elif X == 3:
    prize_code = 100000;

# Calculate prize for "Robot Maneuver"
prize_device = 0;
if Y == 1:
    prize_device = 300000;
elif Y == 2:
    prize_device = 200000;
elif Y == 3:
    prize_device = 100000;

# Calculate prize for "two victories"
prize_both = 0
if X == 1 and Y == 1:
    prize_both = 400000

# Calculate the sum and print the answer
prize_total = prize_code + prize_device + prize_both
print(prize_total)

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

using namespace std;

int main(void) {
  int N, T;
  cin >> N >> T;
  int c, t;
  int ans = 9999;
  for (int i=0; i<N; i++) {
    cin >> c >> t;
    if (t <= T && c < ans) {
      ans = c;
    }
  }
  if (ans == 9999) {
    cout << "TLE" << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 256
unittest
{
	assert( [ "21" ].parse.expand.solve == 27 );
	assert( [ "12" ].parse.expand.solve == 36 );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto m = input.front.strip.to!( long );
	return tuple( m );
}

auto solve( long m )
{
	return 48 - m;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <bitset>
#include <memory>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <iomanip>
using namespace std;


int main(int argc, char *argv[]) {
	int a, b;
	cin >> a >> b;
	int c = 6;
	c -= a + b;
	cout << c << endl;


}









Measured memory_bytes: 256
// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef map<int, int> MAPII;
typedef map<double, int> MAPDI;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMAPIS;

#define MP make_pair
#define fastIO	cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
//for gcc (未test)
// #define FOREACH_IT(it,c)	for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(), c_end=c.end(); it!=c_end; ++it)

// ------------------- include, typedef, define END. -------------------

void Output(stack<int> &ans){
	while (!ans.empty()){
		cout << ans.top();
		ans.pop();
	}
	cout << endl;
}

int main(){
	int n=4;
	int in;
	while (cin >> in, in>=0){
		stack<int> ans;
		while (in >= n){
			// nで割り切れる限りループ
			ans.push(in%n);
			in /= n;
		}
		ans.push(in);
		Output(ans);
	}
	return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<ll>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template <typename T>
inline bool chmax(T &a, T b){if (a < b){a = b;return 1;}return 0;}
template <typename T>
inline bool chmin(T &a, T b){if (a > b){a = b;return 1;}return 0;}

int main(){
    ll n;cin>>n;
    bool yes=true,fi_st=true;
    char c;
    map<string,bool> check;
    rep(i,n){
        string s;cin>>s;
        if (check[s] == true){
            yes = false;
        }
        else{
            check[s] = true;
        }
        if(fi_st){
            fi_st=false;
            c=s[s.size()-1];
            continue;
        }

        if(c!=s[0]){
            yes=false;
        }else{
            c=s[s.size()-1];
        }
    }

    if(yes) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}

Measured memory_bytes: 3604
import java.util.Scanner;

public class Main {

	static Scanner scanner;

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

	    String s=gs();
	    String t=gs();
	    int a=gi();
	    int b=gi();
	    String u= gs();

	    //System.out.print(String.valueOf(c));

        if (s.equals(u)) {
        	System.out.print((a-1) + " " + b);
        }else {
        	System.out.print((a) + " " + (b-1));
        }


	}
	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 38564
#include<iostream>

using namespace std;
int main (){
	int seconds, hour =0, minute=0, second=0;
	cin >> seconds;
	hour = seconds/3600;
	minute = (seconds/60) - (hour*60);
	second = seconds - ((hour*3600) + (minute*60));
	cout << hour <<":" << minute <<":"<<second<<endl;
	return 0;
}

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

using namespace std;
#define rep(i,n) for (int i =0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;
//int choose2(ll x){
	//	return x*(x-1)/2;}
int main() {
	string N;
	cin >> N;
	if (N[3] == N[2] && N[4] == N[5]) cout << "Yes";
	else cout << "No";
}

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

int main() {
    ll N, M; cin >> N >> M;
    
    vector<ll> A(N), P(N), MSB(N);
    for(int i=0; i<N; i++) {
        cin >> A[i];

        for(int k=0; k<62; k++) {
            if(A[i] >> k & 1) {
                MSB[i] = k;
            }
        }
    }
    for(int i=0; i<N; i++) {
        cin >> P[i];
    }

    vector<ll> divisor(1 << N), popcnt(1 << N);
    for(int bit=0; bit<(1<<N); bit++) {
        popcnt[bit] = __builtin_popcountll(bit);

        bool overflow = false;
        ll msb_sum = 0, mul = 1;
        for(int i=0; i<N; i++) {
            if(bit >> i & 1) {
                ll val = A[i] / __gcd(mul, A[i]);
                if(1.0 * val * mul > 1.2e18) {
                    overflow = true;
                    break;
                }
                else {
                    mul = mul * val;
                }
            }
        }

        if(!overflow) {
            divisor[bit] = M / mul;
        }
    }

    divisor[0] = 0;
    for(int i=0; i<N; i++) {
        for(int bit=0; bit<(1<<N); bit++) {
            if(bit >> i & 1) divisor[bit] -= divisor[bit ^ (1 << i)];
        }
    }

    long double ans = 0;
    for(int bit=0; bit<(1<<N); bit++) {
        long double prob = 1.0;
        for(int i=0; i<N; i++) {
            if(bit >> i & 1) {
                prob *= 1.0 * P[i];
            }
            else {
                prob *= 1.0 * (100 - P[i]);
            }
        }
        ll sum = llabs(divisor[bit]);
        ans += prob * sum;
    }
    printf("%.12Lf\n", ans / pow(100, N));
    return 0;
}


Measured memory_bytes: 19200
#include<iostream>
#include<math.h>
using namespace std;

const int MAX = 10000;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return true;
}

int main() {
	int n;
	int cnt = 0;

	cin >> n;
	for (int i = 0; i < n; i++) {
		int buf;
		cin >> buf;
		if (prime(buf))cnt++;
	}

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

Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long X; cin>>X;
  long long N=100;
  for(int i=1;i<100000;i++){
    N+=N/100;
    if(N>=X){
      cout<<i<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 3612
//Author: Fuadul Hasan(fuadul202@gmail.com)
//BSMRSTU,Gopalganj
#include<bits/stdc++.h>
using namespace std;int tc = 1;
#define happy ios::sync_with_stdio(false);
#define coding  cin.tie(0);
#define F first
#define S second
#define mp make_pair
#define ll long long
#define Pi atan(1)*4
#define pb  push_back
#define vpr vector<pr> 
#define pr pair<int, int> 
#define vi std::vector<int>
#define vll std::vector<ll>
#define YES printf("YES\n");
#define NO printf("NO\n");
#define Yes printf("Yes\n");
#define No printf("No\n");
#define all(n) n.begin(),n.end()
#define point(x) setprecision(x)
#define Test printf("Case %d: ",tc++);
#define Unique(c) (c).resize(unique(all(c))-(c).begin())
#define vout(v) for (auto z: v) cout << z << " "; cout << endl;

#define error(args...) {vector<string>_v=split(#args,',');err(_v.begin(),args);cout<<endl;}
vector<string> split(const string &s, char c) {vector<string>v; stringstream ss(s); string x;
while (getline(ss, x, c))v.emplace_back(x); return move(v);} void err(vector<string>::iterator it) {}
template<typename T, typename... Args>void err(vector<string>::iterator it, T a, Args...args) {
cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " "; err(++it, args...);}

const int M = 1e9 + 7;
const ll  Inf = (ll)2e18 + 5;
const int N   = 2e5 + 5;
ll vis[N],res[N];

int solve() 
{
	//happy coding

	int n,m;
	cin>>n>>m;
	if(500*n>=m){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}



	
	return 0;
}
int main(){
	int test = 1;
  	//scanf("%d", &test);
  	while (test--)solve();return 0;
}

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

using namespace std;

int main()
{
  string line;
  getline(cin, line);
  if (line.length() >= 4 && line[0] == 'Y' &&
	  line[1] == 'A' && line[2] == 'K' && line[3] == 'I' )
  {
	cout << "Yes" << endl;
  }
  else
  {
	cout << "No" << endl;
  }
}

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

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

	long long x = n % k;
	if (2 * x > k) {
		x -= k;
		x = -x;
	}

	cout << x << endl;

	return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;int a[100],b[100],c[100];
int main(){
int n,pre=0;
  cin>>n;int ans=0;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++)cin>>b[i];
for(int i=1;i<=n-1;i++)cin>>c[i];
  for(int i=1;i<=n;i++) {
    if(a[i]==pre+1) ans+=c[pre];
    
    ans+=b[a[i]];
    pre=a[i];}
cout<<ans;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
def keta2(n):
    b = 0
    if n%2 == 0:
        b += 1
        while(1):
            n = n//2
            if n==0 or n==1:
                break
            if n % 2 == 0:
                b += 1
            else:
                break

    return b

ans = 1000
for i in range(N):
    b = keta2(A[i])
    ans = min(ans,b)


print(ans)

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

#define int             long long int
#define ld              long double
#define ff              first
#define ss              second
#define mp              make_pair
#define pb              push_back
#define endl            "\n"

#define si              set <int>
#define vi              vector <int>
#define pii             pair <int, int>
#define vpii            vector <pii>
#define mii             map <int, int>
#define que_max         priority_queue <int>
#define que_min         priority_queue <int, vi, greater<int>>

#define loop(i,s,e)     for(int i=s;i<e;i++)
#define rloop(i,e,s)    for(int i=e;i>=s;i--)
#define mset(a,f)       memset(a,f,sizeof(a))


#define M               1000000007
#define sz(x)           ((int) x.size())
#define all(p)          p.begin(), p.end()

#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)        for (auto x : a) cout << x << " "; cout << endl
#define Print(a,x,y)    for (int i=x; i<y; i++) cout<< a[i]<< " "; cout << endl

const int inf = INT_MAX;
const long long INF = LLONG_MAX;

inline int power(int a, int b)
{
	int x = 1;
	while (b)
	{
		if (b & 1) x *= a;
		a *= a;
		b >>= 1;
	}
	return x;
}

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr (names + 1, ',');
	cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 3e5 + 7;
vector <vi > adj(N);

bool vis[N];
//0-->white
int dp[100005][2];
int n;
int go(int src, int color)
{
	vis[src] = true;
	int &ans = dp[src][color];
	if (ans != -1) return ans;
	int res1 = 1;
	for (auto x : adj[src])
	{
		if (!vis[x])
		{
			int ways = go(x, 0);


			res1 = (res1 * ways) % M;
			vis[x] = false;

		}
	}
	int res2 = 0;
	if (color == 0)
	{
		res2 = 1;
		for (auto x : adj[src])
		{
			if (!vis[x])
			{
				int ways = go(x, 1);


				res2 = (res2 * ways) % M;

			}
		}

	}
	//bug(res1, res2);
	vis[src] = false;
	return ans = (res1 + res2) % M;
}

void solve()
{
	cin >> n;
	adj.resize(n + 1);

	loop(i, 0, n - 1)
	{
		int u, v;
		cin >> u >> v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	mset(dp, -1);
	mset(vis, false);
	cout << go(1, 0) << endl;
	/*loop(i, 1, n + 1)
	{
		loop(j, 0, 2)
		cout << dp[i][j] << " ";
		cout << endl;
	}*/

	return;

}

int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);


	cout << setprecision(9) << fixed;

	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}


	return 0;
}


Measured memory_bytes: 19200
n, m, k = [int(i) for i in input().split()]
mod = 10**9+7


def kai(x, p=mod):
    a = 1
    for i in range(1, x + 1):
        a *= i
        a %= p
    return a


def comb(a, b, p=mod):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    c = 1
    c *= kai(a, p)
    c *= pow(kai(b, p), p - 2, p)
    c *= pow(kai(a - b, p), p - 2, p)
    return c % p


ans = 0
for i in range(1, n):
    ans += i * (n - i) * m ** 2
    ans %= mod

for i in range(1, m):
    ans += i * (m - i) * n ** 2
    ans %= mod
ans *= comb(n * m - 2, k - 2)
ans %= mod
print(ans)


Measured memory_bytes: 3064
unittest
{
	assert( [ "3", "1" ].parse.expand.solve == 2 );
	assert( [ "1", "2" ].parse.expand.solve == 3 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto a = input.front.to!( long );
	input.popFront;
	auto b = input.front.to!( long );
	return tuple( a, b );
}

auto solve( long a, long b )
{
	return 6 - a - b;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN=2e5+5;
int a[MAXN];
ll p[35];
int n;
bool judge(int c)
{
	memset(p,0,sizeof(p));
	int now=0;
	for(int i=1;i<=n;i++)
	{
		if(a[i]>30)
		{
			now=30;
			continue;
		}
		if(a[i]>a[i-1])
		{
			now=a[i];
			continue;
		}
		while(now>a[i])
		{
			p[now]=0;
			now--;
		}
		p[now]++;
		for(int j=30;j>=1;j--)
		{
			p[j-1]+=p[j]/c;
			p[j]%=c;
		}
	}
	return p[0]==0;
}
int main()
{
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	bool flag=false;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		if(a[i]<=a[i-1]) flag=true;
	}
	if(!flag) return 0*puts("1");
	int l=2,r=n;
	int ans=0;
	//cout<<judge(2)<<endl;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(judge(mid))
		{
			ans=mid;
			r=mid-1;
		}
		else
		{
			l=mid+1;
		}
	}
	printf("%d\n",ans);
	return 0;
}


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

int n, q;
vector<vector<int>> d;
vector<long long> c;

void add(int p) {
	for (int i = 0; i < d[p].size(); i++) {
		c[d[p][i]] += c[p];
		add(d[p][i]);
	}
}

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

	d.resize(n + 1);
	c.resize(n + 1, 0);

	for (int i = 0; i < n - 1; i++) {
		int a, b;

		cin >> a >> b;

		d[a].push_back(b);
	}

	for (int i = 0; i < q; i++) {
		int p, x;

		cin >> p >> x;

		c[p] += x;
	}

	add(1);

	for (int i = 0; i < n - 1; i++)
		cout << c[i + 1] << " ";
	cout << c[n] << endl;

	return 0;
}

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

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

const int N = 1e5 + 5;

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	string s, t;
	cin >> s >> t;
	t.pop_back();
	cout << ((s == t)? "Yes" : "No") << "\n";
}


Measured memory_bytes: 3648
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String L = sc.next();
		int N = L.length();
		int MOD = 1000000007;
		long[] dp1 = new long[N+1];
		long[] dp2 = new long[N+1];
		dp2[0] = 1;
		for(int i = 1; i <= N; i++) {
			if(L.charAt(i-1) == '1') {
				dp1[i] = (dp1[i-1]*3+dp2[i-1]) % MOD;
				dp2[i] = dp2[i-1] * 2 % MOD;
			}
			else {
				dp1[i] = dp1[i-1] * 3 % MOD;
				dp2[i] = dp2[i-1];
			}
		}
		System.out.println((dp1[N]+dp2[N]) % MOD);
	}

}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a, b;
	cin >> a >> b;
	char c[100][100];
	for(int i = 0; i < 50; i++){
		for(int j = 0; j < 100; j++){
			c[i][j] = '#';
		}
	}
	for(int i = 50; i < 100; i++){
		for(int j = 0; j < 100; j++){
			c[i][j] = '.';
		}
	}
	a--; b--;
	for(int i = 0; i < 49; i++){
		if(a == 0) break;
		for(int j = 0; j < 100; j++){
			if(a == 0) break;
			if(i%2 == 0 && j%2 == 0){
				c[i][j] = '.';
				a--;
			}
		}
	}
	for(int i = 51; i < 100; i++){
		if(b == 0) break;
		for(int j = 0; j < 100; j++){
			if(b == 0) break;
			if(i%2 == 0 && j%2 == 0){
				c[i][j] = '#';
				b--;
			}
		}
	}
	cout << 100 << " " << 100 << endl;
	for(int i = 0; i < 100; i++){
		for(int j = 0; j < 100; j++){
			cout << c[i][j];
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ls (o<<1)
#define rs (o<<1|1)
#define pb push_back
const double PI= acos(-1.0);
const int M = 1e5+7;
/*
int head[M],cnt;
void init(){cnt=0,memset(head,0,sizeof(head));}
struct EDGE{int to,nxt,val;}ee[M*2];
void add(int x,int y){ee[++cnt].nxt=head[x],ee[cnt].to=y,head[x]=cnt;}
*/

char s[110],t[110];
int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	ll a,b,c,k;
  	cin>>a>>b>>c>>k;
  	ll ans=0;
  	if(a<=k)ans+=a,k-=a;
  	else ans+=k,k=0;
  	if(b<=k)k-=b;
  	else k=0;
  	if(c<=k)ans-=c,k-=c;
  	else ans-=k,k=0;
  	cout<<ans<<endl;
	return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	int n, k;
	cin >> n >> k;
	vi l(n);
	rep(i,n) cin >> l[i];
	sort(rall(l));
	int sum = 0;
	rep(i,k) sum += l[i];
	cout << sum << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 256
N = input()
K = int(input())
def Anger(n, k):
  d = int(n[0])
  if len(n) < k:
    return 0
  else:
    if k == 1:
      if d == 0 and len(n) != 1:
        return Anger(n[1:], k)
      elif d == 0 and len(n) == 1:
        return 0
      else:
        if len(n) != 1:
          S = d + 9 * (len(n) - 1)
          return S
        else:
          return d
    else:
      if d == 0:
        return Anger(n[1:], k)
      else:
        S = (d - 1) * (9 ** (k-1))
        for j in range(k-1):
          S *= len(n) - j - 1
          S //= j + 1
        T = 9 ** k
        for j in range(k):
          T *= len(n) - j - 1
          T //= j + 1
        return S + T + Anger(n[1:], k - 1)
    
print(Anger(N, K))

Measured memory_bytes: 3064
import java.util.Scanner;
public class Main{
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int[] array = new int[3];
    for(int i=0; i<array.length; i++) {
      array[i] = scanner.nextInt();
    }
    if((array[1]-array[0]) == (array[2]-array[1])) {
      System.out.println("YES");
    } else {
      System.out.println("NO");
    }
  }
}


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

typedef long long ll;
//const int INF = 2e9;
//const ll INF = 9e18;


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    cin >> S;
    int n = S.size();
    bool flag = true;
    for (int i=0;i<n;){
        if (n-i <= 4) {
            flag = false;
            break;
        }
        if (n-i == 5){
            if (S[i] =='d'&& S[i+1]=='r'&&S[i+2]=='e'&&S[i+3]=='a'&&S[i+4]=='m'){
                break;
            } else if (S[i]=='e'&&S[i+1]=='r'&&S[i+2]=='a'&&S[i+3]=='s'&&S[i+4]=='e'){
                break;
            } else {
                flag = false;
                break;
            }
        }
        if (n-i == 6) {
            if (S[i]=='e'&&S[i+1]=='r'&&S[i+2]=='a'&&S[i+3]=='s'&&S[i+4]=='e'&&S[i+5]=='r'){
                break;
            } else {
                flag = false;
                break;
            }
        }
        if (n-i == 7) {
            if (S[i] =='d'&& S[i+1]=='r'&&S[i+2]=='e'&&S[i+3]=='a'&&S[i+4]=='m'&&S[i+5]=='e'&&S[i+6]=='r'){
                break;
            } else {
                flag = false;
                break;
            }
        }
        if (n-i >= 8) {
            if (S[i] =='d'&& S[i+1]=='r'&&S[i+2]=='e'&&S[i+3]=='a'&&S[i+4]=='m'&&S[i+5]=='d'){
                i += 5;
            } else if (S[i] =='d'&& S[i+1]=='r'&&S[i+2]=='e'&&S[i+3]=='a'&&S[i+4]=='m'&&S[i+5]=='e'&&S[i+6]=='r'&&S[i+7]=='d'){
                i += 7;
            } else if (S[i] =='d'&& S[i+1]=='r'&&S[i+2]=='e'&&S[i+3]=='a'&&S[i+4]=='m'&&S[i+5]=='e'&&S[i+6]=='r'&&S[i+7]=='e'){
                i += 7;
            } else if (S[i] =='d'&& S[i+1]=='r'&&S[i+2]=='e'&&S[i+3]=='a'&&S[i+4]=='m'&&S[i+5]=='e'&&S[i+6]=='r'&&S[i+7]=='a'){
                i += 5;
            } else if (S[i]=='e'&&S[i+1]=='r'&&S[i+2]=='a'&&S[i+3]=='s'&&S[i+4]=='e'&&S[i+5]=='d'){
                i += 5;
            } else if (S[i]=='e'&&S[i+1]=='r'&&S[i+2]=='a'&&S[i+3]=='s'&&S[i+4]=='e'&&S[i+5]=='e'){
                i += 5;
            } else if (S[i]=='e'&&S[i+1]=='r'&&S[i+2]=='a'&&S[i+3]=='s'&&S[i+4]=='e'&&S[i+5]=='r'){
                i += 6;
            } else {
                flag = false;
                break;
            }
        }
    }
    if (flag) cout << "YES" << "\n";
    else cout << "NO" << "\n";
}

Measured memory_bytes: 512
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
use proconio::fastout;
use proconio::input;
//use proconio::marker::Usize1;
//use proconio::marker::Chars;
//use std::collections::HashSet;
// use std::cmp::*;
//use std::collections::VecDeque;

#[fastout]
fn main() {
    input! {
       n: u64
    }
    let a = n / 3;
    let b = n / 5;
    let c = n / 15;
    let ans = n * (n + 1) / 2 - a * (a + 1) / 2 * 3 - b * (b + 1) / 2 * 5 + c * (c + 1) / 2 * 15;
    println!("{}", ans);
}


Measured memory_bytes: 2156
# coding: utf-8
	
S = input()
T = ""

result = 0

while True:
	counter = 0

	for val in range(len(S)):
		if S[val] == "A":
			T = S[val:]	
			counter += 1
			break
		elif S[val] == "C":
			T = S[val:]	
			counter += 1
			break
		elif S[val] == "G":
			T = S[val:]	
			counter += 1
			break
		elif S[val] == "T":
			T = S[val:]	
			counter += 1
			break

	if val+1 != len(S):

		for val in range(1,len(T)):
			if T[val] == "A":
				counter += 1
			elif T[val] == "C":
				counter += 1
			elif T[val] == "G":
				counter += 1
			elif T[val] == "T":
				counter += 1
			else:
				S = T[val:]
				break


	if result < counter:
		result = counter

	if val+1 == len(S):
		break
	if val+1 == len(T):
		break

print(result)



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

template <typename T>
struct SegmentTree{ // 1-indexed
  T m_id;
  T op(const T &a, const T &b) const{
    return max(a, b);
  }
  vector<T> m_SegT;

  SegmentTree(int N): m_id(0), m_SegT(2*N, m_id){}
  SegmentTree(const vector<T> &data): m_id(0), m_SegT(2*data.size()){
    int N= m_SegT.size() >> 1;
    for(int i=0; i<N; i++){
      m_SegT.at(i+N)= data.at(i);
    }
    for(int i=N-1; i>0; i--){
      m_SegT.at(i)= op(m_SegT.at(i << 1), m_SegT.at((i << 1) | 1));
    }
  }

  void set_val(int idx, T val){
    idx+= m_SegT.size() >> 1;
    m_SegT.at(idx)= val;
    while((idx >> 1) > 0){
      idx >>= 1;
      m_SegT.at(idx)= op(m_SegT.at(idx << 1), m_SegT.at((idx << 1) | 1));
    }
  }

  T range(int left, int right) const{// [left, right)
    left += m_SegT.size() >> 1;
    right+= m_SegT.size() >> 1;
    T calc_l= m_id;
    T calc_r= m_id;

    while(left < right){
      if(left&1){
        calc_l= op(calc_l, m_SegT.at(left));
        left++;
      }
      if(right&1){
        calc_r= op(m_SegT.at(right-1), calc_r);
      }

      left >>= 1;
      right>>= 1;
    }

    return op(calc_l, calc_r);
  }
};

int main() {
  int N,K;
  cin >> N >> K;

  vector<int> data(N);
  for(int i=0; i<N; i++){
    cin >> data.at(i);
    data.at(i)++; // [0,N] -> [1,N+1]
  }

  constexpr int Vmax= 300'001; // '
  SegmentTree<int> st(Vmax+1);
  for(int i=0; i<N; i++){
    int left = max(1   , data.at(i)- K);
    int right= min(Vmax, data.at(i)+ K);
    int len_prev= st.range(left, right+1);
    st.set_val(data.at(i), len_prev+1);
  }

  int ans= st.range(0, Vmax+1);
  cout << ans << endl;
}

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

const int maxn = 22;
int f[2][maxn][(1<<maxn)];
int g[maxn][(1<<maxn)], ans[maxn][(1<<maxn)]; //g[i][j] : i位，状态为j的时候，最前面的一个0的位置
int d[(1<<maxn)]; //d[i] : i有几位（不包括leading 0）
int n;

void init()
{
	for (int i=1;i<=n;i++)
	{
		for (int j=0;j<(1<<i);j++)
		{
			int k = i;
			while ((j>>(k-1))&1) k--;
			g[i][j] = k!=0 ? (i+1-k) : -1;
		}
	}
	for (int i=0;i<(1<<n);i++)
	{
		int digit = 0, ti = i;
		while (ti) digit++, ti >>= 1;
		d[i] = digit;
	}
}

int main()
{
	//freopen("F.in","r",stdin);
	int req;
	cin >> n >> req;
	for (int i=0;i<=n;i++)
	{
		string str;
		cin >> str;
		for (int j=0;j<str.length();j++)
		{
			if (str[j] == '1')
			{
				f[0][i][j] = 1;
			}
		}
	}
	init();
	int cur = 1;
	for (int i=0;i<=n;i++)
	{
		cur = 1 - cur;
		for (int j=1;i+j<=n;j++)
		{
			for (int k=0;k<(1<<(i+j));k++)
			{
				ans[i][k>>j] += f[cur][i+j][k];
				int t = g[j][k & ((1<<j)-1)];
				if (t != -1)
				{
					if (t != j) f[1-cur][i+j-t+1][(k>>j<<(j-t+1)) | (k & ((1<<(j-t))-1))] += f[cur][i+j][k];
					else ans[i+j-t+1][(k>>j<<(j-t+1)) | (k & ((1<<(j-t))-1))] += f[cur][i+j][k];
				}
				if (k & ((1<<j)-1))
				{
					t = d[k & ((1<<j)-1)];
					if (t != 1) f[1-cur][i+t][(k>>j<<t) | (k & ((1<<t)-1))] += f[cur][i+j][k];
					else ans[i+t][(k>>j<<t) | (k & ((1<<t)-1))] += f[cur][i+j][k];
				}
			}
		}
		memset(f[cur],0,sizeof(f[cur]));
	}
	for (int i=n;i>=1;i--)
	{
		for (int j=0;j<(1<<i);j++)
		{
			//cout << i<<" "<<j<<" "<<ans[i][j]<<endl;
			if (ans[i][j] >= req)
			{
				for (int k=i-1;k>=0;k--) 
				{
					cout << ((j >> k) & 1);
				}
				cout << endl;
				return 0;
			}
		}
	}
	return 0;
}


Measured memory_bytes: 823744
#!/usr/bin/env python3
import sys
try: from typing import Any, Union, List, Tuple, Dict
except ImportError: pass
def debug(*args): print(*args, file=sys.stderr)
def exit(): sys.exit(0)

N = int(input())
A = list(map(int, input().split()))

S = []
sum_ = 0
for i in range(N):
    sum_ += A[i]
    S.append(sum_)

def search(s, prev_S, l=0, r=N):
    # return maximum i with (S[i]-prev_S <= s) and (l <= i < r)
    if r-l <= 1:
        return l
    m = l + (r-l)//2
    if S[m] - prev_S > s:
        return search(s, prev_S, l, m)
    else:
        return search(s, prev_S, m, r)


min_ = 10**20
for i in range(1, N-2):
    if i == 3:
        flag = True
    else:
        flag = False
    li = search(S[i]/2, 0, 0, i+1)
    ri = search((S[N-1]-S[i])/2, S[i], i+1, N)
    candidates = [(li, i, ri),   (li+1, i, ri),
                  (li, i, ri+1), (li+1, i, ri+1)]
    for p, q, r in candidates:
        # debug(p, q, r)
        if r >= N:
            continue
        P = S[p]
        Q = S[q] - S[p]
        R = S[r] - S[q]
        S_ = S[N-1] - S[r]
        cur_min = min(P, Q, R, S_)
        cur_max = max(P, Q, R, S_)
        min_ = min(min_, cur_max-cur_min)
    # debug(li, i, ri, min_)

print(min_)


Measured memory_bytes: 130328
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1e18;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 305;

int dp[MX][MX][MX];

int main() {
  string s;
  cin>>s;
  int n = sz(s);
  int m;
  scanf("%d",&m);
  string t = s; reverse(rng(t));
  int mx = n-1;
  int ans = 0;
  rep(i,n+1)rep(j,n+1)rep(k,m+1) {
    maxs(ans, dp[i][j][k]);
    if (i+j > mx) continue;
    maxs(dp[i+1][j][k], dp[i][j][k]);
    maxs(dp[i][j+1][k], dp[i][j][k]);
    int x = (i+j == mx)?1:2;
    if (s[i] == t[j]) {
      maxs(dp[i+1][j+1][k], dp[i][j][k]+x);
    } else {
      maxs(dp[i+1][j+1][k+1], dp[i][j][k]+x);
    }
  }
  cout<<ans<<endl;
  return 0;
}






















Measured memory_bytes: 110848
#include <iostream>
#include <iomanip>
#include <ios>
#include <string>
using namespace std;
int main(void){
  string s;
  cin >> s;
  int n = s.length();
  
  int g = 0;
  int p = 0;
  int ans = 0;
  
  for(int i=0;i<n;i++){
    char hand;
    if(p == g){
      hand = 'g';
      g++;
    }
    else{
      hand = 'p';
      p++;
    }
    
    if(hand == 'p' && s[i] == 'p');
    else if(hand == 'g' && s[i] == 'g');
    else if(hand == 'p' && s[i] == 'g'){
      ans ++;
    }
    else if(hand == 'g' && s[i] == 'p'){
        ans--;
    }

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


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


int main() {
	
	int n;
	cin >> n;
	set<int> u;
	int a = 0;
	for (int i=0; i<n; i++) {
		int x;
		cin >> x;
		x = -x;
		if (u.lower_bound(x) == u.end()) a++;
		u.insert(x);
	}
	
	cout << a << endl;
	
}


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

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;

template<class T,class U> void chmax(T& a, U b) {if(a<b)a=b;}
template<class T,class U> void chmin(T& a ,U b) {if(b<a)a=b;}

int main() {

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    set<int> s;
    s.insert(2);
    for (int i= 3; i < 2000; i++) {
        bool ok = true;
        for(auto e : s) {
            if (i % e == 0) {
                ok = false;
                break;
            }
        }
        if (ok) {
            // cout << i << endl;
            s.insert(i);
        }
    }

    ll x;
    cin >> x;
    for (int i = x;; i++) {
        bool ok = true;
        for (auto e: s) {
            if (e >= i) break;
            if (i % e == 0) {
                ok = false;
                break;
            }
        }
        if (ok) {
            cout << i << endl;
            break;
        }
    }
    // cout << *(s.lower_bound(x)) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline ll read() {
    ll x=0,f=1; char ch=getchar();
    for(;ch<'0'||ch>'9';ch=getchar())
        if(ch=='-')f=-f;
    for(;ch>='0'&&ch<='9';ch=getchar())
        x=x*10+ch-'0';
    return x*f;
}
inline void chkmin( int &a,int b ) { if(a>b) a=b; }
inline void chkmax( int &a,int b ) { if(a<b) a=b; }
#define _ read()
int vis[105][105],tot;
int main() {
	int n=_;
	if(n&1) {
		// for( int i=1;i<n;i++ ) printf("%d %d\n",n,i),vis[n][i]=1;
		for( int i=1;i<=n;i++ )
			for( int j=i+1;j<=n;j++ )
				if(i!=j&&(n-i)!=j)
					vis[i][j]=1,++tot;
		cout<<tot<<"\n";
		for( int i=1;i<=n;i++ )
			for( int j=1;j<=n;j++ )
				if(vis[i][j]) printf("%d %d\n",i,j);
	}else {
		for( int i=1;i<=n;i++ )
			for( int j=i+1;j<=n;j++ )
			if(j!=n-i+1) vis[i][j]=1,tot++;
		cout<<tot<<"\n";
		for( int i=1;i<=n;i++ )
			for( int j=1;j<=n;j++ )
				if(vis[i][j]) printf("%d %d\n",i,j);
	}
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String str = reader.readLine();
			String[] arr = str.split(" ");
			int a = Integer.parseInt(arr[0]);
			int b = Integer.parseInt(arr[1]);
		
			if(a < b) {
				System.out.println("a < b");
			} else if (a > b) {
				System.out.println("a > b");
			} else {
				System.out.println("a == b");
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}

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

int main(){
  int i,j,cnt=0;
  int n;
  cin>>n;
  int c[n],s[n],f[n];
  for(i=0;i<n-1;i++)cin>>c[i]>>s[i]>>f[i];
  int x[n];
  for(j=0;j<n-1;j++){
    x[j]=s[j];
    for(i=j+1;i<n-1;i++){
      if(x[i-1]+c[i-1]<=s[i])x[i]=s[i];
      else x[i]=((x[i-1]+c[i-1]+f[i]-1)/f[i])*f[i];
    }
    x[n-1]=x[n-2]+c[n-2];
    cout<<x[n-1]<<endl;
  }
  cout<<0<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <set>
#include <sstream>
#include <string>
#include <queue>
#include <vector>
using namespace std;

#define rep(i,n) for(int i=0; i<(n); ++i)
#define rrep(i,n) for(int i=1; i<=(n); ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define foreach(it, v) for(typeof(v.begin()) it=v.begin(); it!=v.end(); ++it)
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second

typedef unsigned int uint;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef set<int> si;

//MOD//
const ll MOD = 1000000007;
struct big;
big ex(big a, ll tms);
typedef struct big{
  ll val;
  big():val(0){}
  big(ll val):val((val%MOD+MOD)%MOD){}
  big& operator += (const big& obj){ (val+=obj.val)%=MOD; return *this;}
  big& operator -= (const big& obj){ (val+=MOD-obj.val)%=MOD; return *this;}
  big& operator *= (const big& obj){ (val*=obj.val)%=MOD; return *this;}
  big& operator /= (const big& obj){ (val*=ex(obj,MOD-2).val)%=MOD; return *this;}
  big operator + (const big& obj)const{ return big(*this) += obj;}
  big operator - (const big& obj)const{ return big(*this) -= obj;}
  big operator * (const big& obj)const{ return big(*this) *= obj;}
  big operator / (const big& obj)const{ return big(*this) /= obj;}
  bool operator < (const big& obj)const{ return val < obj.val;}
  bool operator == (const big& obj)const{ return val == obj.val;}
} big;
istream& operator >> (istream& i, big& obj){ i>>obj.val; return i;}
ostream& operator << (ostream& o, const big& obj){ o<<obj.val; return o;}
big ex(big obj, ll tms){
  if(!tms) return 1;
  big ret = ex(obj, tms/2);
  ret *= ret;
  return (tms&1) ? ret*obj : ret;
}
//MOD//

ll pow(ll n, int m){
  if(!m) return 1;
  ll ret = pow(n, m/2);
  ret *= ret;
  return (m&1) ? ret*n : ret;
}

template <class F, class T>
void convert(const F &f, T &t){
  stringstream ss;
  ss << f;
  ss >> t;
}

int A, B, C;

int main(){
  scanf("%d%d%d",&A,&B,&C);
  int ans = 0;
  if (A+B+1 >= C) {
    ans = B + C;
  } else {
    ans = (A+B+1)+B;
  }
  cout << ans << endl;
  return 0;
}


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

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

using namespace std;

class mint{
	static const int MOD=1e9+7; // 998244353;
	int x;
public:
	mint():x(0){}
	mint(long long y){ x=y%MOD; if(x<0) x+=MOD; }

	mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; }
	mint& operator-=(const mint& m){ x-=m.x; if(x<   0) x+=MOD; return *this; }
	mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; }
	mint& operator/=(const mint& m){ return *this*=m.inverse(); }
	mint operator+(const mint& m)const{ return mint(*this)+=m; }
	mint operator-(const mint& m)const{ return mint(*this)-=m; }
	mint operator*(const mint& m)const{ return mint(*this)*=m; }
	mint operator/(const mint& m)const{ return mint(*this)/=m; }

	mint inverse()const{
		int a=x,b=MOD,u=1,v=0;
		while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); }
		return u;
	}

	friend ostream& operator<<(ostream& os,const mint& m){ return os<<m.x; }
	int to_int()const{ return x; }
};

mint fact[100002],finv[100002];

mint nCr(int n,int r){
	return r<=n?fact[n]/fact[r]/fact[n-r]:0;
}

int main(){
	fact[0]=finv[0]=1;
	rep(i,1e5+1){
		fact[i+1]=fact[i]*(i+1);
		finv[i+1]=finv[i]/(i+1);
	}

	int n; cin>>n;
	vector<int> a(n+1),pos(n,-1);
	int l,r;
	rep(i,n+1){
		cin>>a[i]; a[i]--;
		if(pos[a[i]]!=-1){
			l=pos[a[i]];
			r=i;
		}
		pos[a[i]]=i;
	}

	for(int k=1;k<=n+1;k++){
		cout<<nCr(n+1,k)-nCr(l+(n-r),k-1)<<endl;
	}

	return 0;
}


Measured memory_bytes: 2816
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <math.h>
#include <algorithm> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll INF = 1000000000000000000LL;
using namespace std;

const int MOD = 1000000007;

int main(){
    ll N,K,S;
    cin >> N >> K >> S;

    REP(i,N)
    {
        if(i < K)
        {
            cout << S << " ";
        }
        else 
        {
            if(S < 1000000000)
            {
                cout << S+1 << " ";
            }
            else
            {
                cout << 1 << " ";
            }
            
        }


    }

    return 0;    
}


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

ll n, k;

int main()
{
  cin >> n >> k;
  ll res = n;
  res = min(res, min(n % k, k - (n % k)));
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using static System.Math;


class P
{
    static void Main()
    {
        int L = int.Parse(Console.ReadLine());
        //特定の区間について奇数の増加をもたせられる
        //0がある場合話が変わってくるんだよなあ
        //全区間に対して偶数撒いて、どっかを奇数だけ減らす?
        //偶数撒きをする際は、0を作るべき区間に注意
        //0はコスト2かかる
        //とりあえず0撒いて
        //奇数が
        //端から奇数をまきたい
        //0の向こう側
        int[] a = Enumerable.Repeat(0, L).Select(_ => int.Parse(Console.ReadLine())).ToArray();
        //dp[i][0,1,2,3,4]
        //iまで見た[まだ初めてない,偶数パート1,奇数,偶数パート2,ア]
        long[][] dp = Enumerable.Repeat(0, L).Select(_ => new long[5]).ToArray();
        //0 -> 1,2,3,4
        //1 -> 2,3,4
        //2 -> 3,4
        //3 -> 4


        dp[0][0] = a[0];
        dp[0][1] = a[0] == 0 ? 2 : a[0] % 2;
        dp[0][2] = (a[0] + 1) % 2;
        dp[0][3] = dp[0][1];
        dp[0][4] = a[0];
        for (int i = 1; i < a.Length; i++)
        {
            dp[i][0] = dp[i - 1][0] + a[i];
            dp[i][1] = Min(dp[i - 1][0], dp[i - 1][1]) + (a[i] == 0 ? 2 : a[i] % 2);
            dp[i][2] = Min(Min(dp[i - 1][0], dp[i - 1][1]), dp[i - 1][2]) + (a[i] + 1) % 2;
            dp[i][3] = Min(Min(dp[i - 1][0], dp[i - 1][1]), Min(dp[i - 1][2], dp[i - 1][3])) + (a[i] == 0 ? 2 : a[i] % 2);
            dp[i][4] = Min(Min(Min(dp[i - 1][0], dp[i - 1][1]), Min(dp[i - 1][2], dp[i - 1][3])), dp[i - 1][4]) + a[i];
        }
        Console.WriteLine(dp.Last().Min());
    }
}


Measured memory_bytes: 41552