akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main()
{   ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long n;
    cin>>n;
    long long arr[n-1];
    for(int i=0;i<n-1;i++)
        cin>>arr[i];
    long long arr2[n];
    for(long long &x:arr2)
        x=0;
    for(int i=0;i<n-1;i++)
        arr2[arr[i]-1]++;
    for(int i=0;i<n;i++)
        cout<<arr2[i]<<"\n";

}

Measured memory_bytes: 6768
object Main extends App {
	override def main(args: Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		
		val pw = new java.io.PrintWriter(System.out);
		
		Iterator.continually(new Rectangle(sc.nextInt,sc.nextInt))
			.takeWhile(_.isContinue)
			.foreach(_.print(pw))

		pw.flush
		
	}
	
	class Rectangle(val H: Int, val W:Int){
		val isContinue = !(H == 0 && W == 0)
		
		def print(pw : java.io.PrintWriter):Unit = {
			for(_ <- (1 to H)){
				for(_ <- (1 to W)){
					pw.print("#")
				}
				pw.println
			}
			pw.println
		}
		
	}
}

Measured memory_bytes: 46200
#include <iostream>

using namespace std;
int n,i,v[100001],scor0,nrcorect,rasp,scorminus;
int main() {

    cin >> n >> scor0 >> nrcorect;
    scorminus-=scor0;
    for(i = 1; i <= nrcorect; ++i) {
        cin >> rasp;
        v[rasp]++;
        scorminus++;
    }
    for(i = 1; i<= n; ++i) {
        v[i]=v[i]-scorminus;
     if(v[i]<=0) cout<<"No"<<'\n';
     else cout<<"Yes"<<'\n';
    }
    return 0;
}


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

using namespace std;

long long a[200100], b[200100];
long long asum[400100];

int main()
{
    long long n, m, k;
    scanf("%lld%lld%lld", &n, &m, &k);
    for(int i = 1; i <= n; ++i)
    {
        scanf("%lld", &a[i]);
        asum[i] = asum[i-1] + a[i];
    }
    long long ans =  upper_bound(asum+1, asum+1+n, k) - (asum+1);
    for(int i = 1; i <= m; ++i)
    {
        scanf("%lld", &b[i]);
        if(b[i] <= k)
        {
            k -= b[i];
            ans = max(ans, (long long)(i+upper_bound(asum+1, asum+1+n, k) - (asum+1)));
        }else{
            break;
        }
    }
    printf("%lld\n", ans);

}


Measured memory_bytes: 8484
n = int(input())
a = list(map(int, input().split()))
li = [0]*15
tourist = 0

for i in a:
    if i // 400 >= 8:
        tourist += 1

    if li[i//400] == 0:
        li[i//400] = 1

maxrate = sum(li[:8]) + tourist

minrate = 0

if sum(li[:8]) == 0:
    minrate = 1
else:
    minrate = sum(li[:8])

print(minrate, maxrate)

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

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

using namespace std ;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;




int main()
{
  int n ;
  cin >> n ;
  
  cout <<n*800-n/15*200 <<endl ;
  
    return 0 ;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

int main()
{

    int N,R;
    cin >> N >> R;
    
    int ans = R;
    if(N<=10)
    {
        ans += 100*(10-N);
    }

    cout << ans << endl;

    return 0;
}

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

using namespace std;

int main(void){
	for(float h,w;cin >> h >> w,h&&w;){
		float H,W,diag2 = pow(w,2)+pow(h,2),max_h=sqrt(diag2/2);
		bool yet=true;

		for(H=1;yet&&H<max_h;H++)
			if((W=sqrt(diag2-pow(H,2)))-(int)W==0&&H>h){
				cout << (int)H << " " << (int)W << endl;
				yet=false;
			}
		for(diag2++;yet;max_h=sqrt(++diag2/2))
			for(H=1;yet&&H<max_h;H++)
				if((W=sqrt(diag2-pow(H,2)))-(int)W==0){
					cout << (int)H << " " << (int)W << endl;
					yet=false;
				}
	}

	return 0;
}

Measured memory_bytes: 1220
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <utility>
#include <numeric>
#include <queue>

using namespace std;

int main(){

    int N, u, v;
    cin >> N >> u >> v;
    u--;
    v--;
    vector<vector<int>> E(N);
    vector<int> cnt(N, 0);
    int a, b;
    for(int i = 0; i < N - 1; i++){
        cin >> a >> b;
        E[a - 1].push_back(b - 1);
        E[b - 1].push_back(a - 1);
        cnt[a - 1]++;
        cnt[b - 1]++;
    }
    vector<bool> leaf2(N, false);
    for(int i = 0; i < N; i++){
        if(cnt[i] == 1){
            for(int node: E[i]){
                leaf2[node] = true;
            }
        }
    }

    vector<int> dist(N, -1);
    dist[v] = 0;
    queue<pair<int, int>> q;
    q.push(make_pair(v, 0));
    while(!q.empty()){
        auto temp = q.front();
        q.pop();
        for(int nextNode: E[temp.first]){
            if(dist[nextNode] == -1){
                dist[nextNode] = temp.second + 1;
                q.push(make_pair(nextNode, temp.second + 1));
            }
        }
    }

    int distTA = dist[u];

    queue<pair<int, int>> q2;
    vector<bool> usedT(N, false);
    vector<bool> usedA(N, false);
    vector<int> escapeNode;
    escapeNode.push_back(u);
    usedT[u] = true;
    usedA[v] = true;
    q2.push(make_pair(u, 0));
    q2.push(make_pair(v, 1));

    while(!q2.empty()){
        auto temp = q2.front();
        q2.pop();
        if(temp.second == 0){
            if(usedA[temp.first]){
                continue;
            }
            for(int nextNode: E[temp.first]){
                if(!usedT[nextNode] && !usedA[nextNode]){
                    usedT[nextNode] = true;
                    escapeNode.push_back(nextNode);
                    q2.push(make_pair(nextNode, 0));
                }
            }
        }
        else{
            for(int nextNode: E[temp.first]){
                if(!usedA[nextNode]){
                    usedA[nextNode] = true;
                    q2.push(make_pair(nextNode, 1));
                }
            }
        }
    }

    int ans = 0;
    for(int node: escapeNode){
        int tempDist = dist[node];
        if(distTA % 2 == 0){
            ans = max(ans, tempDist - 1);
        }
        else{
            ans = max(ans, tempDist - 1);
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 7292
import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int max = 1;
        int min = 2000000000;
        String line;
        while ((line = br.readLine()) != null && !line.isEmpty()) {
            List<Integer> list = Arrays.stream(line.split(" ")).map(Integer::parseInt).sorted().collect(Collectors.toList());
            // a < b
            int a = list.get(0);
            int b = list.get(1);
            for(int i = a; 1 <= i; i--) {
                if(a % i == 0 && b % i ==0) {
                    max = i;
                    break;
                }
            }
            for(int i = b; i <= 2000000000; i = i + max) {
                if(i % a== 0 && i % b ==0) {
                    min = i;
                    break;
                }
            }
            System.out.println(max + " " + min);
        }
    }
}


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

#define REP(i,n) for(int i=0;i< (n);i++)
#define REPR(i, n) for(int i = (n);i >= 0;i--)
#define FOR(i, m, n) for(int i = (m);i < (n);i++)
#define FORR(i, m, n) for(int i = (m);i >= (n);i--)
#define SORT(v, n) std::sort(v, v+n);
#define VSORT(v) std::sort(v.begin(), v.end());
#define VRSORT(v) std::sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define ALL(obj) (obj).begin(),(obj).end()

using namespace std;

const int INF = 99999999;
const ll LINF = 9999999999999;

typedef pair<ll, ll> LP;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


string S;

ll dfs(ll index,ll times,ll num) {
	ll add = (S[index] - '0') * times;
	if (index + 1 == S.size()) {return num + add; }
	return dfs(index + 1, times * 10,num+ add) + dfs(index + 1, 1, num + add);
}

int main() {
	cin >> S;
	reverse(ALL(S));

	cout << dfs(0, 1,0)<<endl;

	return 0;
}

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

#define INF INT_MAX
#define ll long long
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,a,n) for(int i=0;i<n;i++)
#define mod 1000000007

using namespace std;

ll n,m;
ll a[26];

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

	ll n;
	string s;
	cin >> n >> s;

	vector<ll> f(26,0);

	for(int i=0;i < 26;i++)a[i]=0;

	ll c = 0;
	for(int i=0;i < s.size();i++){
		f[s[i] - 'a']++;
	}

	sort(f.begin(), f.end(), std::greater<ll>());
	for(int i=0;i<f.size();i++){
		if(!f[i]){
			break;
		}
		a[i] = f[i];
		c++;
	}
	ll ans =1;
	for(int i =0;i < c;i++){
		ans = (ans * (a[i]+1))%mod;
	}

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


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

template <class Monoid> struct SegmentTree{
    using Func = function<Monoid(Monoid, Monoid)>;

    int size;
    vector<Monoid> seg;
    const Func merge;
    const Monoid def;

    SegmentTree(int n, Monoid d, const Func f): merge(f), def(d){
        for(size = 1; size <= n; size <<= 1);
        seg.assign(size*2, def);
    }

    Monoid& operator[] (int i) { return seg[i+size]; };
    void build(){ for(int i = size-1;i >= 0;i--) seg[i] = merge(seg[i*2], seg[i*2+1]); }

    void update(int i, Monoid val){
        seg[i += size] = val;
        while(i >>= 1) seg[i] = merge(seg[i*2], seg[i*2+1]);
    }

    void add(int i, Monoid val){ update(i, val+seg[i+size]); }

    Monoid get(int a, int b){
        Monoid l = def, r = def;
        for(a += size, b += size; a < b; a >>= 1, b >>= 1){
            if(a & 1) l = merge(l, seg[a++]);
            if(b & 1) r = merge(r, seg[--b]);
        }
        return merge(l, r);
    }
};

int x[100010];
int l[100010];

vector<pair<int, int>> vec;

int main(){
    int n;
    cin >> n;
    for(int i = 0;i < n;i++){
        cin >> x[i] >> l[i];
        vec.push_back({x[i]+l[i]-1, x[i]-l[i]});
    }

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

    SegmentTree<int> seg(n, 0, [](int a, int b){ return max(a, b);});

    for(int i = 0;i < n;i++){
        int idx = upper_bound(vec.begin(), vec.end(), make_pair(vec[i].second-1, INT_MAX)) -  vec.begin();
        int num = seg.get(0, idx) + 1;
        seg.update(i, num);
    }

    cout << seg.get(0, n) << endl;
    return 0;
}

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

int main(){
  int N;
  cin >> N;
  int A[101];
  for(int i = 0; i < N; i++){
    cin >> A[i];
  }
  int count = 0;
  for(int i = 0 ; i < N; i++){
    int a = A[i];
    int minj;
    for(int j=i+1; j<N; j++){
      if(A[j] < a){
	a = A[j];
	minj = j;
      }
    }
    if(a < A[i]){
      count++;
      A[minj] = A[i];
      A[i] = a;
    }
  }

  for(int i=0; i<N; i++){
    if(i > 0)cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << count << endl;
  
  return 0;
}



Measured memory_bytes: 3104
import math
A,B = map(int,input().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if ((A<=1) and (B<=1)):
    print(0)
    exit()
if (B<=1):
    print(combinations_count(A,2))
    exit()
if (A<=1):
    print(combinations_count(B,2))
    exit()
print(combinations_count(A,2)+combinations_count(B,2))


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

const int INF = 1000000007;
const int MOD = 1000000007;


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

const int PRC = 10;

double dp[100001][PRC + 1];
double e[100001];

int main(){
    for(int i = 0; i <= 100000; i++){
        fill(dp[i], dp[i] + PRC + 1, 0);
    }
    dp[0][0] = 1;
    for(int i = 0; i < 100000; i++){
        for(int j = 0; j < PRC; j++){
            dp[i + 1][j + 1] += dp[i][j] / pow(2, j);
            dp[i + 1][0] += dp[i][j] * (1 - 1 / pow(2, j));
        }
    }
    e[0] = 0;
    for(int i = 1; i <= 100000; i++){
        e[i] = e[i-1];
        for(int j = 0; j < PRC; j++){
            e[i] += dp[i-1][j] / pow(2, j);
        }
    }
    while(true){
        int n;
        scanf("%d", &n);
        if(n == 0) break;
        printf("%.12f\n", e[n]);
    }
    return 0;
}

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

int n, m;
int x, y;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n >> m;
	x = 1, y = n;
	for(int i=0; i<m; ++i){
		int l, r;
		cin >> l >> r;
		x = max(x, l);
		y = min(y, r);
	}
	cout << max(0, y - x + 1) << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

const ll mod = 1e9 + 7;

ll lcm(ll a, ll b){
  	ll tmp, r, x = a * b;
  	if(a < b){
    	tmp = a;
    	a = b;
    	b = tmp;
  	}
  	r = a % b;
  	while(r != 0){
    	a = b;
    	b = r;
    	r = a % b;
  	}
  	return x / b;
}

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

    ll a, b;
    cin >> a >> b;
    ll res = lcm(a, b);
    cout << res << endl;
    return 0;
}

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

#define     F       first
#define     S       second
typedef pair<int, int>  pi;
typedef long long       ll;

const int MAX=1e6+6;
int n, a[MAX], freq[MAX];
bool cannot[MAX];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

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

        ++freq[a[i]];
        if (freq[a[i]]>1) {
            cannot[a[i]]=1;
        }
    }

    for (int i=1; i<MAX; ++i) {
        if (freq[i]) {
            for (int j=2; i*j<MAX; ++j) {
                cannot[i*j]=1;
            }
        }
    }

    int ans=0;
    for (int i=1; i<=n; ++i) {
        if (!cannot[a[i]]) {
            ++ans;
        }
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 9216
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//----------------------- Print Function ----------------------//

inline void print() {
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

template <typename T>
void print(const vector<T> &v) {
    for (auto e : v) cout << e << ' ';
    cout << endl;
}

//------------------------- Libraries -------------------------//

//--------------------------- Solve ---------------------------//

void solve() {
    string s; cin >> s;
    int ans;
    if (s == "SSS") ans = 0;
    if (s == "SSR") ans = 1;
    if (s == "SRS") ans = 1;
    if (s == "RSS") ans = 1;
    if (s == "RSR") ans = 1;
    if (s == "SRR") ans = 2;
    if (s == "RRS") ans = 2;
    if (s == "RRR") ans = 3;

    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    solve();

    return 0;
}

Measured memory_bytes: 3632
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double a = sc.nextDouble();
		double b = sc.nextDouble();
		String s = "-1";
		for(double i = 0D ; i < 10050D ; i += 1D) {
			if(Math.floor(i * 0.08D) == Math.floor(a) && Math.floor(i * 0.10D) == Math.floor(b)){
				BigDecimal bd = new BigDecimal(String.valueOf(i));
				BigDecimal bd1 = bd.setScale(0, RoundingMode.DOWN);
				s = bd1.toPlainString();
				break;
			}
		}
		sc.close();
			System.out.println(s);
	}
}



Measured memory_bytes: 26548
// SeeAlso: https://atcoder.jp/contests/abc057/tasks/abc057_b

#include <bits/stdc++.h>

using namespace std;

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

#define MAX 50
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }

int N, M;
ll a[MAX], b[MAX], c[MAX], d[MAX];

int main() {
    cin >> N >> M;
    REP(i, N) {
        cin >> a[i] >> b[i];
    }
    REP(i, M) {
        cin >> c[i] >> d[i];
    }

    REP(i, N) {
        int ans = 0;
        ll l = 200000000;
        REP(j, M) {
            ll temp = abs(a[i]-c[j])+abs(b[i]-d[j]);
            if (temp < l) {
                ans = j;
                l = temp;
            }
        }

        print(ans+1);
    }
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            SolveA();
            //SolveB();
            //SolveC();
            //SolveD();
        }
        private const long MOD = 1000000007;
        private static int s_maxWater;
        private static int s_maxSugar;
        private static double s_maxDensity = double.MinValue;
        static void SolveA()
        {
            int n = ReadAndParseInt();
            string ans = n / 10 == 9 || n % 10 == 9 ? "Yes" : "No";
            Console.WriteLine(ans);
        }

        #region よく使う便利関数
        private static bool isPrime(long x)
        {
            if (x == 2) { return true; }
            if (x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while (i * i <= x)
            {
                if (x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }
        private static long pow(long x, long n)
        {
            if (n == 0) { return 1; }
            long res = pow(x * x % MOD, n / 2);
            if (n % 2 == 1)
            {
                res = res * x % MOD;
            }
            return res;
        }
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        #endregion
    }
}

Measured memory_bytes: 11092
import java.util.*;


class Main{
public static void main(String[] args) {
  Scanner reader=new Scanner(System.in);
  int x=reader.nextInt();
  int sum=x;
  int happy=0;
  happy=sum/500*1000;
    sum=sum-sum/500*500;
    happy+=sum/5*5;
    System.out.println(happy);


}
}

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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP (i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back

using namespace std;

typedef long long ll;

const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const int MOD = 1000000007;

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

  vector<vector<int>> abc(n, vector<int>(3));
  rep (i, n) rep (j, 3) cin >> abc[i][j];

  vector<vector<int>> dp(n, vector<int>(3, 0));
  rep (i, n) rep (j, 3) {
    if (i == 0) dp[i][j] = abc[i][j];
    else {
      rep (k, 3) {
        if (j == k) continue;
        dp[i][j] = max(dp[i][j], dp[i - 1][k] + abc[i][j]);
      }
    }
  }

  int ans = 0;
  rep (i, 3) ans = max(ans, dp[n - 1][i]);

  cout << ans << endl;
}


Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<'\n';
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin>>a>>b>>c;
    a-=b;
    cout<<max(c-a,0)<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PGC
{
	class Program
	{
		static void Main(string[] args)
		{
			var header = Console.ReadLine().Split().Select(long.Parse).ToArray();
			var A = header[0];
			var B = header[1];
			var K = header[2];

			var a = Math.Max(A - K, 0);
			var b = Math.Max(B - (K - (A - a)), 0);

			System.Console.WriteLine($"{a} {b}");
		}
	}
}


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

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

	int X[100],Y[100];
	int mx=-100,my=100;
	for (int i = 0; i < n; i++){
		cin>>X[i];
		if(mx<X[i]){
			mx=X[i];
		}
		
		
	}
	for (int i = 0; i < m; i++){
		cin>>Y[i];
		if(my>Y[i]){
			my=Y[i];
		}
	}

	for (int i = x+1; i <= y; i++){
		if(i>mx&&i<=my){
			cout<<"No War"<<endl;
			return 0;
		}
	}

	cout<<"War"<<endl;


}


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

int main()
{
    int n{};
    std::cin >> n;
    std::vector<int> nums(n);
    for (int i = 0; i < n; i++) {
        std::cin >> nums[i];
    }

    int result = 0;
    int max = nums[0];
    int min = nums[0];
    const auto first = nums.begin();
    for (auto itr = first; itr != nums.end(); ++itr) {
        const auto pi = *itr;
        if (max < pi) {
            max = pi;
        }
        if (min >= pi) {
            min = pi;
            result++;
        }
    }
    std::cout << result << std::endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,l;cin>>n>>l;
    vector<string> s;
    for(int i=0;i<n;i++){
        string t;cin>>t;s.push_back(t);
    }
    sort(s.begin(),s.end());
    for(auto t:s){
        cout<<t;
    }
    cout<<endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int total = (int)Math.pow(3,n);
        int odds = 1;
        for(int i = 0; i < n; i++){
            int tmp = sc.nextInt();
            odds *= tmp % 2 == 0 ? 2 : 1;
        }
        System.out.println(total-odds);
    }
}


Measured memory_bytes: 23764
#include <iostream>
#include <algorithm>
#include <string>

int m, n;
std::string S, T;
int dp[2010][2010][2]; // 0: ?\???°(I??????), 1: ??¶??°(O??????)

int main() {
    std::cin >> m >> n;
    std::cin >> S >> T;

    int max = 0;
    for(int i = 0; i <= m; ++i) {
        for(int j = 0; j <= n; ++j) {
            if(S[i] == 'I') {
                dp[i + 1][j][0] = std::max(dp[i][j][1] + 1, dp[i + 1][j][0]);
            }else if(S[i] == 'O' && dp[i][j][0]){
                dp[i + 1][j][1] = std::max(dp[i][j][0] + 1, dp[i + 1][j][1]);
            }

            if(T[j] == 'I') {
                dp[i][j + 1][0] = std::max(dp[i][j][1] + 1, dp[i][j + 1][0]);
            }else if(T[j] == 'O' &&dp[i][j][0]){
                dp[i][j + 1][1] = std::max(dp[i][j][0] + 1, dp[i][j + 1][1]);
            }

            max = std::max(max, dp[i][j][0]);
        }
    }

    std::cout << max << std::endl;
}

Measured memory_bytes: 34576
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0 ; i < n ; i++) a[i] = sc.nextInt();
		Arrays.sort(a);
		int alice = 0;
		int bob = 0;
		int j = 0;
		for(int i = n - 1 ; i >= 0 ; i--) {
			if(j % 2 == 0) alice += a[i];
			else bob += a[i];
			j++;
		}
		System.out.println(alice - bob);
	}
}


Measured memory_bytes: 23764
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <iomanip>
#include <string>
#include <queue>
#include <numeric>
#include <functional>
#include <array>
#include <map>
#include <set>

#define INF 1000000007 //1000000000000000003
#define MOD 1000000007
#define MAX 2000005

#define ll long long

//printf("%.10f", );
//cout << fixed << setprecision(10) << heikin << endl;
//vector<vector<int>> data(3, vector<int>(4, -1));
//left + 1 < top

using namespace std;
using P = pair<int, int>;
using Pc = pair<double, int>;
using T = tuple<int, int, int>;
using edge = struct { int to; long long dist; };
const double PI = 3.141592653589793;
long long fact[MAX], inv[MAX];
int dx[] = { -1,0,1,0 };
int dy[] = { 0,-1,0,1 };

//////////////////////////////////

vector<vector<int>> bingo(3, vector<int>(3));
vector<vector<int>> tree(100005);
int color[100005];
map<P, int>colorMap;
int m = 0;

struct BridgeInfo {
	int town1;
	int town2;
	int year;
	BridgeInfo(int t1, int t2, int y) {
		town1 = t1;
		town2 = t2;
		year = y;
	}
};

struct People {
	int index;
	int town;
	int year;
	People(int i, int t, int y) {
		index = i;
		town = t;
		year = y;
	}
};

bool compare_by_second(pair<int, int> a, pair<int, int> b) {
	if (a.second != b.second) {
		return a.second < b.second;
	}
	else {
		return a.first < b.first;
	}
}

struct UnionFind {
	vector<int>uf;

	UnionFind(int size) :uf(size, -1) {};

	int root(int target) {
		if (uf[target] < 0)return target;
		else return uf[target] = root(uf[target]);
	}

	void merge(int a, int b) {
		a = root(a);
		b = root(b);
		if (a == b)return;
		if (uf[b] < uf[a])swap(a, b);
		uf[a] += uf[b];
		uf[b] = a;
	}
};

ll CalcPow(ll num, ll power) {
	if (power == 0)return 1;
	if (power % 2 == 0) {
		ll half = CalcPow(num, power / 2);
		return (half * half) % MOD;
	}
	else return (num * CalcPow(num, power - 1)) % MOD;
}

ll combination(ll all, ll select) {
	if (all < select) return 0;
	if (all < 0 || select < 0) return 0;
	return fact[all] * (inv[select] * inv[all - select] % MOD) % MOD;
}

void initCombination(int max) {
	fact[0] = fact[1] = 1;
	for (int i = 2; i <= max; ++i) {
		fact[i] = fact[i - 1] * i % MOD;
	}

	inv[max] = CalcPow(fact[max], MOD - 2);
	for (int i = max - 1; 0 <= i; --i) {
		inv[i] = (inv[i + 1] * (i + 1)) % MOD;
	}
}

struct Connection {
	vector<int>friends;
	vector<int>block;
	vector<int>friendable;
	Connection() {};
};

int N;

void dfs(string currentWord, char currentC) {
	if (currentWord.size() == N) {
		cout << currentWord << endl;
	}
	else {
		for (char c = 'a'; c <= currentC; ++c) {
			dfs(currentWord + c, c == currentC ? currentC+1 : currentC);
		}
	}
}

int main() {

	cin >> N;

	dfs("", 'a');
	return 0;
}



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

using namespace std;

void print( vector<int> &elems )
{
	vector<int>::iterator itr = elems.begin( );
	vector<int>::iterator itrE = elems.end( );

	while( itr != itrE-1 ) {
		cout<<*itr++<<" ";
	}
	cout<<*itr<<endl;
	return;
}

int main( )
{
	int n;
	cin>>n;
	
	vector<int> elems(n);
    for( int i=0; i<n; i++ ) {
        cin>>elems.at( i );
    }
    print( elems );
	
	int key, j;
	for( int i=1; i<n; i++ ) {
		key = elems.at( i );
		j = i - 1;
		while( 0 <= j and key < elems.at( j ) ) {
			elems.at( j+1 ) = elems.at( j );
			j--;
		}
		elems.at( j+1 ) = key;
		
		print( elems );
	}
	
	return 0;
}

Measured memory_bytes: 1196
#include<stdio.h>
int main()
{
    long long a,b,c;
    while(scanf("%lld%lld",&a,&b)!=EOF)
    {
        while(b!=0)
       { c=a%b; a=b;  b=c;}
       printf("%d\n",a);
    }
    return 0;
}


Measured memory_bytes: 2080
import java.util.Scanner;

class Main{
	public static void main(String[] ag) {
		Scanner sc=new Scanner(System.in);
		int moto=sc.nextInt();
		int bbn=sc.nextInt();

		char[][] mtgz=new char[moto][moto];
		char[][] bbgz=new char[bbn][bbn];

		String a="";
		for(int i=0; i<moto; i++) {
			a=sc.next();
			for(int j=0; j<moto; j++){
				mtgz[i][j]=a.charAt(j);
			}
		}

		for(int i=0; i<bbn; i++) {
			a=sc.next();
			for(int j=0; j<bbn; j++){
				bbgz[i][j]=a.charAt(j);
			}
		}
		boolean it=true;
		for(int i=0; i<moto-bbn+1; i++) {
			for(int j=0; j<moto-bbn+1; j++) {
				it=true;

				for(int k=0; k<bbn; k++) {
					for(int l=0; l<bbn; l++) {
						if(mtgz[i+k][j+l]!=bbgz[k][l]) {
							it=false;
							break;
						}
					}
					if(it==false) {
						break;
					}
					else {
						//
					}
				}

				if(it==true) {
					System.out.println("Yes");
					System.exit(0);
				}
			}
		}

		System.out.println("No");
		System.exit(0);
	}
}

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

vector<int>bit;

void convert(int);

int main(){
  while(1){
    double n, num2;
    int num;
    cin >> n;
    if(n<0) break;
    bit.clear();
    num=(int)n;
    num2=n-num;
    convert(num);

    string out;
    
    if(num2==0.5){
      out ="1000";
    }
    else if(num2==0){
      out="0000";
    }
    else if(num2==0.25){
      out="0100";
    }
    else if(num2==0.125){
      out = "0010";
    }
    else if(num2==0.0625){
      out = "0001";
    }
    else if(num2==0.1875){
      out = "0011";
    }
    else if(num2==0.3125){
      out = "0101";
    }
    else if(num2==0.375){
      out = "0110";
    }
    else if(num2==0.4375){
      out = "0111";
    }
    else if(num2==0.5625){
      out = "1001";
    }
    else if(num2==0.625){
      out = "1010";
    }
    else if(num2==0.6875){
      out = "1011";
    }
    else if(num2==0.75){
      out = "1100";
    }
    else if(num2==0.8125){
      out = "1101";
    }
    else if(num2==0.875){
      out = "1110";
    }
    else if(num2==0.9375){
      out = "1111";
    }
    else{
      cout << "NA" << endl;
      continue;
    }

    int l=bit.size();
    if(l>8){
      cout << "NA" << endl;
      continue;
    }
    for(int i=0;i<8-l;i++){
      cout << '0';
    }
    for(int i=0;i<l;i++){
      if(bit[i]==-1) break;
      cout << bit[i];
    }
    cout << '.';
    cout << out;
    cout << endl;
  }
  return 0;
}

void convert(int x){
  if(x==0) return;
  convert(x/2);
  bit.push_back(x%2);
}

Measured memory_bytes: 0
def gcd(a,b)
  if a%b==0
    b
  else
    gcd(b,a%b)
  end
end

def lcm(a, b)
  a*b/gcd(a, b)
end

n=gets.to_i
as=gets.split.map(&:to_i)

g=as.inject(1){|res, a| lcm(res,a)}

ans=0
as.each do |a|
  ans+=g/a
end
p ans%1000000007


Measured memory_bytes: 79992
#include<cstdio>
#include<algorithm>
using namespace std;
int cmp(int a,int b)
{
    int x,y;
    x=a%10==0?10:a%10;
    y=b%10==0?10:b%10;
    return 10-x<10-y;
}
int main()
{
    int s=0,a[5];
    for(int i=0;i<5;i++)
        scanf("%d",&a[i]);
    sort(a,a+5,cmp);
    for(int i=0;i<5;i++)
    {
        int x=a[i]%10==0?10:a[i]%10;
        s+=i!=4?a[i]+10-x:a[i];
        //printf("%d %d\n",a[i],s);
    }
    printf("%d",s);
    return 0;
}


Measured memory_bytes: 128
from sys import stdin
import math
def I(): return int(stdin.readline().rstrip())

n = I()
m = n
l = []
for i in range(2,int(math.sqrt(n))+1):
    if n==1 or n<i:
        break
    if n%i==0:
        c = 0
        while n%i==0:
            n//=i
            c += 1
        for j in range(1,c+1):
            l.append(i**j)
    i += 1
if n!=1:
    l.append(n)

l.sort()
ans = 0
for i in l:
    if m==1 or m<i:
        break
    else:
        if not m%i:
            m/=i
            ans += 1

print(ans)

Measured memory_bytes: 9272
#include <algorithm>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

int main() {
    int A, P;
    cin >> A >> P;
    cout << (A * 3 + P) / 2 << endl;

    return 0;
}


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

N, M = MAP()
L = [LIST() for i in range(N)]
a = set([i + 1 for i in range(M)])
for l in L:
    s = set(l[1:])
    a &= s
print(len(a))
    

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

int main(){
	int a,b;
	cin >> a >> b;
	if(a > b)cout << a - 1 << endl;
	else cout << a << endl;
}

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

using namespace std;
int main()
{
    char s[101],t[101],x[101];

    cin >> s;
    cin >> t;
    int l,k,count=0,total=0;
    l=strlen(s);
    k=strlen(t);
    if (k==l)
    {
        for (int i=0;i<l;i++)
          {
            if (s[i]==t[i])
			{
				count++;
			}

            else
            {
            	 break;
            }
          }
        if (count==l)
          {
            cout << "Yes" << endl;
          }
        else
          {
            for (int j=0;j<=l;j++)
              {
                total=0;
                x[0]=s[l-1];
                for (int i=1;i<l;i++)
                  {
                    x[i]=s[i-1];
                  }
                for (int i=0;i<l;i++)
                  {
                    s[i]=x[i];
                  }
                for (int k=0;k<l;k++)
                  {
                    if (s[k]==t[k])
					{
						total++;
					}

                    else
					{
						break;
					}

                  }
                if (total==l)
                  {
                    cout << "Yes" << endl;
                    break;
                  }
                else if (j==l)
                  {
                    cout << "No" << endl;

                  }

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

}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
vector<pair<int, int>> vec;
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		vec.emplace_back(make_pair(a, b));
	}
	sort(vec.begin(), vec.end());
	long long ans = vec[n - 1].first + vec[n - 1].second;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1400
import math
k=int(input())
ans=0
gcd1=[0]*200
for i in range(1,k+1):
    for j in range(1,k+1):
        gcd1[math.gcd(i,j)-1]+=1


for i in range(1,k+1):
    for j in range(1,k+1):
        if gcd1[j-1]>=1:
            ans+=math.gcd(j,i)*gcd1[j-1]

print(ans)

Measured memory_bytes: 9144
x, y = map(int, input().split())

turu = (4*x-y)//2
# print(turu)

if (turu < 0) or (2*x > y):
    print("No")
    exit()

if ((y-turu*2) % 4 == 0):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9172
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<cstring>

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
#define P pair<ll, ll>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl

class mint {
    long long x;
public:
    mint(long long x=0) : x((x%MOD+MOD)%MOD) {}
    mint operator-() const {
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

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

/* -- template -- */

int ans[200000];
int main() {
    int N, Q; cin >> N >> Q;
    int S[N], T[N], X[N];
    pair<int, pair<int, int>> XST[N];
    rep(i, N)
        cin >> (XST[i].second).first >> (XST[i].second).second >> XST[i].first, --(XST[i].second).first;
    int D[Q];
    rep(i, Q)
        cin >> D[i];
    rep(i, Q)ans[i] = INF;
    sort(XST, XST + N);

    int minv[Q];rep(i, Q)minv[i] = i;
    //int maxv[Q];rep(i, Q)maxv[i] = i;

    rep(i, N) {
        int u = upper_bound(D, D + Q, (XST[i].second).first - XST[i].first) - D;
        int d = lower_bound(D, D + Q, (XST[i].second).second - XST[i].first) - D - 1;
        u = minv[u];
        //d = maxv[d];
        for(int j = u;j <= d;++j) {
            j = minv[j];
            if(j > d)break;
            minv[j] = d + 1;
            //maxv[j] = ((u - 1 < 0) ? 0 : u - 1);
            if(ans[j] != INF)continue;
            ans[j] = XST[i].first;
        }
    }
    rep(i, Q)print((ans[i] == INF) ? -1 : ans[i]);
}


Measured memory_bytes: 6528
#include<iostream>
#include<vector>
#include<unordered_map>

int gcd(int a, int b) {
    if (a == 0) return b;
    if (b == 0) return a;
    return gcd(b, a % b);
}

int main() {
    using namespace std;

    vector<int> primes = {2, 3, 5, 7, 11, 13, 17, 19, 23,
        29, 31, 37, 41, 43, 47, 53, 59, 61, 67,
        71, 73, 79, 83, 89, 97, 101, 103, 107, 109,
        113, 127, 131, 137, 139, 149, 151, 157, 163, 167,
        173, 179, 181, 191, 193, 197, 199, 211, 223, 227,
        229, 233, 239, 241, 251, 257, 263, 269, 271, 277,
        281, 283, 293, 307, 311, 313, 317, 331, 337, 347,
        349, 353, 359, 367, 373, 379, 383, 389, 397, 401,
        409, 419, 421, 431, 433, 439, 443, 449, 457, 461,
        463, 467, 479, 487, 491, 499, 503, 509, 521, 523,
        541, 547, 557, 563, 569, 571, 577, 587, 593, 599,
        601, 607, 613, 617, 619, 631, 641, 643, 647, 653,
        659, 661, 673, 677, 683, 691, 701, 709, 719, 727,
        733, 739, 743, 751, 757, 761, 769, 773, 787, 797,
        809, 811, 821, 823, 827, 829, 839, 853, 857, 859,
        863, 877, 881, 883, 887, 907, 911, 919, 929, 937,
        941, 947, 953, 967, 971, 977, 983, 991, 997};
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i=0;i<n;i++) cin >> arr[i];

    int totgcd = 0;
    for (int num: arr) totgcd = gcd(totgcd, num);

    if (totgcd != 1) {
        cout << "not coprime" << endl;
        return 0;
    } 

    unordered_map<int, int> prime___neighs_nr;

    for (int i=0;i<n;i++) {
        int num = arr[i];
        for (int prime: primes) {
            if (num % prime == 0) {
                if (prime___neighs_nr.find(prime) != prime___neighs_nr.end()) {
                    // cerr << num << " " << prime << endl;
                    cout << "setwise coprime" << endl;
                    return 0;
                }
                prime___neighs_nr[prime] = 1;
                while (num%prime == 0)
                {
                    num /= prime;
                }
                
                
            }

        }
            if (num != 1) {
        if (prime___neighs_nr.find(num) != prime___neighs_nr.end()) {
            // cerr << num << " " << num << endl;
            cout << "setwise coprime" << endl;
            return 0;
        }
        prime___neighs_nr[num] = 1;
    }
    }
    cout << "pairwise coprime" << endl;
    return 0;


}

Measured memory_bytes: 7216
#include <bits/stdc++.h>
using namespace std;
using LL  = long long;
using VI  = vector<LL>;
using VVI = vector<VI>;
using VB  = vector<bool>;
using VS  = vector<string>;
using PII = pair<LL, LL>;
using VP  = vector<PII>;
#define PB           push_back
#define MP           make_pair
#define SZ(a)        LL((a).size())
#define EACH(x, c)   for (auto x : (c))
#define ALL(c)       (c).begin(), (c).end()
#define REVERSE(c)   reverse(ALL(c))
#define SORT(c)      stable_sort(ALL(c))
#define RSORT(c)     stable_sort((c).rbegin(), (c).rend())
#define FSORT(c)     stable_sort(ALL(c), [] (auto& x, auto& y) {return x.first < y.first;});
#define FRSORT(c)    stable_sort(ALL(c), [] (auto& x, auto& y) {return x.first > y.first;});
#define SSORT(c)     stable_sort(ALL(c), [] (auto& x, auto& y) {return x.second < y.second;});
#define SRSORT(c)    stable_sort(ALL(c), [] (auto& x, auto& y) {return x.second > y.second;});
#define FOR(i, a, b) for (LL i = (a); i < (b); ++i)
#define REP(i, n)    FOR(i, 0, n)
#define DEBUG true
#define $(x) {if (DEBUG) {cout << #x << " = " << (x) << endl;}}


int main() {
    LL N;
    cin >> N;
    VI A(N);
    unordered_map<LL, LL> C;
    REP(i, N) {
        cin >> A[i];
        C[A[i]]++;
    }
    LL n_even = 0;
    EACH(c, C) {
        if (c.second % 2 == 0) n_even++;
    }
    cout << SZ(C) - (n_even % 2 == 0 ? 0 : 1) << endl;
	
    return 0;
}


Measured memory_bytes: 5156
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
using namespace __gnu_pbds; 
using namespace std;



typedef tree<long long, null_type, less<long long>, rb_tree_tag, 
             tree_order_statistics_node_update> 
    new_data_set; 
 
 
//defines
typedef long long ll;
typedef long double ld;

    
ll a,b,c,n,m,k,t=1;

void solve()
{ 
  cin>>n;
  cout<<(ll)(pow(n,3LL)+0.5);
 if(t>0)cout<<"\n";
}

int32_t main()
{
#ifdef ONPC
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

  //cin>>t;
    while(t--)
    {
        solve();
    }
  //cout<<sum;
        
    return 0;
}

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

int main() {
  vector<int> time(3);
  for(int i = 0; i < 3; i++){
    cin >> time.at(i);
  }
  sort(time.begin(), time.end());
  cout << time.at(0) + time.at(1) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
typedef long long ll;
using namespace std;

int main(void) {
    ll N,K;
    cin>>N>>K;
    vector<ll> monster;
    for (int i = 0; i < N; i++)
    {
        int H;
        cin>>H;
        monster.push_back(H);
    }
    sort(monster.begin(), monster.end());
    reverse(monster.begin(), monster.end());
    if (N <= K) cout << 0 << endl;
    else {
        ll result = 0;
        for (int i = K; i < N; i++)
        {
            result += monster.at(i);
        }
        cout << result << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3052
#include<bits/stdc++.h>
using namespace std;
#define I_O		ios::sync_with_stdio(false),cin.tie(0)
#define ll		long long
#define ff		first
#define ss		second
#define mod 		1000000007
#define rep(i,n)	for(ll i=1;i<=n;i++)
#define repv(i,a,n)	for(ll i=a;i<=n;i++)
#define pb 		push_back
#define newl		'\n'
#define deb(x)		cout<<x<<" "
int main() 
{  
	I_O;
	ll n,q,b,c;	cin>>n;
	ll sum = 0;	map<ll,ll> m;
	ll a[n+1];	rep(i,n)	cin>>a[i],sum+=a[i],m[a[i]]++;
	cin>>q;
	while(q--)
	{
		cin>>b>>c;
		ll x = m[b];
		sum = sum - (b*x);
		sum = sum + (c*x);
		m[b] = 0;
		m[c]+=x; 
		cout<<sum<<newl;
	}
} 


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

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

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

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


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

ll dp[100010];
int main(){
    ll n,k;
    cin >> n >> k;
    VI h(n);
    rep(i,n) cin >> h[i];
    rep(i,n) dp[i] = 1e9;
    dp[0] = 0;
    rep(i,n-1){
        int range = min(i+k+1,n);
        FOR(j,i+1,range){
            dp[j] = min(dp[j],abs(h[i]-h[j]) + dp[i]);
        }
    }
    cout << dp[n-1] << endl;
    return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>

using namespace std;
typedef long long ll;

int main()
{
    ll d, t, s;
    cin >> d >> t >> s;
    if (d <= t * s)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

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

int main() {
  char A;
  char B;
  cin >> A;
  cin >> B;
  if ( A > B ) {
    cout << ">" << endl;
  }
  else if ( A < B ) {
    cout << "<" << endl;
  }
  else {
    cout << "=" << endl;
  }
  
  
  
  
  
  

  
  
}




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

int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> v(n + 1, 0);

  int cnt = 0;
  for (int i = 1; i <= s.size(); i++) {
    if (s.at(i - 1) == ('#')) {
      cnt++;
    }
    v.at(i) = cnt;
  }

  int ans = 1000000000;
  for (int i = 0; i <= s.size(); i++) {
    int tmp = 0;
    // left white right black
    tmp += v.at(i);
    tmp += n - i - (v.at(n) - v.at(i));
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}


Measured memory_bytes: 1412