akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>
using namespace std;
long long n=0;
long long i=0;
long long tmp=0;
long long tmp2=0;
long long tmp3=0;
long long ans=0;
long long maxV=0;
long long maxW=0;
long long memoV=0;
long long memoW=0;
long long ans1=0;
long long ans2=0;
int main(){
  cin >> n;
  vector<long long> v(100001);
  vector<long long> w(100001);
  for(i=0;i<n;i+=2){
    cin >> tmp;
    v.at(tmp)++;
    cin >> tmp;
    w.at(tmp)++;
  }
  
  for(i=0;i<=100000;i++){
    if(maxV < v.at(i)){
      memoV=i;
      maxV=v.at(i);
    }
  }
  
  for(i=0;i<=100000;i++){
    if(maxW < w.at(i)){
      memoW=i;
      maxW=w.at(i);
    }
  }
  sort(v.begin(),v.end());
  sort(w.begin(),w.end());
  reverse(v.begin(),v.end());
  reverse(w.begin(),w.end());
  
  if(memoV == memoW){
    if(v.at(0)>w.at(0)){
      ans+=w.at(0);
      for(i=1;i<=100000;i++){
        if(v.at(i)!=0){
          ans+=v.at(i);
        } else if (v.at(i)==0){
          break;
        }
      }
      for(i=2;i<=100000;i++){
        if(w.at(i)!=0){
          ans+=w.at(i);
        } else if (w.at(i)==0){
          break;
        }
      }
    } else if(v.at(0)<w.at(0)){
      ans+=v.at(0);
      for(i=2;i<=100000;i++){
        if(v.at(i)!=0){
          ans+=v.at(i);
        } else if (v.at(i)==0){
          break;
        }
      }
      for(i=1;i<=100000;i++){
        if(w.at(i)!=0){
          ans+=w.at(i);
        } else if (w.at(i)==0){
          break;
        }
      }
    } else{
      ans+=w.at(0);
      for(i=1;i<=100000;i++){
        if(v.at(i)!=0){
          ans1+=v.at(i);
        } else if (v.at(i)==0){
          break;
        }
      }
      for(i=2;i<=100000;i++){
        if(w.at(i)!=0){
          ans1+=w.at(i);
        } else if (w.at(i)==0){
          break;
        }
      }
      for(i=2;i<=100000;i++){
        if(v.at(i)!=0){
          ans2+=v.at(i);
        } else if (v.at(i)==0){
          break;
        }
      }
      for(i=1;i<=100000;i++){
        if(w.at(i)!=0){
          ans2+=w.at(i);
        } else if (w.at(i)==0){
          break;
        }
      }
      ans+=min (ans1,ans2);
    }
  } else {
    for(i=1;i<=100000;i++){
      if(v.at(i)!=0){
        ans+=v.at(i);
      } else if (v.at(i)==0){
        break;
      }
    }
    for(i=1;i<=100000;i++){
      if(w.at(i)!=0){
        ans+=w.at(i);
      } else if (w.at(i)==0){
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}






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

#define ll long long
#define mtv(kit) cout<<#kit<<" - "<<kit<<"\n";
#define ff first
#define ss second
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define pii pair<ll , ll>
#define all(x) x.begin(),x.end()
#define nl "\n"
#define ump unordered_map

const ll N = 1e5 + 5;
vector<ll>adj[N],C(N);
map< pii, ll>mp;
ll k;

void dfs(ll n, ll c, ll p){
    for(auto x : adj[n]){
        if(x != p){
            c++;
            if(c == k+1)c=1;
            C[mp[{min(x,n),max(x,n)}]] = c;
            dfs(x, c, n);
        }
    }
}

void doit(){
    ll n,i,j;
    cin >> n;
    rep(i,0,n-1){
        ll x,y;
        cin >> x >> y;
        adj[x-1].pb(y-1);
        adj[y-1].pb(x-1);
        mp[{min(x-1,y-1),max(x-1,y-1)}] = i;
        k = max({k,(ll)adj[x-1].size(),(ll)adj[y-1].size()});
    }
    dfs(0,0,-1);
    cout << k << nl;
    rep(i,0,n-1)cout << C[i] << nl;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
    // cin >> t;
    for(ll i = 1; i <= t; i++){
        doit();
    }
}


Measured memory_bytes: 20064
import java.util.*;

public class Main{
    public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    long a[] = new long[3];
    for(int i=0;i<3;i++)
    {
          a[i] = sc.nextInt();
          if(a[i]%2==0)
          {
             System.out.print("0");
              System.exit(0);
          };
   };
  Arrays.sort(a);
   System.out.print(a[0]*a[1]);
}


 
}

Measured memory_bytes: 8788
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int         long long   
#define double      long double
#define endl        "\n"
#define pb          push_back
#define PI          3.1415926535897932384626433832795l
#define F           first
#define S           second
#define mp          make_pair
#define f(i,n)      for(int i=0;i<n;i++)
#define fastio      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v)      (v).begin(),(v).end()
#define rall(v)     (v).rbegin(),(v).rend()
//#define sort(v)     sort((v).begin(),(v).end())
//#define rsort(v)    sort((v).rbegin(),(v).rend())
#define gcd(a,b)    __gcd((a),(b))
#define minn(v)     *min_element(v.begin(), v.end());
#define maxx(v)     *max_element(v.begin(), v.end());
#define print(x)    cout<<(x)<<endl;
#define sum(v)+x    accumulate(v.begin(), v.end(),x);
typedef pair<int,int> pii;  
typedef vector<int> vi;
//x.substr(start, length);
/*
// Create a vector containing n 
//vectors of size m.  
    vector<vector<int> > vec( n , vector<int> (m, 0));  
*/
struct type{
    int k, i, j;
};
//to check if a no is prime or not?
bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
}

// minimum subaaray sum of size k-sliding window approach
int findSubarray(int arr[], int n, int k)
{
	int window_sum = 0;
	int min_window = INT_MAX;
	int last = 0;
	for (int i = 0; i < n; i++)
	{
		window_sum += arr[i];
		if (i + 1 >= k)
		{
			if (min_window > window_sum)
			{
				min_window = window_sum;
				last = i;
			}
			window_sum -= arr[i + 1 - k];
		}
	}
	int sum=0;
	for(int i=last-k+1;i<=last;i++)
	{
	    sum+=arr[i];
	}
	return sum;
}
//finds the next permutation to given sequence of nos
int nextpermutation(vi v)
{
    vi t=v;
    //sort(t);
    int x=0;
    while(true)
    {
        x++;
        if(t==v)
        {
            return x;
        }
        next_permutation(all(t));
    }
}
signed main() 
{
    fastio;
    //cout << fixed << setprecision(0);
    int n;
    cin>>n;
    vi a(n);
    f(i,n)cin>>a[i];
    map<int,int> m1,m2;
    f(i,n)
    {
        if(i%2==0)
        {
            m1[a[i]]+=1;
        }
        else
        {
            m2[a[i]]+=1;
        }
    }
    vector<pii> v[2];
    for(auto x:m1)v[0].pb({x.S,x.F});
    for(auto x:m2)v[1].pb({x.S,x.F});
    for(int i=0;i<2;i++)
		sort(v[i].rbegin(), v[i].rend());
	if(v[0][0].S!=v[1][0].S)
	{
	    cout<<n/2-v[0][0].F+n/2-v[1][0].F<<endl;
	}
	else
	{
	    int ans=n;
	    for(int i=0;i<min((int)v[0].size(), 5LL);i++)
	    {
		    for(int j=0;j<min((int)v[1].size(), 5LL);j++)
		    {
	    	    int cur=n;
			    if(v[0][i].S==v[1][j].S)
				    cur-=max(v[0][i].F, v[1][j].F);
			    else
				    cur-=(v[0][i].F + v[1][j].F);
			    ans=min(ans, cur);
		    }
	    }
	    cout<<ans<<endl;
	}
	
}

Measured memory_bytes: 9592
#include<stdio.h>
int main(void){

int n,x;
int i;
int L[100];
int sum=0;
int flag=1;
  
scanf("%d %d",&n,&x);
  
for(i=0;i<n;i++){
scanf("%d",&L[i]);
}  
  
for(i=0;i<n;i++){
	sum+=L[i];
	if(sum<=x){
  	flag++;
    }
}  

printf("%d",flag);
  
return 0;
}

Measured memory_bytes: 128
#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|  
#  code

def c(n):
    return max(0 , (n * (n - 1)) // 2)

def main():
    from collections import Counter
    n = int(input())
    a = list(map(int , input().split()))
    C = Counter(a)
    ans = 0
    for i in C:
        ans += c(C[i])
    
    for i in a:
        pans = ans - c(C[i]) + c(C[i] - 1)
        print(pans)
    return

if __name__ == "__main__":
    main()

Measured memory_bytes: 26780
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

//試してて御免

const int cm = 1 << 17;
char ci[cm];
int cn;
char getcha() { 
	if (!cn) { fread(ci, 1, cm, stdin); cn = cm; }
	cn--;
	return ci[cm - cn - 1];
}

int getint() {
	int A = getcha() - '0';
	char C;
	while (isdigit(C = getcha())) {
		A = A * 10 + C - '0';
	}
	return A;
}

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


	int N, X;
	N = getint();
	X = getint();

	int A = 0;
	ll kotae = 0;
	rep(i, N) {
		int B = getint();
		if (A + B > X) {
			kotae += A + B - X;
			B = X - A;
		}
		A = B;
	}
	co(kotae);

	Would you please return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s; cin >> s;
    int sum = 0;
    for(char c : s){
        sum += c - '0';
    }
    if(sum%9 == 0) puts("Yes");
    else puts("No");
    return 0;
}

Measured memory_bytes: 3748
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from bisect import bisect_left 
from operator import itemgetter
def main():
    n, q = map(int, readline().split())
    STX = []
    for _ in range(n):
        s, t, x = map(int, readline().split())
        STX.append((s, t, x))
    D = []
    for _ in range(q):
        d = int(readline())
        D.append(d)

    STX.sort(key=itemgetter(2))

    ans = [-1 for _ in range(q)]
    skipTo = [-1 for _ in range(q)]
    for s, t, x in STX:
        #Dは狭義単調増加列で与えられている
        #s-x<=d<t-xとなるようなDの要素dが格納されている範囲のインデックスを求める
        #以下のようにすれば[left,right]のdがs-x<= d < t-xを満たす
        left = bisect_left(D, s-x)
        right = bisect_left(D, t-x)

        #xが小さいほど早い時刻で歩くのを止めることになる
        #よって、xの昇順に並んでいるので初めて[left, right)の範囲に入ったときだけansを更新するようにしたい
        #skiptoリストを用いて初めてでないときは飛ばすようにする
        while left < right: 
            if skipTo[left] == -1:
                #[left, right)は"このforループ"でansが決まる
                #よってleftが以前ansを決めたインデックスならright未満まではansが決まっているはずなのでrightまでとばす
                #そのためにrightを記録する
                skipTo[left] = right
                ans[left] = x
                left += 1
            else:
                #sikipTo[left]未満はansが決まっているので飛ばす
                left = skipTo[left] 
    for i in ans:
        print(i)
if __name__ == '__main__':
    main()


Measured memory_bytes: 54004
temp = input().split(" ")
N = int(temp[0])
M = int(temp[1])
H = input().split(" ")
good = [1] * N
for i in range(M):
    root = input().split(" ")
    a = int(root[0])-1
    b = int(root[1])-1
    if int(H[a])>=int(H[b]):
        good[b] = 0
    if int(H[a])<=int(H[b]):
        good[a] = 0
print(sum(good))


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

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

  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;

    if (s == "Y") {
      cout << "Four" << endl;
      return 0;
    }
  }
  
  cout << "Three" << endl;
  return 0;
}

Measured memory_bytes: 3640
//code by - anand2000

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

#define fast 		ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define ll  		long long int
#define vll 		vector < ll >
#define vpll 		vector < pair < ll,ll > >
#define pb 			push_back
#define mp 			make_pair
#define fr(i,a,b) 	for(i=a; i<b; i++)
#define fr1(i,a,b) 	for(i=a; i>=b; i--)
#define inf 		LLONG_MAX


/*-------Code Goes Here-------*/

int main()
{
	fast;
	int a,b,c;
	cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  string s;
  cin >> s;
  string t;
  cin >> t;
  rep(i, s.size()){
    if(s.at(i) != t.at(t.size()-i-1)){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	bool is_visited = false;
} node;
typedef struct {
	int to;
	int cost;
	P <int, int> change;
} edge;
int main( void ){
	int N, K; cin >> N >> K;
	int maximum = 0;
	cin >> maximum;
	int gcd = maximum;
	rep( i, 1, N ){
		int input; cin >> input;
		maximum = max( maximum, input );
		gcd = __gcd( gcd, input );
	}
	if (K <= maximum && K % gcd == 0 )
		cout << "POSSIBLE\n";
	else
		cout << "IMPOSSIBLE\n";
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

# input = sys.stdin.readline

# N個整数
a, b = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
# b = list(map(int, input().split()))

# 空白区切り文字列
# t, d = input().split()
ret = 0
if a > b:
    ret += a
    a -= 1
else:
    ret += b
    b -= 1
ret += max(a, b)
print(ret)


Measured memory_bytes: 4572
# -*- coding: utf-8 -*-
import numpy as np
N, M = map(int, input().split())

a, b = [0] * N, [0] * N
c, d = [0] * M, [0] * M

for i in range(N):
    a[i], b[i] = map(int, input().split())
for i in range(M):
    c[i], d[i] = map(int, input().split())

for i in range(N):
    tmp = []
    for j in range(M):
        tmp.append(abs(a[i] - c[j]) + abs(b[i] - d[j]))
    print(np.argmin(tmp) + 1)

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

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

  if (N%1110<10) {
    cout << "Yes" << endl;
  }
  
  else if (N%1000%111==0) {
    cout << "Yes" << endl;
  }
  
  else{
    cout << "No" << endl;
  }
}

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


using namespace std;
typedef long long ll;

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

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

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

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

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

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


int main(){
  int a,b;
  cin>>a>>b;
  int ans = 0;
  int tmp = 1;
  while(tmp<b){
    tmp--;
    tmp+=a;
    ans++;
  }
  cout<<ans<<endl;
  return 0;
}


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

int main(){
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  int sum = 0;
  if(A<=B){
    sum += A;
  } else {
    sum += B;
  }
  if (C<=D){
    sum += C;
  } else {
    sum += D;
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define DB(x){if(DEBUG)cerr<<__LINE__<<" "<<#x<<" " <<x<<endl;}
#define REP(i,b)for(LL i=(0);i<(b);++i)
#define FOR(i,a,b)for(LL i=(a);i<=(b);++i)
#define FORD(i,a,b)for(LL i=(a);i>=(b);--i)
#define ALL(x) (x).begin(),(x).end()
#define VV vector
template<typename X,typename Y>void MAX(X&a,Y b){a=(a>=b?a:b);}
template<typename X,typename Y>void MIN(X&a,Y b){a=(a<=b?a:b);}
typedef long long LL;typedef long double LD;
int DEBUG=0,MULTI=0,GCJ=0;

struct solver_t;solver_t *solver;
struct solver_t {
  VV <VV<int>> EDG;

  int res = 0;
  int dfs(int u, int prev) {

    VV <int> next;
    for (int v:EDG[u]) if (v != prev) {
      next.push_back(dfs(v, u));
    }
    if (next.size() == 0) {
      return 0;
    }
    if (next.size() == 1) {
      return next[0];
    }
    sort(ALL(next), greater<int>());

    REP (i, (int) next.size() - 1) {
      res += next[i] == 0 ? 1 : 0;
    }
    return 1;
  }

  template<typename F>
  void dfs2(int u, int prev, int dst, F fun) {
    for (int v:EDG[u]) if (v != prev) {
      dfs2(v, u, dst + 1, fun);
    }
    fun(u, dst);
  }

  void solve() {
    int N; cin >> N;
    EDG.resize(N);

    REP (i, N - 1) {int a, b; cin >> a >> b;
      EDG[a].push_back(b);
      EDG[b].push_back(a);
    }

    if (N <= 1) {
      cout << 0 << "\n";
      return;
    }
    res = 1;

    int best_dst = -1;
    int best_u = -1;

    dfs2(0, -1, 0, [&](int u, int dst) {
        if (best_dst < dst) {
          best_dst = dst;
          best_u = u;
        }
    });
    DB(best_dst<<" "<<best_u);

    dfs(best_u, -1);                                   ;

    cout << res << "\n";

  }
  void gen() {}
  void brute() {}
};

int main(int argc,char** argv){
  FOR(i,1,argc-1)for(int j=0;argv[i][j];j++)if(argv[i][j]=='.')freopen(argv[i],"r",stdin);
  FOR(i,1,argc-1)if(argv[i]==string("q"))DEBUG=1<<30;
  FOR(i,1,argc-1)if(argv[i]==string("gen")){(solver=new solver_t())->gen();exit(0);}
  FOR(i,1,argc-1)if(argv[i]==string("brute")){(solver=new solver_t())->brute();exit(0);}
  ios::sync_with_stdio(false),cin.tie(0);
  cout.setf(ios::fixed),cout.precision(10);int t;if(MULTI||GCJ)cin>>t;else t=1;
  FOR(i,1,t){if(DEBUG)cerr<<__LINE__<<" "<<i<<endl;if(GCJ)cout<<"Case #"<<i<<": ";
    solver = new solver_t();
    solver->solve();
  }return 0;
}



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

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

using namespace std;

using ll = long long;
using P = pair<int, int>;

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

  cout << (((a + b) >= c) ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
X, Y, Z = [], [], []
for i in range(N):
    x, y, z = map(int, input().split())
    X.append(x)
    Y.append(y)
    Z.append(z)

num = -float("inf")
for i in [-1, 1]:
    for j in [-1, 1]:
        for k in [-1, 1]:
            tmp = []
            for l in range(N):
                tmp.append(i * X[l] + j * Y[l] + k * Z[l])

            tmp = sorted(tmp, reverse=True)
            num = max(num, sum(tmp[:M]))

print(num)

Measured memory_bytes: 3188
n = int(input())
l = []
for i in range(n):
  ai,bi = map(int,input().split())
  l.append([ai,bi])
l.sort(key=lambda x:x[1])
s = 0
for i in range(n):
  s += l[i][0]
  if s > l[i][1]:
    print("No")
    exit()
print("Yes")

  

  

Measured memory_bytes: 38044
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <list>
#include<map>
#include<set>
using namespace std;

int main() {
    int n, y;
    cin >> n >> y;
    y /= 1000;
    int l = y / 10;
    int a = -1, b = -1, c = -1;
    for (int i = 0; i <= l; i++) {
        for (int j = 0; j <= n - i;j++) {
            if (y == 9 * i + 4 * j + n) {
                a = i, b = j, c = n - i - j;
            }
        }
    }
    cout << a << " " << b << " " << c << endl;
}


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

using namespace std;

int main(void)
{
    string S;

    cin >> S;

    if(S=="abc" || S=="acb" || S=="bac" || S=="bca" || S=="cab" || S=="cba"){
        cout << "Yes" << endl;
    }

    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
main :: IO ()
main = do
    [n, k] <- map read.words <$> getLine
    case solve n k of
        Nothing -> print (-1)
        Just es -> do
            print $ length es
            putStr $ unlines [shows x " " ++ show y|(x,y)<-es]

solve :: Int -> Int -> Maybe [(Int, Int)]
solve n k
    | k > (n - 1) * (n - 2) `div` 2 = Nothing
    | otherwise = Just $ base ++ take need [(i, j)|i<-[1..n-1],j<-[i+1..n-1]]
  where
    base = map ((,) n) [1..n-1]
    need = (n - 1) * (n - 2) `div` 2 - k

Measured memory_bytes: 1532
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<i64>();
    let (a, b, c) = (v[0], v[1], v[2]);
    if a == b {
        println!("{}", c);
    } else if a == c {
        println!("{}", b);
    } else {
        println!("{}", a);
    }
}

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

string s;
int ans = 0, n;

signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
  
  cin >> n >> s;
  for(int i=0;i<n-2;i++){
    if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C')ans++;
  }
  cout << ans << endl;


return 0;
}
///....


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

int main()
{
    string s;
    cin >> s;
    vector<int> a(3);
    rep(i, s.size()) {
        if(s[i] == 'a') a[0]++;
        else if(s[i] == 'b') a[1]++;
        else a[2]++;
    }
    string ans = "YES";
    if(abs(a[1] - a[0]) > 1) ans = "NO"; 
    if(abs(a[2] - a[1]) > 1) ans = "NO";
    if(abs(a[2] - a[0]) > 1) ans = "NO";
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3748
N, M = map(int,(input().split()))
H= list(map(int,(input().split())))
AB=[list(map(int,(input().split()))) for i in range(M)]
list1=[]
for i in range(N):
    list1.append([])
for i in range(len(AB)):
    list1[AB[i][0]-1].append(H[AB[i][1]-1])
    list1[AB[i][1]-1].append(H[AB[i][0]-1])
cnt=0
for i in range(len(list1)):
    if len(list1[i])!=0:
        if H[i]>max(list1[i]):
            cnt+=1
    else:
        cnt+=1
print(str(cnt))

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

typedef long long ll;

const int N = 1e5 + 5, Inf = 0x3f3f3f3f;
ll a[N], n;
ll sum[N];

int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i)
    cin >> a[i];
  ll cost = 0;
  for (int i = 1; i <= n; ++i) {
    sum[i] = sum[i - 1] + a[i];
    if (i & 1) {
      if (sum[i] <= 0)
	cost += 1LL - sum[i], sum[i] = 1;
    } else {
      if (sum[i] >= 0)
	cost += 1LL + sum[i], sum[i] = -1;
    }
  }
  ll ans = cost;
  cost = 0;
  for (int i = 1; i <= n; ++i) {
    sum[i] = sum[i - 1] + a[i];
    if (i & 1) {
      if (sum[i] >= 0)
	cost += 1LL + sum[i], sum[i] = -1;
    } else {
      if (sum[i] <= 0)
	cost += 1LL - sum[i], sum[i] = 1;
    }
  }
  ans = min(ans, cost);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1792
puts $<.map {|l|
    x = l.to_i
    a = []
    (0..4).each do |k|
        d = x / 10**k % 10
        u = d / 5
        l = d % 5
        a.unshift ((u == 0 ? "* =" : " *=") + ?**l + " " + ?**(4-l)).split("")
    end
    a.transpose.map(&:join).join("\n")
}.join "\n\n"

Measured memory_bytes: 9584
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE BangPatterns          #-}
{-# LANGUAGE CPP                   #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings     #-}
{-# LANGUAGE RecordWildCards       #-}
{-# LANGUAGE TupleSections         #-}
{-# LANGUAGE TypeFamilies          #-}

import           Control.Applicative
import           Control.Monad
import           Control.Monad.Primitive
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Data.Bool
import qualified Data.ByteString.Char8       as B
import qualified Data.ByteString.Unsafe      as B
import           Data.Char
import qualified Data.Foldable               as F
import           Data.Function
import qualified Data.IntMap.Strict          as IM
import qualified Data.IntSet                 as IS
import           Data.List
import qualified Data.Map.Strict             as M
import           Data.Monoid
import           Data.Ord
import           Data.Primitive.MutVar
import qualified Data.Set                    as S
import           Data.Tuple
import qualified Data.Vector                 as V
import qualified Data.Vector.Generic         as G
import qualified Data.Vector.Generic.Mutable as GM
import qualified Data.Vector.Unboxed         as U
import qualified Data.Vector.Unboxed.Mutable as UM
import           Debug.Trace
import           Foreign                     hiding (void)
import           Unsafe.Coerce

main :: IO ()
main = do
    !n <- readLn :: IO Int
    cs <- getLine
    print $ solve cs

solve :: String -> Int
solve cs = flip mod 1000000007 . subtract 1.foldl'(*%)1.map (succ.length).group $ sort cs

x *% y = (x * y) `mod` 1000000007


Measured memory_bytes: 12668
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
//using namespace __gnu_pbds;
//typedef tree<
//        pair<long long, int>, // change type
//        null_type,
//        less<pair<long long, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

//template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;


vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}

#ifdef LOCAL
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) ;
#endif


typedef long long ll;
#define rep(i, start, end) for(int i = start; i < end; ++i)
#define sz(x) (int)((x).size())
#define pb push_back
#define all(x) x.begin(), x.end()
#define clr(d, v) memset(d, v, sizeof(d))
#define pii pair<int, int>
//#define debug(x) cerr << #x << " : " << (x) << " "
const double PI = 3.14159265358979323846;
const double eps = (1e-8);
int isGreater(long double x, long double y)
{
    if (abs(x - y) < eps)
        return 0;
    if (x > y)
        return 1;
    return -1;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
//    freopen("AC.txt", "w", stdout);
#endif
    int a,b;
    cin >> a >> b;
    cout << a * b << '\n';
}

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

int main()
{
  int n;
  cin >> n;
  vector<int> costs(n);
  for (auto& cost : costs) {
    cin >> cost;
  }
  vector<int> acc_cost(n);
  acc_cost.back() = 0;
  for (auto idx(n-2); idx >= 0; --idx) {
    if (idx + 2 < n) {
      acc_cost[idx] = min(acc_cost[idx + 1] + abs(costs[idx] - costs[idx + 1]),
                          acc_cost[idx + 2] + abs(costs[idx] - costs[idx + 2]));
    } else {
      acc_cost[idx] = acc_cost[idx + 1] + abs(costs[idx] - costs[idx + 1]);
    }
  }
  cout << acc_cost[0] << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}
const int INF = 1e18;

signed main() {
    double A, B;
    cin >> A >> B;
    int N;
    cin >> N;

    int t = min(int(B-1), N);

    cout << int(A*double(t)/B)-int(A)*int(double(t)/B) << endl;
    

    return 0;
}

Measured memory_bytes: 3720
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 0;
  ll num = 0;
  rep(i, n){
    if(s[i]=='I'){
      num++;
      chmax(ans, num);
    }
    else{
      num--;
    }
  }
  print(ans);
}

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

int main(){
  unsigned long long x,y;cin >> x >> y;
  unsigned long long now = x;
  int ans = 0;
  while(now <= y){
    now *= 2;
    ans += 1;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
ac = 0
tle = 0
wa = 0
re = 0
for _ in range(n):
    user = input()
    if user == "AC":
        ac += 1
    elif user == "TLE":
        tle += 1
    elif user == "WA":
        wa += 1
    else:
        re += 1
print("AC x {} \nWA x {} \nTLE x {} \nRE x {}".format(ac, wa, tle, re))



Measured memory_bytes: 9200
# encoding: utf-8                                                            

gets.to_i.times {
  xa, ya, ra, xb, yb, rb = gets.split(/\s/).map(&:to_f)
  d = Math.sqrt((xa - xb) ** 2 + (ya - yb) ** 2)

  if d + rb < ra
    puts "2"
  elsif d + ra < rb
    puts "-2"
  elsif d > ra + rb
    puts "0"
  else puts "1"
  end
}

Measured memory_bytes: 6144
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;

#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
ll freq[61][2], mod = 1e9+7;
ll p(ll x, ll y) {
	ll ans = 1;
	while(y) {
		if(y & 1) {
			ans = (ans * x)%mod;
		}
		y/=2;
		x = (x*x)%mod;
	}
	return ans;
}
int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, ans = 0;
    cin>>n;
    ll a[n], i, j;
    for(i=0; i<n; i++) {
    	cin>>a[i];
    	bitset<61> b(a[i]);
    	for(j=0; j<61; j++) {
    		if(b[j] == 1)
    			freq[j][1]++;
    		else
    			freq[j][0]++;
    	}
    }
    for(i=0; i<61; i++) {
    	ans = (ans + ((freq[i][0]*freq[i][1])%mod*p(2, i))%mod)%mod;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF 2147483647//int max
const int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main() {
    string s;
    getline(cin,s);
    rep(i,s.length()){
        if(s[i] >= 65 && s[i] <=90){
            s[i] += 32;
        }else if(s[i] >=97 && s[i] <= 122){
            s[i] -= 32;
        }
    }
    cout << s << endl;
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/


Measured memory_bytes: 3208
import collections

def prime_factorize(n):
  a = []
  while n % 2 == 0:
    a.append(2)
    n //= 2
  f = 3
  while f * f <= n:
    if n % f == 0:
      a.append(f)
      n //= f
    else:
      f += 2
  if n != 1:
    a.append(n)
  return a

N = int(input())
if N == 1:
  print(0)
  exit()
PD = {}
for i in range(2,N+1):
  c = collections.Counter(prime_factorize(i))
  #print(i,c)
  for k,v in c.items():
    if k in PD:
      PD[k] += v
    else:
      PD[k] = v
#print(PD)
o74 = 0
o24 = 0
o14 = 0
o4 = 0
o2 = 0
for v in PD.values():
  if v >= 74:
    o74 += 1
  if v >= 24:
    o24 += 1
  if v >= 14:
    o14 += 1
  if v >= 4:
    o4 += 1
  if v >= 2:
    o2 += 1
#print(o74,o24,o14,o4,o2)
ans = o74
if o24 > 0 and o2 > 1:
  ans += o24*(o2-1)
if o14 > 0 and o4 > 1:
  ans += o14*(o4-1)
if o4 > 1 and o2 > 2:
  ans += o4*(o4-1)//2*(o2-2)
print(ans)


Measured memory_bytes: 38384
N,L = map(int,input().split())
A = []
for i in range(N):
  A.append(i+L)
  
if L < 0 and A.count(0) > 0:
  print(sum(A))
elif L < 0:
  print(sum(A[:-1]))
else:
  print(sum(A[1:]))

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

int main(void){
    int N, K, sum = 0;
    cin >> N >> K;
    vector<int> x(N);
    for(int i = 0; i < N; i++){
        cin >> x.at(i);
        if(x.at(i) <= K / 2){
            sum += 2 * x.at(i);
        }else if(K > x.at(i)){
            sum += 2 * (K - x.at(i));
        }else{
            sum += 2 * (x.at(i) - K);
        }
    }
    cout << sum << endl;

}

Measured memory_bytes: 256
#include<functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string.h>
#include <string>
#include <math.h>
#include <time.h>
#include <vector>
#include <queue>
#include<stack>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
const int M = 1000000007;
const double pi = acos(-1);
int n;
ll dp[400][400];
ll cs[401];
vector<int> v;
ll calc(int l, int r) {
	if (l == r)
		return 0;
	ll &ret = dp[l][r];
	if (ret != -1)
		return ret;
	ret = 1e18;
	for (int i = l; i < r; ++i) {
		ll cost = cs[i];
		if (l != 0)
			cost -= cs[l - 1];
		cost += cs[r] - cs[i];
		ret = min(ret, cost + calc(l, i) + calc(i + 1, r));
	}
	return ret;
}
int main() {
	//freopen("src.txt", "r", stdin);
	memset(dp, -1, sizeof dp);
	cin >> n;
	v.resize(n);
	for (int i = 0; i < n; ++i)
		cin >> v[i];
	cs[0] = v[0];
	for (int i = 1; i < n; ++i)
		cs[i] = cs[i - 1] + v[i];
	cout << calc(0, n - 1);
	return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
 
using namespace std;
 
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}
typedef long long ll;
#define int ll
 
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
//int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
//int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
vi dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
vi dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//const ll MOD = 1000000007;
const ll MOD = 998244353;
// #define mp make_pair
//#define endl '\n'


signed main() {
    fio();
    ll l;
    cin >> l;
    double a = l / 3.0;
    Sp(a * a * a);
}

Measured memory_bytes: 256
object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val a = new Array[Int](n)
    for (i <- 0 until n) {
      a(i) = sc.nextInt
    }

    val first = a.max
    val second = if (a.count(_ != first) == 0) first else a.filter(_ != first).max
    val multiMaxFlg = a.count(_ == first) > 1
    for (i <- 0 until n) {
      if (a(i) == first) {
        if (multiMaxFlg) {
          println(first)
        } else {
          println(second)
        }
      } else {
        println(first)
      }
    }
  }
}


Measured memory_bytes: 97944
#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>

using namespace std;

class Point{
public:
  long double x;
  long double y;

  Point(long double x,long double y){
    this->x=x;this->y=y;
  }
  Point(){
  }
};

class Line{
public:
  //ax+by+c=0
  long double a;
  long double b;
  long double c;

  Line(Point p1,Point p2){
    this->a=p1.y-p2.y;
    this->b=p2.x-p1.x;
    this->c=p1.x*p2.y-p1.y*p2.x;
  }
};

#define DOUBLE(a) ((a)*(a))

long double dist(Line l,Point p){
  return abs(l.a*p.x+l.b*p.y+l.c)/sqrt(DOUBLE(l.a)+DOUBLE(l.b));
}
long double dist(Point p1,Point p2){
  return sqrt(DOUBLE(p1.x-p2.x)+DOUBLE(p1.y-p2.y));
}

class Rect{
public:
  Point a;
  Point b;
  Point c;
  Point d;

  /*
   *  a------b
   *  |      |
   *  |      |
   *  c------d
   */

  Rect(Point a,Point b,Point c,Point d){
    this->a=a;this->b=b;this->c=c;this->d=d;
    
    if(
       a.x > b.x ||
       a.y < c.y ||
       b.y < d.y ||
       c.x > d.x
       )
      throw "exception\n";
  }

  long double size(){
    Line ad=Line(a,d);
    long double teihen=dist(a,d);
    long double takasa1,takasa2;
    takasa1=dist(ad,b);
    takasa2=dist(ad,c);
    return teihen*(takasa1+takasa2)/2.0;
  }
};

Point crossPoint(const Line &l1,const Line &l2){
  long double a1,a2,b1,b2,c1,c2;
  a1=l1.a;b1=l1.b;c1=-l1.c;
  a2=l2.a;b2=l2.b;c2=-l2.c;
  long double x,y;
  long double delta=a1*b2-b1*a2;
  x=( b2*c1-b1*c2)/delta;
  y=(-a2*c1+a1*c2)/delta;
  return Point(x,y);
}

int main(){
  int n;
  while(cin>>n,n){
    long double a[n+2],b[n+2],c[n+2],d[n+2];
    a[0]=b[0]=c[0]=d[0]=0.0;
    a[n+1]=b[n+1]=c[n+1]=d[n+1]=1.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;i++) cin>>c[i];
    for(int i=1;i<=n;i++) cin>>d[i];
    n+=2;
    Point p[n][n];
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	Point ap=Point(a[i] , 0.0);
	Point bp=Point(b[i] , 1.0);
	Point cp=Point( 0.0 ,c[j]);
	Point dp=Point( 1.0 ,d[j]);
	Line l1=Line(ap,bp);
	Line l2=Line(cp,dp);
	p[i][j]=crossPoint(l1,l2);
      }
    }
    long double ans=0.0;
    for(int i=0;i<n-1;i++){
      for(int j=0;j<n-1;j++){
	Rect r=Rect(p[i][j+1],p[i+1][j+1],p[i][j],p[i+1][j]);
	long double size=r.size();
	if(size>ans) ans=size;
      }
    }
    printf("%.6Lf\n",ans);
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    // Your code here!
        int A, B, C;
    cin >> A >> B >> C;
    int req[100];
    for (int i = 0; i < 100; i++) {req[i] = -1;}
    int res = 0;
    int D = 0;

    for (int i = 0; i < 100; i++)
    {
        D = (A * (i + 1)) % B;
        if (D == C){
            res = 1;
            break;
        } else {
            auto itr = std::find(std::begin(req), std::end(req), D);
            if(itr != end(req))  
            {
                break;
            }

            }

    }
    if(res == 0)
        cout << "NO" << endl;
    else
    {
        cout << "YES" << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

const int MAX = 3000;

int N,T,E;

bool solve(int num){
  for(int i = 1; num*i <= MAX; i++)
    if(T-E <= num*i && num*i <= T+E)
      return true;
 
  return false;
}

int main(){

  cin >> N >> T >> E;
  for(int i = 0; i < N; i++){
    int in;
    cin >> in;
    if(solve(in)){
      cout << i+1 << endl;
      break;
    }
    if(i == N-1) cout << "-1" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1164
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <math.h>
#include <deque>
#include <queue>
#include <map>
#include <iterator>
#include <set>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e) { std::cout << e << std::endl; }
template<typename T> void view(const std::vector<T>& v) { for (const auto& e : v) { std::cout << e << " "; } std::cout << std::endl; }
template<typename T> void view(const std::vector<std::vector<T> >& vv) { for (const auto& v : vv) { view(v); } }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

const int MOD = 1e9 + 7;

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

	int h, w, k;
	cin >> h >> w >> k;
	vector<vector<int>> dp(h + 1, vector<int>(w, 0));
	dp[0][0] = 1;

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			for (int bit = 0; bit < (1 << (w - 1)); bit++) {
				bool ok = true;
				for (int u = 0; u < w - 1; u++) {
					if ((1 & bit >> u) && (1 & bit >> (u + 1))) {
						ok = false;
					}
				}
				if (ok) {
					if ((j < w-1) && (1 & bit >> j)) {
						dp[i + 1][j + 1] += dp[i][j];
						dp[i + 1][j + 1] %= MOD;
					}
					else if ((j > 0) && (1 & bit >> (j - 1))) {
						dp[i + 1][j - 1] += dp[i][j];
						dp[i + 1][j - 1] %= MOD;
					}
					else {
						dp[i + 1][j] += dp[i][j];
						dp[i + 1][j] %= MOD;
					}
				}
				
			}
		}
	}

	cout << dp[h][k - 1] << endl;
}

Measured memory_bytes: 888
import java.util.Scanner;

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

        String str;
        str=sc.nextLine();
        char[] mo=str.toCharArray();
        int num=str.length();
        for(int i=0;i<num;i++){
            if(mo[i]>64&&mo[i]<91){
                mo[i]+=32;
            }else if(mo[i]<123&&mo[i]>96){
                mo[i]-=32;
            }
            System.out.print(mo[i]);
        }
        System.out.print("\n");

        sc.close();
    }
}



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

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

  cout << m<< endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	
	int a,b;
	scanf("%d %d",&a,&b);
	if(b==100)b=101;
	if(a==0)printf("%d\n",b);
	if(a==1)printf("%d\n",100*b);
	if(a==2)printf("%d\n",100*100*b);
	return 0;
}


Measured memory_bytes: 128
N,M = gets.split.map &:to_i
S = gets.split.map &:to_i
T = gets.split.map &:to_i
Mod = 10**9+7
V = (0..N).map{ Array.new(M+1,0) }
(0..N).each{ |i| V[i][0] = 1 }
(0..M).each{ |i| V[0][i] = 1 }
ans = 1
(1..N).each{ |i|
  vii = V[i-1]
  vi  = V[i]
  sii = S[i-1]
  (1..M).each{ |j|
    u = sii != T[j-1] ? 0 : vii[j-1]
    ans = (ans + u) % Mod
    vi[j] = (u + vii[j] + vi[j-1] - vii[j-1]) % Mod
  }
}
p ans


Measured memory_bytes: 33276
#include <iostream>
using namespace std;
int main()
{
  string S;
  cin>>S;
  if(S=="Sunny")
    cout << "Cloudy\n";
  if(S=="Cloudy")
     cout<< "Rainy\n";
     if(S=="Rainy")
     cout<<"Sunny\n";
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin>>n;
	while(n--){
		double x1,x2,x3,y1,y2,y3;
		cin>>x1>>y1>>x2>>y2>>x3>>y3;
	 	double a,b,c;
	 	a=pow((x2-x3),2)+pow((y2-y3),2);
	 	b=pow((x3-x1),2)+pow((y3-y1),2);
	 	c=pow((x1-x2),2)+pow((y1-y2),2);
	 	double ox,oy;
	 	ox=(a*(b+c-a)*x1+b*(c-b+a)*x2+c*(a+b-c)*x3)/(2*(a*b+b*c+c*a)-(a*a+b*b+c*c));
	 	oy=(a*(b+c-a)*y1+b*(c-b+a)*y2+c*(a+b-c)*y3)/(2*(a*b+b*c+c*a)-(a*a+b*b+c*c));
	 	double r;
	 	r=hypot((ox-x1),(oy-y1));
		printf("%.3lf %.3lf %.3lf\n",ox,oy,r);
	}
	return 0;
}

Measured memory_bytes: 3256