akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE( cout << #x" = " << x << endl)
#define PRINT(x) TRACE(printf(x))
#define WATCHR(a, b) TRACE( for(auto c = a; c != b;) cout << *(c++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end()); } )
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define mp make_pair
#define st first
#define nd second

using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using ld = long double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using pll = pair<ll, ll>;

void buff() { ios::sync_with_stdio( false ); cin.tie( nullptr ); }

constexpr ll MOD = 1e9 + 7;

inline ll pow_mod( ll a, ll b, ll mod = MOD) {
    ll res = 1; a %= mod; assert(b >= 0);
    for(;b;b>>=1) {
        if(b&1) res = (res * a) % mod;
        a = (a * a) % mod;
    }
    return res;
}
// End of template code!
int main() 
{
    buff();
    vi see(3, 0);
    for(int i = 0; i < 2; ++i) {
        int x; cin >> x; see[x - 1] = 1;
    }
    rep(i, 0, 3) if(see[i] == 0) cout << i + 1 << '\n';
    return 0;
}



Measured memory_bytes: 3584
//2020-05-03 21:01:06
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    string S; cin >> S;
    if (S[1] == 'R')
        cout << "ABC" << endl;
    else 
        cout << "ARC" << endl;
}

Measured memory_bytes: 3640
#include<iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <functional>
#include <string>


using namespace std;
int main()
{
	long long i, j, k, a, b, c, d, X, N, M;
	int A[1000] = { 0 };
	int B[1000] = { 0 };

	a = 0;
	b = 0;

    cin >> N >> M >> X;

	for (i = 0; i < M; i++) {
		cin >> A[i];
	}

	for (i = 0; i < M; i++) {
		B[A[i]] = 1;
	}

	for (i = 0; i < X; i++) {
		a = a + B[i];
	}

	for (i = X; i < N; i++) {
		b = b + B[i];
	}

	c = min(a, b);

	cout << c;

	return 0;
}

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

#define BR "\n"
#define SP " "

int main() {
  while(1) {
    int a, b;
    string op;
    std::cin >> a >> op >> b;

    if (op[0] == '?') {
      break;
    } else if (op[0] == '+') {
      std::cout << (a + b) << BR;
    } else if (op[0] == '-') {
      std::cout << (a - b) << BR;
    } else if (op[0] == '*') {
      std::cout << (a * b) << BR;
    } else if (op[0] == '/') {
      std::cout << (a / b) << BR;
    }
  }

  return 0;
}


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

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = int_fast64_t;
using pll = pair<ll,ll>;
constexpr ll INF = 1LL<<60;
constexpr ll MOD = 1e9+7;
template<class T> bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}
#if loc||local
void dump(){cerr<<endl;}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){cerr<<h<<", ";dump(forward<Ts>(t)...);}
#else
void dump(){}
template<class T,class... Ts> void dump(T&& h, Ts&&... t){}
#endif
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T> ostream &operator<<(ostream& os,vector<T>const& v){for(auto const& vi:v)os<<vi<<" ";return os;}
template<class T,class U> ostream &operator<<(ostream& os,pair<T,U>const& p){os<<p.first<<","<<p.second;return os;}
template<class T>vector<T> vec(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto vec(size_t a, Ts... ts){return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...));}

signed main(){

  int n,m;
  cin>>n>>m;
  
  vector<pll> ans;

  if(n&1){
    rep(i,m){
      int t = n/2;
      ans.emplace_back(t-i,t+i+1);
    }
  }else{
    if(m==1){
      cout<<1<<" "<<2<<endl;
      return 0;
    }
    int ds=1;
    int es=1;
    for(int d=m;d-->0;){
      if(d&1){
        ans.emplace_back(n/2+ds,n/2+ds+d+1);
        ds++;
      }else{
        ans.emplace_back(es,es+d+1);
        es++;
      }
    }
  }
  set<int> d;
  for(auto [x,y]:ans){
    d.emplace(y-x-1);
    d.emplace(n-y+x-1);
    dump(y-x-1,n-y+x-1);
  }
  for(auto [x,y]:ans){
    cout<<x<<" "<<y<<endl;
  }

}

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

bool comp(int a, int b) 
{ 
    return (a < b); 
} 

int main() {
	int a, b, c, k;
  cin>>a>>b>>c>>k;
  
  while(k > 0){
    if(a >= b){
      b = b * 2;
    }
    else if(b >= c){
      c *= 2;
    }
    else{
      cout<<"Yes";
      return 0;
    }
    
    k--;
  }
  if(a < b && b < c){
    cout<<"Yes";
  }
  else
    cout<<"No";
	return 0;
}


Measured memory_bytes: 3636
n, m = map(int, input().split())
h_list = list(map(int, input().split()))
ten_list = [1] * n
for i in range(0, m):
  a, b = map(int, input().split())
  if h_list[a - 1] <= h_list[b - 1]:
    ten_list[a - 1] = 0
  if h_list[a - 1] >= h_list[b - 1]:
    ten_list[b - 1] = 0
print(sum(ten_list))

Measured memory_bytes: 19980
#include<stdio.h>
#define N 20
#define Q 200
#define TRUE 1
#define FALSE 0

int solve(int,int);
int n,A[N];

int main(){
  int i,q,M[Q];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&M[i]);
  }
  for(i=0;i<q;i++){
    if(solve(0,M[i])>0){
      printf("yes\n");
    }
    else
      printf("no\n");
  }

  return 0;
}
int solve(int i, int m){
  int result;
  
  if(m==0)
    return TRUE;
  if(i>=n)
    return FALSE;

  result=solve(i+1,m)+solve(i+1,m-A[i]);
  return result;
}

Measured memory_bytes: 580
#include<iostream>
#include<string>
#include<string.h>

using namespace std;

int main(void) {
 string s;
 cin >> s;
 if(strcmp(s.c_str(), "AAA") == 0 || strcmp(s.c_str(), "BBB") == 0) {
   cout << "No" << endl;
   return 0;
 }
 cout << "Yes" << endl;
  
}

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

using namespace std;

#define REP(var, n)  for (int var = 0; var < (n); var++)
#define RREP(var, n)  for (auto var = n - 1; var != static_cast<int>(-1); var--)
#define FOR(var, a, b)  for (auto var = (a); var < (b); var++)
#define RFOR(var, a, b)  for (auto var = b - 1; var != a; var--)

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

#define all(c) begin(c),end(c)

#define D(x) do { std::cerr << x << " "; } while (0)
#define D2(x) do { std::cerr << #x << ": " << x << std::endl; } while (0)


template<typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
    if (!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}


template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    return os << '(' << p.first << ',' << p.second << ')';
}


template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

struct BLK {
    int w;
    int s;
    int v;
};

bool cmp(BLK lhs, BLK rhs) { return lhs.w + lhs.s < rhs.w + rhs.s; }

ll solve() {
    int N;
    cin >> N;
    vector<BLK> block(N);
    REP(i, N) {
        int w, s, v;
        cin >> w >> s >> v;
        block[i] = BLK{w, s, v};
    }

    sort(all(block), cmp);

    int MX_W = 10010;
    vll dp(MX_W, 0);
    REP(i, N) {
        RREP(j, block[i].s + 1) {
            int ni = min(j + block[i].w, MX_W - 1);
            chmax(dp[ni], dp[j] + block[i].v);
        }
    }

    return *max_element(all(dp));
}


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

//    cout << (solve() ? "Heisei" : "TBD") << endl;
//    cout << (solve() ? "YES" : "NO") << endl;
    cout << solve() << endl;
//    solve();

    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef map<int, int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
#define endl '\n';
#define fi first
#define se second
#define NONVOID [[nodiscard]]
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;



int main() {
    
    int q;
    cin>>q;
    list<int> li;
    list<int>::iterator it=li.end();
    rep(i,q){
        int Q,x;
        cin>>Q;
        if(Q==2){
            it = li.erase(it);
        }
        else {
            if(Q==0){
                cin>>x;
                li.insert(it,x);
                it--;
            } else{
                cin>>x;
                advance(it,x);
            }
        }
    }
    for(it = li.begin();it!=li.end();it++){
        cout<<*it<<"\n";
    }
    
}




Measured memory_bytes: 18652
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(25) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 510000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[2] = {1, 0};
int dy[2] = {0, 1};
int main(){
  lli A,B,C,D,E,F,N,M,K,L,X,Y,Z,H,W,sum=0,num=0,flag=0;string S,T;
  cin >> H >> W;
  Vec(G,string,H,"");
  rep(i,0,H)cin >> G[i];
  rep(i,0,H)rep(j,0,W)if(G[i][j]=='#')sum++;
  if(sum==H+W-1)Out("Possible");
  else Out("Impossible");
}

Measured memory_bytes: 256
fun main(arg: Array<String>) {
    val N = nextInt()
    val S = next()
    val A = BooleanArray(N)
    val B = BooleanArray(N)
    val C = BooleanArray(N)
    for (n in A.indices) A[n] = S[n] == 'o'
    for (b in 0 .. 3) {
        B[0] = (b and 1) != 0
        B[1] = (b and 2) != 0
        for (n in C.indices) {
            C[n] = A[n] xor B[n]
            if (n in 1 until N - 1) B[n + 1] = B[n - 1] xor C[n]
        }
        if ((B[0] == (B[N - 2] xor C[N - 1])) && (B[N - 1] == (B[1] xor C[0]))) {
            val sb = StringBuilder()
            for (n in B.indices) sb.append(if (B[n]) 'S' else 'W')
            return println(sb.toString())
        }
    }
    println(-1)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta


Measured memory_bytes: 38728
#include <iostream>


using namespace std;


int main(){
	int n;
	cin >> n;
	int a[100];

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

	for (int i = n-1; i >=0 ; i--){
		cout << a[i];
		if (i != 0) cout << " ";
		else cout << endl;
	}

	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  string S,T;
  cin >>S>>T;
  int ans=0;
  if(S[0]==T[0])ans++;
  if(S[1]==T[1])ans++;
  if(S[2]==T[2])ans++;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,C,K;
  cin>>N>>C>>K;
  vector<int> T(N);
  for(int &i:T)
    cin>>i;
  sort(T.begin(),T.end());
  int t=0,k=0;
  for(int i=0;i<N;){
    k++;
    t=T[i]+K;
    int n=i;
    for(;i<N;i++){
      if(T[i]>t || i-n==C)
        break;
    }
  }
  cout<<k<<endl;
}

Measured memory_bytes: 3764
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 100005;

//素因数分解
vector<pair<ll,int>> factorize(ll n) {
    vector<pair<ll,int>> res;
    ll N = n;
    for (ll i = 2; i * i <= N; i++) {
        if (n % i != 0) continue;
        res.emplace_back(i,0);
        while (n % i == 0) {
            n /= i;
            res.back().second++;
        } 
    }
    if (n != 1) res.emplace_back(n,1);
    return res;
}

int main() {
    ll n; cin >> n;
    vector<pair<ll,int>> x = factorize(n-1);
    ll sum = 1;
    rep(i,x.size()) {
        sum *= x[i].second+1;
    }
    sum--;
    for (ll i = 2; i*i <= n; i++) {
        if (n % i == 0) {
            ll j = n/i;
            ll x = n;
            while (x % i == 0) {
                x /= i;
            }
            if (x % i == 1) sum++;
            x = n;
            if (i != j) {
                while (x % j == 0) {
                    x /= j;
                }
                if (x % j == 1) sum++;
            }
        }
    }
    sum++;
    cout << sum << endl;
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"unsafe"
)

func main() {
	log.SetFlags(log.Lshortfile)
	var next = newScanner()
	N := next.Int()
	M := next.Int()
	Q := next.Int()
	// var N, M, Q int
	// _, err := fmt.Scanf("%d %d %d", &N, &M, &Q)
	// if err != nil {
	// 	log.Fatal(err)
	// }
	var data [510][510]int
	var l, r int
	for i := 0; i < M; i++ {
		// _, err := fmt.Scanf("%d %d", &l, &r)
		// if err != nil {
		// 	log.Fatal(err)
		// }
		l = next.Int()
		r = next.Int()
		data[l][r]++
	}

	for i := N; i >= 1; i-- {
		for j := 1; j <= N; j++ {
			data[i][j] += data[i+1][j]
			data[i][j] += data[i][j-1]
			data[i][j] -= data[i+1][j-1]
		}
	}
	var buf bytes.Buffer
	var p, q int
	for i := 0; i < Q; i++ {
		// _, err := fmt.Scanf("%d %d", &p, &q)
		// if err != nil {
		// 	log.Fatal(err)
		// }
		p = next.Int()
		q = next.Int()
		buf.WriteString(strconv.Itoa(data[p][q]))
		buf.WriteString("\n")
	}
	fmt.Println(buf.String())
}

type scanner struct {
	r     *bufio.Reader
	buf   []byte
	begin int
	end   int
	// p     int
}

func newScanner() *scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1024)
	return &scanner{r: rdr}
}
func (s *scanner) next() string {
	s.pre()
	s.begin = s.end
	for ; s.end < len(s.buf); s.end++ {
		if s.buf[s.end] == ' ' {
			break
		}
	}
	result := s.buf[s.begin:s.end]
	s.end++
	return *(*string)(unsafe.Pointer(&result))

}
func (s *scanner) Line() string {
	s.pre()
	s.begin = s.end
	s.end = len(s.buf)
	result := s.buf[s.begin:]
	return *(*string)(unsafe.Pointer(&result))
}
func (s *scanner) String() string {
	return s.next()
}
func (s *scanner) Int() int {
	v, err := strconv.Atoi(s.next())
	// v, err := strconv.ParseInt(s.next(), 10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return v
}
func (s *scanner) Ints(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = s.Int()
	}
	return r
}
func (s *scanner) Int64() int64 {
	v, err := strconv.ParseInt(s.next(), 10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return v
}
func (s *scanner) Uint64() uint64 {
	v, err := strconv.ParseUint(s.next(), 10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return v
}
func (s *scanner) Float64() float64 {
	v, err := strconv.ParseFloat(s.next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return v
}
func (s *scanner) pre() {
	if s.end >= len(s.buf) {
		s.readLine()
		s.end = 0
	}
}
func (s *scanner) readLine() {
	s.buf = make([]byte, 0, 1024)
	for {
		l, p, err := s.r.ReadLine()
		if err != nil {
			log.Fatal(err)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}

Measured memory_bytes: 15232
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N, M; cin >> N >> M;
  vector<int> H(N);
  for(int i = 0; i < N; i++) cin >> H.at(i);
  vector<vector<int>> tree(N, vector<int> (0));
  for(int i = 0; i < M; i++) {
    int A, B; cin >> A >> B; A--; B--;
    tree.at(A).push_back(B);
    tree.at(B).push_back(A);
  }
  int cnt = 0;
  for(int i = 0; i < N; i++) {
    bool judge = true;
    for(int j = 0; j < (int)tree.at(i).size(); j++) {
      if(H.at(i) <= H.at(tree.at(i).at(j))) {
        judge = false;
        break;
      }
    }
    if(judge) cnt++;
  }
  cout << cnt << endl;
}

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

using namespace std;
using ll = long long;



int main()
{
    int a,b, x;
    cin >> a >> b >> x;
    if(x < a){
        cout << "NO" << endl;
    }else{
        cout << (a + b >= x ? "YES" : "NO") << endl;
    }
}

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {
	char c;
	public void solve() {
		c = next().charAt(0);

		if(c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o'){
			out.println("vowel");
		}else{
			out.println("consonant");
		}
	}

	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 8272
import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String S;
        S = sc.next();
        String T;
        T = sc.next();

        final Solver solver = new Solver();
        solver.solve(N, S, T);
    }
}

class Solver {
    public void solve(long N, String S, String T) {
        for (int i = 0; i < N; i++) {
            System.out.print(S.charAt(i));
            System.out.print(T.charAt(i));
        }
        System.out.println();
    }
}



Measured memory_bytes: 21588
#include <iostream>
using namespace std;
int main(){

  int n,r;
  cin>>n;
  r=n;
  for(int i=2;i*i<=n;i++) if(!(n%i)){
      r-=r/i;
      while(!(n%i)) n/=i;
    }
  if(n-1) r-=r/n;
  cout<<r<<endl;

  return 0;

}

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

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    vector<int64_t> ans;
    for (auto i : irange(2L, 55556L)) {
        if (i % 5 != 1) {
            continue;
        }

        bool ok = true;
        for (auto j = 2L; j * j <= i; ++j) {
            if (i % j == 0) {
                ok = false;
                break;
            }
        }

        if (ok) {
            ans.push_back(i);
        }

        if (ans.size() == n) {
            break;
        }
    }

    const auto* delim = "";
    for (auto a : ans) {
        cout << delim << a;
        delim = " ";
    }
    cout << endl;
}

Measured memory_bytes: 256
gcd = lambda a,b: a if b==0 else gcd(b,a%b)
n,m = map(int,input().split())
s = input()
t = input()
a = m//gcd(n,m)
b = n//gcd(n,m)
if s[::b]==t[::a]:
    print(n*m//gcd(n,m))
else:
    print(-1)

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

using namespace std;

using ll = int_fast64_t;
constexpr ll llmax = INT_FAST64_MAX; // std::numeric_limits<int_fast64_t>::max()
constexpr ll llmin = INT_FAST64_MIN; // std::numeric_limits<int_fast64_t>::min()
using ull = uint_fast64_t;
constexpr ull ullmax = UINT_FAST64_MAX; // std::numeric_limits<uint_fast64_t>::max()

#define FOR(i, b, e) for (int i = (b); i < (e); ++i)
#define RFOR(i, b, e) for (int i = ((e) - 1); (b) <= i; --i)
#define REP(i, N) for (int i = 0; i < (N); ++i)
#define RREP(i, N) for (int i = ((N) - 1); 0 <= i; --i)
#define scanInt(x) int x; scanf("%d", &(x)); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &(x)); getchar();
#define scanVecInt(A, N) vector<int> A(N); REP(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); REP(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    string S;
    cin >> S;
    scanLLInt(K);

    vector<int> V;
    char before = 'A';
    for (auto&& c : S){
        if (c == before){
            V.back()++;
        }else{
            V.emplace_back(1);
        }
        before = c;
    }
    if (V.size() <= 1){
        cout << V.front() * K / 2 << endl;
    }else{
        ll offset = 0;
        if (S.front() == S.back()){
            offset = V.front() / 2 + V.back() / 2 - (V.front() + V.back()) / 2;
            V.front() += V.back();
            V.pop_back();
        }
        ll result = 0;
        for (auto&& e : V){
            result += e / 2;
        }
        cout << result * K + offset << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define rn(i,n) for(int i=1;i<=n;i++)
#define ll long long
const ll mod=1e9+7;

char in[120];
pair<pair<string,int>,int> p[110];

int main(){
  int n;
  cin>>n;
  string s;
  int pt;

  r(i,n){
    cin>>s;
    cin>>pt;
    p[i]=make_pair(make_pair(s,-pt),i+1);
  }

  sort(p,p+n);
  r(i,n){
    cout<<p[i].second<<endl;
  }

}


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

int dp[111111];
int main(){
    int N, K;
    cin >> N >> K;
    vector<int> a(N);
    REP(i, N) cin >> a[i];

    dp[0] = -1;
    for(int i=1; i<=K; i++){
        bool win = false;
        REP(j, N){
            int to = i - a[j];
            if(to < 0) break;
            if(dp[to] == -1)
                win = true;
        }
        dp[i] = (win ? 1 : -1);
    }
    cout << (dp[K] == 1 ? "First" : "Second") << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <iomanip> //! for setprecision(10)
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long ll;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)


ll mod = 1000000007;
const int MAX = 999999;
               
            
//---------------------------------------------------------------------------------------------------
ll f[MAX];
void init() {
    f[0] = 1;
    for(int i = 1; i < MAX; ++i) f[i] = (f[i - 1] * i) % mod;
}
//---------------------------------------------------------------------------------------------------
ll inv(ll x) {
    ll res = 1;
    ll k = mod - 2;
    ll y = x;
    while (k) {
        if (k & 1) res = (res * y) % mod;
        y = (y * y) % mod;
        k /= 2;
    }
    return res;
}
//---------------------------------------------------------------------------------------------------
ll C(int n, int k) {
    ll a = f[n]; // = n!
    ll b = f[n-k]; // = (n-k)!
    ll c = f[k]; // = k!

    ll bc = (b * c) % mod;

    return (a * inv(bc)) % mod;
}

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

    init();
    
    int X, Y;
    cin >> X >> Y;

    int c1 = 0;
    int c2 = 0;
    if (X == Y) {
        if (X % 3 == 0) {
            c1 = X / 3;
            c2 = c1;
        }
    } else {
        if (X < Y) {
            swap(X, Y); //! make sure Y < X
        }
        int k = X - Y;
        int n = Y - k;
        if (0 <= n && n % 3 == 0) {
            c1 = n / 3;
            c2 = c1 + k;
        }
    }

    ll ans = 0;
    if (c1 && c2) {
        ans = C(c1 + c2, c1);
    } else if (c1 || c2) {
        ans = 1;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 8064
#include<iostream>
#include<string>
#include<math.h>
#include<algorithm>

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

using namespace std;

int main() {
	int a;
	cin >> a;
	cout << (a - 2) * 180 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

ll gcd(ll a, ll b) { return b?gcd(b, a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a, b)*b;}
const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  ll n, k; cin >> n >> k;
  map<int, ll> hoge;
  int a;
  ll b;
  rep_i(i, n){
    cin >> a >> b;
    hoge[a] += b;
  } 
  ll sum = 0;
  for (auto i = hoge.begin(); i != hoge.end(); i++){
    sum += i->second;
    if(sum >= k){
      say(i->first);
      return 0;
    }
  }
}

Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define mp make_pair
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
template<typename T> inline T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> inline T lcm(T a, T b) { return a / gcd(a, b) * b; }



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    
    
    int n;
    cin >> n;
    ll tmp;
    rep(i, n) {
        ll t;
        cin >> t;
        if (i == 0) tmp = t;
        else {
            tmp = lcm(tmp, t);
        }
    }
    cout << tmp << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[15][15];
int main(){
	int n,d,ans=0;
	cin>>n>>d;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=d;j++){
			cin>>a[i][j];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			int sum=0;
			for(int k=1;k<=d;k++){
				sum+=abs(a[i][k]-a[j][k])*abs(a[i][k]-a[j][k]);
			}
			//cout<<sum<<endl;
			int num=(int)sqrt(sum);
			if(num*num==sum) ans++;
		}
	}
	cout<<ans<<endl;
}

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

typedef long long int ll;
typedef long double ld;

//****************************************************                
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll> 
#define vpll vector<pll>
#define all(X) X.begin(),X.end()
#define endl "\n" //comment it for interactive questions
#define trace1(a) cerr << #a << ": " << a << endl;
#define trace2(a,b) cerr << #a << ": " << a << " " << #b << ": " << b << endl;
#define trace3(a,b,c) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << endl;
#define trace4(a,b,c,d) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << #d << ": " << d << endl;
#define OC   
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
        //*******************************************************
//Some Functions

const ll MOD = (ll)1e9+7; //change it for other mods

ll powmod(ll a,ll b)
{
   ll res = 1;
   while(b > 0) {
      if(b & 1) res = (res * a) % MOD;
      a = (a*a)%MOD;
      b = b >> 1; 
  }
  return res % MOD;
}

void solve(ll testnum)
{
    ll n;
    cin >> n;
    vll a(n);
    ll tot = 0;
    for(ll i=0;i<n;i++) {
    	cin >> a[i];
    	tot ^= a[i];
    }
    for(ll i=0;i<n;i++) {
    	cout << (ll)(tot ^ a[i]) << " ";
    }
    cout << "\n";
}

int main()
{
    FAST_IO;
    #ifdef STIO 
      freopen("input.txt" , "r", stdin);
      freopen("output.txt" , "w", stdout);
    #endif
    ll t = 1;
    // cin >> t;
    for (ll i = 1; i <= t; i++) {
        solve(i);
    }
}

Measured memory_bytes: 4760
#include<cstdio>
#include<functional>
#include<algorithm>
using namespace std;
int main(void)
{
	int n,i,cnt,flg;
	char s[100001];
	scanf("%d",&n);
	scanf(" %s",s);
	cnt=0;	flg=0;
	for(i=0;i<n;i++)	{
		if(s[i]=='o')	{
			flg=0;	
		}
		else {
			if(flg==1)	break;
			else flg=1;
		}
		cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}


Measured memory_bytes: 2856
import java.util.Scanner;

public class Main {

    private static int n;
    private static boolean[][] graph;
    private static boolean[] visited;

    private static void dfs(int v) {
        visited[v] = true;
        for (int i = 0; i < n; i++) {
            if (!graph[v][i] || visited[i]) {
                continue;
            }
            dfs(i);
        }
    }

    private static boolean isBridge() {
        for (int j = 0; j < n; j++) {
            if (!visited[j]) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        int[] b = new int[m];
        graph = new boolean[n][n];
        visited = new boolean[n];
        for (int i = 0; i < m; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
            graph[a[i] - 1][b[i] - 1] = true;
            graph[b[i] - 1][a[i] - 1] = true;
        }

        int result = 0;
        for (int i = 0; i < m; i++) {
            graph[a[i] - 1][b[i] - 1] = false;
            graph[b[i] - 1][a[i] - 1] = false;
            for (int j = 0; j < n; j++) {
                visited[j] = false;
            }

            dfs(0);

            if (isBridge()) {
                result += 1;
            }
            graph[a[i] - 1][b[i] - 1] = true;
            graph[b[i] - 1][a[i] - 1] = true;
        }
        System.out.println(result);
    }

}


Measured memory_bytes: 23764
#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 li          long
#define ll          long long
#define ull         unsigned long long
#define ff          first
#define ss          second
#define pii         pair<int,int>
#define pli         pair<li,li>
#define pll         pair<ll,ll>
#define pb          push_back
#define fo(i,k,n)   for(int i = k;i<n; i++)
#define ro(i,k,n)   for(int i = k; i>=n; i--)
#define tc          int t;cin>>t;while(t--)
#define all(v)      v.begin(),v.end()
#define inf         INT_MAX
#define ninf        INT_MIN
#define W(x)        cout<<x<<endl
#define WW(x,y)     cout<<x<<' '<<y<<endl;
#define in(x)       cin>>x
#define vi          vector<int>
#define vll         vector<long long>
#define vpi         vector<pair<int>>
#define vpll        vector<pair<long long>>
#define vvi         vector<vector<int>>
#define vvll        vector<vector<long long>>
#define vvpi        vector<vector<pair<int,int>>>
#define vvpll       vector<vector<pair<long long>>>
const ll mod1 = 99844353;
const ll mod2 = 1e9+7;
template <class T>
using oset = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

void fastio()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
} 

template<class T>
T power(T a,T b){
    T res = (T)1;
    while(b>0){
        if(b&1)res = res*a;
        b>>=1;
        a*=a;
    }
    return res;
}

void solve(){
    int n;
    cin>>n;
    unordered_map<int,int> mp;
    int a[n];
    for(int i = 0,x; i<n; i++){
        cin>>a[i];
        mp[a[i]]++;
    }
    int ans = 0;
    for(int i = 0; i<n; i++){
        bool flag = 1;
        for(int x = 1; x<=sqrt(a[i]);x++){
            if(a[i]%x == 0){
                if(x == a[i]&&mp[x]>1)flag&=0;
                if(a[i]/x == a[i]&&mp[a[i]/x]>1)flag&=0;
                if(x!=a[i]&&mp.find(x)!=mp.end())flag&=0;
                if(a[i]/x!=a[i]&&mp.find(a[i]/x)!=mp.end())flag&=0;
            }
        }
        if(flag)ans++;
    }
    cout<<ans;
                
}

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

Measured memory_bytes: 12080
N, M = map(int, input().split())
bulb = []
count = 0

for _ in range(M):
    tmp = list(map(int, input().split()))
    bulb.append(tmp[1:])

P = list(map(int, input().split()))

for i in range(2 ** N):
    switch = []
    for j in range(N):  # スイッチの押し方を全探索
        if (i >> j) & 1:
            switch.append(j+1)
    bulb_count = M
    for k in range(M):  # M個の電球それぞれがついているか判定
        tmp = bulb[k]  # tmpは電球k につながっているスイッチ
        switch_count = 0
        for num in tmp:  # 電球kのスイッチについて判定
            if num in switch:
                switch_count += 1
        if switch_count % 2 == P[k]:
            bulb_count -= 1
    if bulb_count == 0:
        count += 1

print(count)


Measured memory_bytes: 74184
#include <iostream>
using namespace std;
int main(void){
    int N;
    cin >> N; 
    int X[N];
    for (int i = 0; i < N; i++){
        cin >> X[i]; 
    } 

    for (int i = 0; i < N - 1; i++) cout << X[i] << ' ';
    cout << X[N - 1] << endl;
    for (int i = 1; i < N; i++){ // 比較は植木算
        int j, v = X[i];
        for (j = i; j > 0; j--){
            if (v > X[j - 1]){
                break;   
            }
            X[j] = X[j - 1];
        }
        X[j] = v;
        for (int j = 0; j < N - 1; j++) cout << X[j] << ' ';
        cout << X[N - 1] << endl;
    } 
 }



Measured memory_bytes: 3112
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main(){
    int n,k,sum=0;cin>>n>>k;int a[n];
    for(int i=0;i<n;i++)cin>>a[i];sort(a,a+n);
    for(int i=0;i<k;i++) sum+=a[i];cout<<sum;
}


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

#define int long long
#define debug(x) cout<<#x<<" "<<x<<endl;

const int N=1e6+5;
const double eps=1e-9;
const int INF=1e18;
const int P=1e9+7;

int f[N];
int sz[N];
int fd(int x)
{
    return f[x]==x?x:f[x]=fd(f[x]);
}

signed main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    int n,m;cin>>n>>m;
    for(int i=1;i<=n;i++) f[i]=i,sz[i]=1;
    for(int i=1;i<=m;i++){
        int x,y;cin>>x>>y;
        int p=fd(x),q=fd(y);
        if(p!=q) f[p]=q,sz[q]+=sz[p];
    }
    int r=0;
    for(int i=1;i<=n;i++) r=max(r,sz[i]);
    cout<<r<<endl;
    return 0;
}

//Created Time  :2020/8/29 20:00:20


Measured memory_bytes: 6724
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Pavel Mavrin
 */
public class Main {

    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        int k = nextInt();
        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= m; j++){
                int x = i * j + (n - i) * (m - j);
                if (x == k) {
                    out.println("Yes");
                    return;
                }
            }
        }
        out.println("No");
    }

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

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;
    PrintWriter out = new PrintWriter(System.out);

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

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

    private void run() throws IOException {
        solve();
        out.close();
    }

}


Measured memory_bytes: 23252
n=int(input())
x_arr=map(float,input().split())
y_arr=map(float,input().split())

r1,r2,r3,rm=0,0,0,0

for x,y in zip(x_arr, y_arr):
    tmp=abs(x-y)
    r1 += tmp
    r2 += tmp**2
    r3 += tmp**3
    rm = max(rm, tmp)

print(r1)
print(r2**(0.5))
print(r3**(1/3))
print(rm)


Measured memory_bytes: 5660
from collections import deque

def main():
    S = input()
    Q = int(input())

    t = deque(S)
    reverse = False
    for _ in range(Q):
        query = input()
        if query[0] == '1':
            reverse = not reverse
        elif query[0] == '2':
            _, F, C = query.split()
            if F == '1':
                if reverse:
                    t.append(C)
                else:
                    t.appendleft(C)
            elif F == '2':
                if reverse:
                    t.appendleft(C)
                else:
                    t.append(C)
    
    result = ''.join(t)
    if reverse:
        result = result[::-1]

    print(result)

if __name__ == '__main__':
    main()

Measured memory_bytes: 8564
#include <iostream>
using namespace std;
int main (){
        int x,y,z,k,s;
        int ans=0;
        cin >> k >> s;
        for(x=0; x<=k; x++) {
                for(y = 0; y<=k; y++) {
                        z = s -x-y;
                        if(z >=0 && z <=k) {
                                ans++;
                        }
                }
        }
        cout << ans << endl;
        return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
class Main{
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int n = saori.saori_hayami();
		int[] d = new int[n];
		int ans = 0;
		for(int i = 0;i < n;i++){
			d[i] = saori.saori_hayami();
		}
		for(int i = 0;i < n-1;i++){
			for(int j = i+1;j < n;j++){
				ans += d[i] * d[j];
			}
		}
		System.out.println(ans);

    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 21204
using System;

class DrinkEasy
{
	static public void Main(string[] args)
	{
		string[] vals;
		int N;
		
		N = int.Parse(Console.ReadLine());
		vals = Console.ReadLine().Split(' ');
		int[] T = new int[N];
		int sum = 0;
		for(int i=0; i<N; i++)
		{
			T[i] = int.Parse(vals[i]);
			sum += T[i];
		}
		int M = int.Parse(Console.ReadLine());
		int[] P = new int[M];
		int[] X = new int[M];
		for(int i=0; i<M; i++)
		{
			vals = Console.ReadLine().Split(' ');
			P[i] = int.Parse(vals[0]);
			X[i] = int.Parse(vals[1]);
		}
		for(int i=0; i<M; i++)
		{
			Console.WriteLine(sum - T[P[i]-1] + X[i]);
		}
	}
}


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

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(ll size) {
        size = max((int) sqrt(size) + 1, 101010);
        prime.resize(size, 1);
        prime[0] = 0;
        prime[1] = 0;
        for (size_t i = 2; i * i <= size; ++i)
            if (prime[i]) {
                for (size_t j = 2; i * j <= size; ++j)prime[i * j] = false;
            }
    }
};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


ll GCD(ll a, ll b) {
    if (b == 0)return a;
    return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    ll gcd = GCD(a, b);
    return a / gcd * b;
}

ll N, P;

int main() {
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<>());
    if (s >= t) cout << "No" << endl;
    else cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()
int main(){
    string s;cin>>s;
    bool flag=true;
    rep(i,s.size()){
        if(i%2==1){
            if(s.at(i)=='R'){
                flag=false;
                break;
            }
        }else{
            if(s.at(i)=='L'){
                flag=false;
                break;
            }
        }
    }
    if(flag)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

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

int T, N, K;
int X [100000 + 10];
int d [100000 + 10];//+10を習慣的に取る


int main() {
  cin >> T;
  for(int t = 0; t < T; t++){
    int ans = 0;
    cin >> N >> K;
    for (int i = 0; i < N; i++) cin >> X[i];
    for (int i = 0; i < N - 1; i++) d[i] = X[i+1] - X[i];
    sort(d,d+N-1);
    for (int i = 0; i < max(0,N-K); i++){
      ans = ans + d[i];
    }
    cout << ans << endl;
  }

  return 0;
}



Measured memory_bytes: 3932
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>

using namespace std;
using psi = pair<string, int>;
using ppsi = pair<psi, int>;

#define ALL(a) (a).begin(),(a).end()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ITER(it,v) for(auto it=v.begin();it!=v.end();++it)
#define IN(v) int v;cin>>v;
#define OUT(v) cout<<v<<"\n"

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

  vector<ppsi> v;
  REP(i, N) {
    string S;
    int P;
    cin >> S >> P;
    v.push_back(make_pair(make_pair(S, -P), i+1));
  }
  sort(ALL(v));
  ITER(it, v)
    OUT(it->second);

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] count = line.split(" ");
		int a = Integer.parseInt(count[0]);
		int b = Integer.parseInt(count[1]);

		System.out.print((a / b) + " ");
		System.out.print((a % b) + " ");

		double c = (double) a / (double) b;

		System.out.printf("%5f", c);
	}

}



Measured memory_bytes: 26456