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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii; typedef vector<ll> VL; const int MD = 998244353;
void dbg(){cerr<<"\n";} template <class F,class ...S> void dbg(const F& f, const S&...s){cerr <<f <<": "; dbg(s...);}

vector<int> fct, inv;
void finit(int cmx, ll mod =MD){
	fct.resize(cmx+20); inv.resize(cmx+20);
	fct[0] = fct[1] = inv[1] = inv[cmx] = 1;
	for(int i=2;i<cmx+3;i++) fct[i] = (ll)fct[i-1] * i % mod;
	for(ll x=fct[cmx], n=mod-2; n > 0; n >>=1, x = x*x %mod)
		if(n & 1) inv[cmx] = (ll)inv[cmx] * x %mod;
	for(int i=cmx;i>=1;i--) inv[i-1] = (ll)inv[i] * i % mod;
}
ll nCk(ll n, ll k, ll mod =MD) {
	if(k > n || n <0 || k <0) return 0;
	ll ret = (ll)fct[n] * inv[k] % mod * inv[n-k] % mod;
	return ret;
}
ll mod_pow(ll x, ll n, ll mod){
	if(n==0) return 1;
	ll res = mod_pow(x * x % mod, n / 2, mod);
	if(n & 1) res = res * x % mod;
	return res;
}
int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, m, k;
	cin >>n >>m >>k;
	
	finit(n+5);
	ll ans = 0;
	rep(i, k+1){
		ll w = m * mod_pow(m-1, n-1-i, MD) %MD;
		(ans += (w * nCk(n-1, i))%MD )%=MD;
	}
	cout <<ans <<"\n";
	return 0;
}


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

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

Measured memory_bytes: 3620
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

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

count = 0
for i in range(N):
    # 倒しきらずに途中で力尽きる or 相打ち
    if A[i] >= B[i]:
        count += B[i]
    else:
        # 余力あり
        count += A[i]
        B[i] -= A[i]

        # 残機でi+1を処理
        if A[i+1] >= B[i]:
            A[i+1] -= B[i]
            count += B[i]
        else:
            count += A[i+1]
            A[i+1] = 0


print(count)

Measured memory_bytes: 19228
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
 
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
 
using namespace std;
 
signed main()
{
    fast;
    int a,b;

    cin>>a>>b;

    cout<<a*b/(__gcd(a,b))<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/priority_queue.hpp>
#include<unordered_map>
#define rep(i,j,k) for( int i=j;i<=k;i++)
#define rrep(i,j,k) for( int i=j;i>=k;i--)
#define erep(i,u) for( int i=head[u];~i;i=nxt[i])
#define fastIO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using P  = pair<ll,ll>;
const int MAXN = 1e6+11;
const int INF  = 0x3f3f3f3f;
const double EPS = 1e-7;
int a[MAXN],n;
int main(){
    fastIO;
    while(cin>>n){
        rep(i,1,n) cin>>a[i];
        ll ans=0;
        for(int l=1,r=0,sum=0;l<=n;l++){
            while(r<n&&(sum^a[r+1])==sum+a[r+1]) sum+=a[++r];
            ans+=r-l+1;
            sum^=a[l];
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a[3];
    for(int i=0; i<3; i++)
        scanf("%d", a+i);
    sort(a, a+3);
    printf("%d\n", a[1]-a[0]+a[2]-a[1]);
    return 0;
}


Measured memory_bytes: 256
import bisect
import itertools
n, k= map(int, input().split())

bucket = [0]*(10**5+1)
for i in range(n):
    a, b = map(int,input().split())
    bucket[a] += b
lst = list(itertools.accumulate(bucket))
print(bisect.bisect_left(lst, k))

Measured memory_bytes: 10748
#include <algorithm>
#include <utility>
#include <iostream>
using namespace std;
int N, M, v;
int main(){
  while (cin >> N >> M && N>0) {
    pair<int,int> a[M];
    int b[100] = {};
    for (int i=0; i<N; i++){
      for (int j=0; j<M; j++){
	cin >> v;
	b[j] -= v;
      }
    }
    for (int i=0; i<M; i++)
      a[i] = make_pair(b[i], i+1);
  sort(a, a+M);
  for (int i=0; i<M; i++){
    if (i != M-1)
      cout << a[i].second << " ";
    else
      cout << a[i].second;
  }
  cout << endl;
  }
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ll long long
#define PINT pair<int,int>
#define f1 first
#define s2 second
const int INF = 1e9 + 7;

using namespace std;

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

    int n,C;
    cin >> n >> C;
    vector<int> s(n),t(n),c(n);
    REP(i,n) cin >> s[i] >> t[i] >> c[i];

    vector<int> tt(100001*2),used(100001*2,0);
    FOR(j,1,C+1){
        REP(i,200002) tt[i]=0;
        REP(i,n) if(c[i]==j) ++tt[s[i]*2-1],--tt[t[i]*2];
        FOR(i,1,200002) tt[i]+=tt[i-1];
        REP(i,200002) if(tt[i]) ++used[i];
    }

    int ans=0;
    REP(i,200002) ans=max(used[i],ans);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3072
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
 
#define N 10
#define C 10000
 
long n, a, b;  

int main(){
    scanf("%ld %ld %ld",&n, &a, &b);

    long c, d, d1;
    c = n/(a+b);
    d = n%(a+b);
    if (d<=a){
        d1 = d;
    }
    else{
        d1 = a;
    }

    printf("%ld\n", c*a+d1); 
    return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repeq(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define rep1eq(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int cnt=0,max_,mid_,min_;
    rep1(i,1,n-1){
        max_ = max({p[i],p[i+1],p[i-1]});
        min_ = min({p[i],p[i+1],p[i-1]});
        if(p[i]!=max_ && p[i]!=min_) cnt++;
    }
    cout << cnt << endl;
    return 0;
    
}

Measured memory_bytes: 256
#include<string>
#include<iostream>

using namespace std;

const int hashJOI='I'+('O'+('J')*26)*26;
const int hashIOI='I'+('O'+('I')*26)*26;

int main()
{
	for(string s;cin>>s;){
		int len=s.length(),hash=0,joi=0,ioi=0;
		for(int i=0;i<2;i++)	hash=hash*26+s[i];
		for(int i=2;i<len;i++){
			hash=hash*26+s[i];
			if(hash==hashJOI)	joi++;
			if(hash==hashIOI)	ioi++;
			hash-=s[i-2]*26*26;
		}
		cout<<joi<<endl<<ioi<<endl;
	}
	return 0;
}

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

const int Nmax=200010;

int main() {
	string s;
	int x,y,fnokazu[8001]={};
	bool dpX[4001][16002]={false},dpY[4001][16002]={false}; //何回目に座標何にいることは可能か
	cin >> s >> x >> y;
	int j=0,cnt=0;
	for(int i=0;i < s.length();i++){
		if(s[i] == 'T'){
			fnokazu[j] = cnt;
			j++;
			cnt = 0;
		}else cnt++;
	}
  	fnokazu[j]=cnt;
	dpX[0][8000+fnokazu[0]] = true;
	dpY[0][8000+fnokazu[1]] = true;
  	dpY[0][8000-fnokazu[1]] = true;
	int cnX=1,cnY=1;
	for(int i=2;i <= j;i++){
		if(i%2 == 0){
			for(int k=-8000;k <= 8000;k++){
				dpX[cnX][8000+k] = dpX[cnX-1][8000+k-fnokazu[i]] || dpX[cnX-1][8000+k+fnokazu[i]];
			}	
			cnX++;
		}else{
			for(int k=-8000;k <= 8000;k++){
				dpY[cnY][8000+k] = dpY[cnY-1][8000+k-fnokazu[i]] || dpY[cnY-1][8000+k+fnokazu[i]];
			}
			cnY++;
		}
    }

	if(dpX[cnX-1][8000+x] && dpY[cnY-1][8000+y]) cout << "Yes" << endl;
	else cout << "No" << endl;
			
	return 0;
}

Measured memory_bytes: 125312
gets
arr = gets.split.map { |s| i = s.to_i; i%4 == 0 ? 2 : i%2 == 0 ? 1 : 0 }
count = arr.each_with_object(Hash.new(0)) { |i, h| h[i] += 1 }
count[0] += 1 if count[1] > 0
puts count[2] >= count[0] - 1 ? 'Yes' : 'No'


Measured memory_bytes: 8452
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

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

		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] P = new int[N];
		String[] ans = new String[M];

		Map<Integer, List<Integer>> citys = new TreeMap<>();

		for(int i=0;i<M;i++) {
			int n = sc.nextInt();
			int y = sc.nextInt();
			List<Integer> info = new ArrayList<>();
			info.add(n);
			info.add(i);
			citys.put(y, info);
		}

		for(int key : citys.keySet()) {
			List<Integer> c = citys.get(key);
			ans[c.get(1)] = String.format("%06d%06d", c.get(0),++P[c.get(0)-1]);
		}

		for(String a : ans) {
			System.out.println(a);
		}

		sc.close();


	}
}


Measured memory_bytes: 188900
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

string a;
cin >> a;

rep(i,sz(a))
{
  if(a[i] == '1')
    a[i] = '9';
  else if(a[i] == '9')
    a[i] = '1';
}
  cout << a;

  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);
const int limit = 200010;

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    if (b < a) cout << a - 1 << endl;
    else cout << a << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int count=0;
  string a,b;
  cin>>a>>b;
  for(int i=0;i<3;i++)
  { if(a[i]==b[i])
    count++;
  }
  cout<<count;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  vector<ll> A(N);
  for(int i=0;i<N;++i) cin>>A[i];
  sort(A.begin(), A.end(), greater<ll>());
  ll ans1 = A[0];
  ll ans2 = A[1];
  for(int i=2;i<N;++i) {
    if(abs(ans1-ans2*2)>abs(ans1-A[i]*2)) ans2 = A[i];
  }
  cout<<ans1<<" "<<ans2<<endl;
}



Measured memory_bytes: 4032
n = int(input())
array = [int(input()) for i in range(n)]

max1 = max(array)  
max1count = array.count(max1)

array2 = array[:]  
array2.remove(max1)
max2 = max(array2)

for e in array:
    if e != max1:
        print(max1)
    else:
        if 1 < max1count:
            print(max1)
        else:
            print(max2)

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

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s; cin >> s;
  int a = -1, z = -1;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == 'Z') z = i;
    if (a == -1 && s[i] == 'A') a = i;
  }
  if (a == -1 || z == -1) return !printf("0");
  cout << z-a+1;
  return 0;
}

Measured memory_bytes: 720
import heapq
N,M=map(int,input().split())
A = list(map(int,input().split()))
heapq.heapify(A)
l = [] 
for i in range(M):
  tmp = list(map(int,input().split()))
  l.append([tmp[1],tmp[0]])
l.sort(reverse=True)


for i,j in l:
  for I in range(j):
    Q = heapq.heappop(A)
    if Q<i :
      heapq.heappush(A,i)
    else:
      heapq.heappush(A,Q)
      break
# print(A)
print(sum(A))

Measured memory_bytes: 24520
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int N,L;
    string ANS;
    cin>>N>>L;
    vector<string>S(N);
    for(int i=0;i<N;i++){
        cin>>S[i];
    }
    sort(S.begin(),S.end());
    ANS=S[0];
    for(int i=1;i<N;i++){
        ANS+=S[i];
    }
    cout<<ANS<<endl;
    return 0;
}


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

using namespace std;

#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;

// 45106 - 111


void oneCase() {
   double r, g;
   cin >> r >> g;
   cout << r + (g - r) * 2 << "\n";
}


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

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr[] = new int[n];
		double d =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextInt();
			d+=(1.0/arr[i]);
		}	
		System.out.println(1.0/d);
	}
}

Measured memory_bytes: 21844
use std::io;
use std::str::FromStr;

fn input_tuple() -> (u64, u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1], vec[2])
}

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn main() {
    let (mut a, mut b, mut c)= input_tuple();
    let mut k: u64 = input();
    while k > 0 && b <= a {
        b *= 2;
        k -= 1;
    }
    if b <= a {
        println!("No");
        return;
    }
    while k > 0 && c <= b {
        c *= 2;
        k -= 1;
    }
    if c <= b {
        println!("No");
        return;
    }
    println!("Yes");
}


Measured memory_bytes: 2136
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001000
#define mod 1000000007
#define pi 3.1415926535
using namespace std;

int main(void){
    ll n;
    cin>>n;
    ll now = 0;
    ll root = 0;
    while(root<n){
        now++;
        root += now;
    }
    cout<<now<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& base) {
    for (T const& i : base) {
        out << i << ' ';
    }
    return out;
}
long solve(int N, int W, vector<int>& values, vector<int>& weights) {
    long DP[W + 1];
    memset(DP, 0, sizeof DP);
    DP[weights[0]] = values[0];
    for (int i = 1; i < N; ++i) {
        for (int w = W; w >= 0; --w) {
            if (w >= weights[i]) {
                DP[w] = max(DP[w], values[i] + DP[w - weights[i]]);
            }
        }
    }
    return *max_element(DP, DP + W + 1);
}
int main() {
    int N, W;
    cin >> N >> W;
    vector<int> values(N), weights(N);
    for (int i = 0; i < N; ++i) {
        cin >> weights[i] >> values[i];
    }
    cout << solve(N, W, values, weights) << endl;
}

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

int main() {
  int a,b; cin >> a >> b;
  if(a<=8&&b<=8) cout << "Yay!" << endl;
  else cout << ":(" << endl;
  return 0;
}


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

int main() {
	const int NEXT_A = 'z' + 1;
	string s;
	cin >> s;
	int K;
	cin >> K;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] != 'a' && NEXT_A - s[i] <= K) {
			K -= NEXT_A - s[i];
			s[i] = 'a';
		}
	}
	int end_char = s[s.size() - 1] - 'a';
	end_char = (end_char + K) % 26 + 'a';
	s[s.size() - 1] = end_char;
	cout << s << endl;
	return 0;
}

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

int main()
{
    int W, H, N;
    cin >> W >> H >> N;

    int x_min = 0;
    int x_max = W;
    int y_min = 0;
    int y_max = H;

    int x, y, a;
    for (int i = 0; i < N; i++)
    {
        cin >> x >> y >> a;
        switch (a)
        {
        case 1:
            x_min = max(x_min, x);
            break;
        case 2:
            x_max = min(x_max, x);
            break;
        case 3:
            y_min = max(y_min, y);
            break;
        case 4:
            y_max = min(y_max, y);
            break;
        default:
            break;
        }
    }
    if (x_min > x_max || y_min > y_max)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << (x_max - x_min) * (y_max - y_min) << endl;
    }
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

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

class TaskC {
 public:
  void solve(std::istream &in, std::ostream &out) {
    int N, M;
    in >> N >> M;
    out << (1900 * M + 100 * (N - M)) * pow(2, M);
  }
};


int main() {
  TaskC solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

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

	String[][] button = {{""},{".",",","!","?"," "},{"a","b","c"},{"d","e","f"},
			     {"g","h","i"},{"j","k","l"},{"m","n","o"},{"p","q","r","s"},
			     {"t","u","v"},{"w","x","y","z"}};
	
	int n = sc.nextInt();
	while(n!=0){
	    String line = sc.next();
	    System.out.println (solve(button,line));
	    n--;
	}
    }

    public static String solve(String[][] button, String line){
	String mozi = "";

	for(int i=0; i<line.length(); i++){
	    int buttonNum = Integer.parseInt(line.substring(i,i+1));
	    String letter = Integer.toString(buttonNum);
	    int renzoku = 0;

	    for(;;){
		if(buttonNum == 0){break;}
		else if(letter.equals(line.substring(i+1,i+2))){
		    renzoku++; i++;
		}
		else{
		    renzoku = renzoku%button[buttonNum].length;
		    mozi += button[buttonNum][renzoku];
		    break;
		}
	    }
	}
	return mozi;
    }
}

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

#define rep(i,a,b) for(auto (i)=a;i<b;i++)
#define list(i,N) for(auto (i)=0;i<N;i++)

typedef long long ll;

#define int ll
#define INF 1e9+5
#undef int
int main(){

	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

#define int ll
	int N; cin >> N;
	int K; cin >> K; //K = 2;
	int H[N]; list(i,N) cin >> H[i];
	int dp[N];
	list(i,N) dp[i]=INF;
	dp[0]=0;
	list(i,N){
		for(int j=i+1;j<=i+K&&j<N;j++) dp[j] = min(dp[i]+abs(H[i]-H[j]),dp[j]);
	}
	cout << dp[N-1];
	return 0;
}


Measured memory_bytes: 1792
import java.util.Scanner;


public class Main {
	
	static final int MAX = 150;
	
	public Main() {
		Scanner scanner = new Scanner(System.in);
		while(scanner.hasNext()) {
			int h = scanner.nextInt();
			int w = scanner.nextInt();
			if(h==0 && w==0) break;
			int size = h*h + w*w;
			int miny = Integer.MAX_VALUE;
			int minx = Integer.MAX_VALUE;
			int mins = Integer.MAX_VALUE;
			for(int y=1;y<=MAX; y++) {
				for(int x=y+1; x<=MAX; x++) {
					int s = y*y+x*x;
					if(s > size || (s == size && y > h)) {
						if(s < mins) {
							mins = s;
							miny = y;
							minx = x;
						} else if(mins == s) {
							if(y < miny) {
								miny = y;
								minx = x;
							}
						}
						
					}
				}
			}
			System.out.println(miny + " "+ minx);
		}
		scanner.close();
	}
	
	public static void main(String[] args) {
		new Main();
	}
	

}

Measured memory_bytes: 20460
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
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;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n,l;
    cin >> n >> l;
    int sum = 0;
    rep(i,n) sum += l+i;
    if(l > 0) sum -= l;
    else if(l+n-1 < 0) sum -= l+n-1;
    cout << sum << endl;
}


Measured memory_bytes: 256
n = int(input())
l = [[] for _ in range(n)]

for i in range(n):
    a = int(input())
    for j in range(a):
        x,y = map(int,(input().split()))
        l[i].append([x-1,y])

ans = 0
for i in range(1 << n):
    h = []
    for j in range(n):
        h.append(i & 1 << j != 0)
    b = True
    for j in range(n):
        if i & (1 << j) != 0:
            for k in l[j]:
                if (k[1] == 1) != h[k[0]]:
                    b = False
                    break
        if not b:
            break
    
    if b:
        x = 0
        for j in range(n):
            if i & 1 << j:
                x += 1
        ans = max(ans,x)

print(ans)
        


Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
			var HW = Console.ReadLine().Split().Select(int.Parse);
			int H = HW.First(), W = HW.Last();
			var a = new string[H];
			for (int i = 0; i < H; i++)
			{
				a[i] = Console.ReadLine();
			}
			for (int i = 0; i < H; i++)
			{
				if (!a[i].ToCharArray().Any(c => c == '#'))
				{
					continue;
				}
				for (int j = 0; j < W; j++)
				{
					bool flg = false;
					for (int k = 0; k < H; k++)
					{
						flg |= a[k][j] == '#';
					}
                    if (flg)
					{
						Console.Write(a[i][j]);
					}
				}
				Console.WriteLine();
			}
        }
    }
}


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

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int[] A = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();
            int[] B = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();
            int[] C = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();
            int result = B[0];
            for (int i = 1; i < N; ++i)
            {
                result = result + B[i];

                if (A[i] == A[i - 1] + 1)
                {
                    result = result + C[A[i-1]-1];
                }
            }
            Console.WriteLine(result);
        }   
    }
}


Measured memory_bytes: 13268
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let D: usize = sc.get();
    let c: Vec<i64> = sc.vec(26);
    let s: Vec<Vec<i64>> = sc.mat(D, 26);
    let mut last = vec![0; 26];
    let mut ans = Vec::new();
    for d in 0..D {
        let mut max_score_d = 0;
        let mut max_t = 0;
        let mut last_d = last.clone();
        for t in 0..26 {
            let mut score_d = 0;
            score_d += s[d][t];
            last_d[t] = d as i64 + 1;
            for i in 0..26 {
                score_d -= c[i] * (d as i64 + 1 - last_d[i]);
            }
            if max_score_d < score_d {
                max_score_d = score_d;
                max_t = t;
            }
        }
        last[max_t] = d as i64 + 1;
        ans.push(max_t);
    }
    for d in 0..D {
        println!("{}", ans[d] + 1);
    }
}


Measured memory_bytes: 2284
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

// rep(i, 100) { cout << i << endl; } => 0 1 2 ... 99
#define rep(i, n) for(int i = 0, i##_len = (n); i < (int)n; i++)

// std::sort(all(v));
#define all(x) (x).begin(), (x).end()

// long long int
using ll = long long;

// utility to cast return value of size function to int
#define SZ(x) ((int)(x).size())

// VS defines "_DEBUG" macro when debug configuration.
#if _DEBUG
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define dump(x)
#define debug(x)
#endif

// update max
template<class T>bool chmax(T & prov, const T & cur)
{
	if (cur > prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

// update min
template<class T>bool chmin(T & prov, const T & cur)
{
	if (cur < prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

int main()
{
	int N, M;
	cin >> N >> M;
	vector<ll> H(N, 0);
	/*
	vector<ll*> h_ptr(N, nullptr);
	rep(i, N)
	{
		h_ptr[i] = &H[i];
	}
	*/
	rep(i, N)
	{
		ll h;
		cin >> h;
		H[i] = h;
	}

	// sort(h_ptr.begin(), h_ptr.end(), [](const ll* a, const ll* b) { return *a < *b; });

	vector<bool> is_good(N, true);

	rep(i, M)
	{
		ll a, b;
		cin >> a >> b;
		ll A = a - 1;
		ll B = b - 1;
		if (H[A] < H[B])
		{
			is_good[A] = false;
		}
		else if (H[B] < H[A])
		{
			is_good[B] = false;
		}
		else
		{
			is_good[A] = false;
			is_good[B] = false;
		}
	}

	int ans = 0;
	rep(i, N)
	{
		if (is_good[i])
		{
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4052
n, k = map(int, input().split())
B = [[0]*k for i in range(k)]
W = [[0]*k for i in range(k)]
for i in range(n):
    x, y, c = input().split(); x = int(x); y = int(y)
    x %= 2*k; y %= 2*k
    if (k <= x) == (k <= y):
        (B if c == 'B' else W)[y%k][x%k] += 1
    else:
        (W if c == 'B' else B)[y%k][x%k] += 1
def calc(M, n):
    D = [[0]*(n+1) for i in range(n+1)]
    for i in range(1, n+1):
        tmp = 0
        for j in range(1, n+1):
            tmp += M[i-1][j-1]
            D[i][j] = tmp + D[i-1][j]
    return D

# [a, c) * [b, d)
def su(D, a, b, c, d):
    return D[d][c] - D[d][a] - D[b][c] + D[b][a]

DB = calc(B, k)
DW = calc(W, k)
ans = 0
for i in range(k):
    for j in range(k):
        ans = max(ans, su(DB, 0, 0, i, j) + su(DB, i, j, k, k) + su(DW, i, 0, k, j) + su(DW, 0, j, i, k))
        ans = max(ans, su(DW, 0, 0, i, j) + su(DW, i, j, k, k) + su(DB, i, 0, k, j) + su(DB, 0, j, i, k))
print(ans)


Measured memory_bytes: 83928
fold -1|awk '{/R/?R[++i]=NR:/G/?G[++j]=NR:b+=B[NR]=/B/}END{for(i in R)for(j in G)a+=b-B[2*(r=R[i])-(g=G[j])]-B[2*g-r]-B[(r+g)/2];printf "%.f",a;}'

Measured memory_bytes: 6320
#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <climits>
#include <map>
#include <functional>
#include <cmath>
#include <cassert>

using namespace std;

int main()
{
    long N;
    long K;
    cin >> N >> K;
    map<int,long> m;
    for (int i = 0; i < N; i++) {
        int a, b;
        cin >> a >> b;
        m[a] += b;
    }
    int ans;
    for (auto it = m.begin(); it != m.end(); it++) {
        if (it->second >= K) {
            ans = it->first;
            break;
        }
        K -= it->second;
    }
    cout << ans << endl;
    return 0;
}

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

typedef long long ll;

int main()
{
	int n; cin >> n;
	ll res = 0;
	for(int i = 1; i <= n; i++) res += 1ll * i * (n - i + 1);
	for(int i = 1; i < n; i++) {
		int a, b; cin >> a >> b;
		if(a > b) swap(a, b);
		res -= 1ll * a * (n - b + 1);
	}
	cout << res << endl;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    vll a(n);
    rep(i,n) cin>>a[i];
    vll rg(n), g(n);
    g[0]=a[0]; rg[n-1]=a[n-1];
    rep(i,n-1){
        g[i+1]=__gcd(g[i],a[i+1]);
    }
    rep(i,n-1){
        rg[n-2-i]=__gcd(rg[n-1-i],a[n-2-i]);
    }
    ll ans = g[n-1];
    rep(i,n){
        if (i==0) ans = max(ans,rg[i+1]);
        else if(i==n-1) ans = max(ans,g[i-1]);
        else{
            ans = max(ans,__gcd(g[i-1],rg[i+1]));
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h> 
using namespace std; 
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define INF 1000000000
#define MOD 1000000007
#define pb push_back
#define ve vector<ll>
#define dos pair<ll,ll>
#define vedos vector<dos>
#define rand mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define EPS 0.000001
struct greateri
{
    template<class T>
    bool operator()(T const &a, T const &b) const { return a > b; }
};
void setIO(string s) {
  ios_base::sync_with_stdio(0); cin.tie(0); 
  freopen((s+".in").c_str(),"r",stdin);
  freopen((s+".out").c_str(),"w",stdout);
}
#define MAXN   10000001 
ll spf[MAXN]; 
void sieve() 
{ 
    spf[1] = 1; 
    for (ll i=2; i<MAXN; i++) 
        spf[i] = i; 
    for (ll i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (ll i=3; i*i<MAXN; i++) 
    { 
        if (spf[i] == i) 
        { 
            for (ll j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 
ll getFactorization(ll x) 
{ 
    ll ret=1; 
    ll last=-1;
    ll num=0;
    while (x != 1) 
    { 
        if(spf[x]!=last){
          ret*=(num+1);
          last=spf[x];
          num=1;
        }
        else num++;
        x = x / spf[x]; 
    } 
    ret*=(num+1);
    return ret; 
} 
int main()
{
  flash;
  sieve();
  ll n;
  cin>>n;
  ll ans=0;
  for (ll i = 1; i <= n; ++i)
  {
    ans+=getFactorization(i)*i;
  }
  cout<<ans;
  return 0;
}
//code the AC sol !
// BS/queue/map

Measured memory_bytes: 81776
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	int x, a;
	cin >> x >> a;
	if(x<a){
		cout << 0 << endl;
	} else {
		cout << 10 << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using namespace std;
int main(){
    long long n,a[4];
    cin >> n;
    a[1] = n/100;
    n -= (n/100)*100;
    a[2] = n/10;
    n -= (n/10)*10;
    a[3] = n;
    for(int i=1;i<=3;i++){
        if(a[i] == 7){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}


Measured memory_bytes: 3636
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.text.BreakIterator;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main{

	static int n, m;
	static char[][] a;
	static boolean[][] ok;
	static int[] dx = new int[] { -1, 0, 1, 0, -1, -1, 1, 1 };
	static int[] dy = new int[] { 0, 1, 0, -1, -1, 1, -1, 1 };
	static int A, B, C;

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		if (n % 2 == 1) {
			for (int i = 1; i <= m; i++) {
				pw.println(i + " " + (n - i + 1));
			}
		} else {
			int odd = (m + 1) / 2;
			for (int i = 1; i <= odd ; i++) {
				pw.println(i + " " + (n - i + 1));
			}
			for (int i = odd+1; i <= m; i++) {
				pw.println(i + " " + (n - i));
			}
		}

		pw.flush();
	}

}


Measured memory_bytes: 43492
#include<iostream>

using namespace std;


int main(){
    int   N;
    long long sum,answer;
    cin >> N;
    long long  a[N],b[N];
    for(long long i=0;i<N;i++){
        b[i]=0;
    }
    for(long long i=0;i<N;i++){
        cin >> a[i];
        b[a[i]-1]++;
    }
    sum=0;

    for (long long i=0;i<N; i++){
        sum+=b[i]*(b[i]-1)/2;
    }

    for(long long i=0;i<N;i++){
        answer=sum;
        answer-=(b[a[i]-1]-1);
        cout << answer << endl;
    }
    return 0;
}

Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
bool isprime(int X){
	int lim = sqrt(X);
  	for(int i = 2; i <= lim; i++){
    	if(X%i == 0)return 0;
    }
  	return 1;
}
int main(){
	int X;
  	cin>>X;
  	for(int j = X; j < 1000000; j++){
    	if(isprime(j)){
        	cout<<j<<"\n";
          	break;
        }
    }
	return 0;
}

Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        a: i32,
        b: i32,
        _c: i32,
        k: i32,
    }

    solve(a, b, k);
}

fn solve(a: i32, b: i32, k: i32) {
    // a が十分多いとき
    if a >= k {
        println!("{}", k);
        return;
    }

    // a と b で十分多いとき
    if a + b >= k {
        println!("{}", a);
        return;
    }

    // c まで使わないといけないとき
    println!("{}", a - (k - a - b));
}


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

int main() {
	int N, M;
	cin >> N >> M;
	vector<vector<int>> vv(N+1);
	int a=0, b=0, c=0, x, y, z;
	rep(i, M) {
		cin >> x >> y;
		vv.at(x).push_back(y);
		vv.at(y).push_back(x);
	}
	vector<int> v(N+1);
	rep(i, N+1) {
		v.at(i) = 0;
	}
	queue<int> Q;
	Q.push(1);
	while (!Q.empty()) {
		z = Q.front();
		Q.pop();
		rep(i, vv.at(z).size()) {
			a = vv.at(z).at(i);
			if (v.at(a) == 0) {
				v.at(a) = z;
				Q.push(a);
			}
		}
	}
	cout << "Yes" << '\n';
	rep2(i, N) {
		cout << v.at(i) << '\n';
	}
}


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

int main() {
	long long a, b, c;
	cin >> a >> b >> c;
	if (a % 2 == 1 && b % 2 == 1 && c % 2 == 1) {
		vector<long long int> v = { a,b,c };
		sort(v.begin(), v.end());
		cout << v[0] * v[1] << endl;
		return 0;
	}
	else cout << '0' << endl;
	return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def main():
    N, M = LI()
    u = UnionFind(N)
    for i in range(M):
        a, b = LI_()
        u.union(a, b)
    ans = 0
    for i in range(N):
        ans = max(ans, u.size(i))
    print(ans)


main()



Measured memory_bytes: 84384
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>

using namespace std;

int main() {
	int i, j, k;
	string a, b;

	cin >> a >> b;

	if (a.length() > b.length()) {
		cout << "GREATER" << endl;
	}
	else if (a.length() < b.length()) {
		cout << "LESS" << endl;
	}
	else {
		for (i = 0; i < a.length(); i++) {
			if ((int)a[i] > (int)b[i]) {
				cout << "GREATER" << endl;
				goto label;
			}else
			if ((int)a[i] < (int)b[i]) {
				cout << "LESS" << endl;
				goto label;
			}
		}
		cout << "EQUAL" << endl;
	}

	label:


	getchar();
	getchar();
	return 0;
}

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

using namespace std;

#define sz(x) (int)(x.size())
#define fr(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef long long ll;
/////////////////

int const N = 2e5 + 41;

int n;
vector<pii> x, y;
int p[N];

int find(int u){
	if(u == p[u]) return u;
	return p[u] = find(p[u]);
}

bool uni(int a, int b){
	a = find(a);
	b = find(b);
	if(a == b) return false;
	p[b] = a;
	return true;
}

typedef pair<int, pair<int, int>> E;
#define COST first
#define FROM second.first
#define TO second.second

E getE(int c, int f, int t){
	return mp(c, mp(f, t));
}

vector<E> e;

void solve(){
	cin >> n;
	fr(i, 0, n){
		int xi, yi;
		cin >> xi >> yi;
		x.pb(mp(xi, i));
		y.pb(mp(yi, i));
	}
	fr(i, 0, n) p[i] = i;
	sort(x.begin(), x.end());
	fr(i, 1, n) e.pb(getE(x[i].first - x[i-1].first, x[i].second, x[i-1].second));
	sort(y.begin(), y.end());
	fr(i, 1, n) e.pb(getE(y[i].first - y[i-1].first, y[i].second, y[i-1].second));
	sort(e.begin(), e.end());
	ll ans = 0;
	fr(i, 0, sz(e)){
		if(uni(e[i].FROM, e[i].TO)) ans += e[i].COST;
	}
	cout << ans << endl;
}


int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();



	return 0;
}

Measured memory_bytes: 7400
a = list(map(int, input().split()))
count_a = 0
count_b = 0
count_c = 0
count_d = 0

for i in range(4):
    if a[i] == 1:
        count_a += 1
    if a[i] == 4:
        count_b += 1
    if a[i] == 7:
        count_c += 1
    if a[i] == 9:
        count_d += 1

if count_a == 1 and count_b == 1 and count_c == 1 and count_d == 1:
    print('YES')
else:
    print('NO')


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		new Main().solveB();
		// new Main().solveC();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		int numK = 0;
		int eqaC = 0;
		int oddC = 0;

		try {
			scanner = new Scanner(System.in);
			numK = scanner.nextInt();
			for (int i = 1; i <= numK; i++) {
				if (i % 2 == 0) {
					eqaC++;
				} else {
					oddC++;
				}
			}

			System.out.println(eqaC * oddC);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int x1 = 0;
		int y1 = 0;
		int x2 = 0;
		int y2 = 0;

		try {
			scanner = new Scanner(System.in);
			x1 = scanner.nextInt();
			y1 = scanner.nextInt();
			x2 = scanner.nextInt();
			y2 = scanner.nextInt();

			int x3 = x2 - (y2 - y1);
			int y3 = y2 + (x2 - x1);
			int x4 = x3 - (y3 - y2);
			int y4 = y3 + (x3 - x2);

			System.out.println(x3 + " " + y3 + " " + x4 + " " + y4);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

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

int main()
{
    string s;
    cin >> s;
    if( s.at(2) == s.at(3) && s.at(4) == s.at(5) )
    {
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}



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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

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

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){

    bool flag=false;
    ll ans=0,sum=0;

    string s;
    cin>>s;

    if(s[2]==s[3] && s[4]==s[5])flag=true;
    else flag=false;
    //cout <<fixed<<setprecision(16)<< << endl;

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

    return 0;
}


Measured memory_bytes: 256