akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  cout << n*(n+1)/2 << endl;
}


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

namespace MyProgram{
    public class Program
    {	
        public static void Main(string[] args){
            string[] s = Console.ReadLine().Split(' ');
            int W = int.Parse(s[0]);
            int a = int.Parse(s[1]);
            int b = int.Parse(s[2]);
            
            int ans = 0;
            if(a < b)
            {
                ans = b - (a + W); 
            }
            else
            {
                ans = a - (b + W);
            }
            
            
            if(ans < 0) ans = 0;
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>

using namespace std;

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

  if(a <= b & b <= c)
    cout << a+b << endl; 
  else if(a <= c & c <= b)
    cout << a+c << endl; 
  else if(b <= c & c <= a)
    cout << b+c << endl;
  else if(b <= a & a <= c)
    cout << b+a << endl;
  else if(c <= a & a <= b)
    cout << a+c << endl;
  else if(c <= b & b <= a)
    cout << c+b << endl;
  
}

Measured memory_bytes: 3616
def main():
    n = int(input())
    array = list(map(int, input().split()))

    if len(array) == 1:
        return 'Yes'
    else:
        for i in reversed(range(1,n)):
            dif = array[i] - array[i - 1]
            if dif == -1:
                array[i-1] = array[i-1] - 1
            elif dif < -1:
                return 'No'
        return 'Yes'

print(main())

Measured memory_bytes: 14252
/*
  no pain, no gain
*/

#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx,avx2,fma")
#include <bits/stdc++.h>
#define fr first
#define sc second
#define pb push_back
#define szof(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define pii pair<int, int>
#define all(s) s.begin(), s.end()
#define prev myrza4321
#define y1 myrza1234
#define OK puts("OK")
using namespace std;

const int N = (int)1e5 + 5;
const int INF = 0x3f3f3f3f;


struct S {
  int l, r, x, cost;
  S(int l_, int r_, int x_, int cost_) {
    l = l_, r = r_, x = x_, cost = cost_;
  }
};

int a[11];
int n, mx, Q, ans = 0;
vector <S> q;

void dfs(int pos = 1) {
  if (pos > n) {
    int sum = 0;
    for (auto c : q) {
      if (a[c.r] - a[c.l] == c.x) {
        sum += c.cost;
      }
    }
    ans = max(ans, sum);
    return;
  }
  for (int i = 1; i <= mx; i++) {
    if (pos > 1 && a[pos - 1] > i) {
      continue;
    }
    a[pos] = i;
    dfs(pos + 1);
  }
}

main() {
  cin >> n >> mx >> Q;
  while (Q--) {
    int l, r, x, cost;
    scanf("%d %d %d %d", &l, &r, &x, &cost);
    q.pb(S(l, r, x, cost));
  }
  dfs();
  cout << ans;
}


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

const double EPS = 1e-8;
const double INF = 1e12;

//point
typedef complex<double> P;
namespace std {
	bool operator < (const P& a, const P& b) {
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}
double cross(const P& a, const P& b) {
	return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
	return real(conj(a)*b);
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;								  // a--c--b on line
}

// line
struct L : public vector<P> {
	L(const P& a, const P& b) {
		push_back(a); push_back(b);
	}
};

// polygon
typedef vector<P> G;

P extreme(const vector<P> &po, const L &l) {
  int k = 0;
  for (int i = 1; i < po.size(); ++i)
    if (dot(po[i], l[1]-l[0]) > dot(po[k], l[1]-l[0])) k = i;
  return po[k];
}

enum { OUT, ON, IN };
int contains(const G& po, const P& p) {
  bool in = false;
  for (int i = 0; i < po.size(); ++i) {
  	P a = po[i] - p, b = po[(i+1)%po.size()] - p;
    if (imag(a) > imag(b)) swap(a, b);
    if (imag(a) <= 0 && 0 < imag(b))
      if (cross(a, b) < 0) in = !in;
    if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
  }
  return in ? IN : OUT;
}

double area2(const G& po) {
	double A = 0;
  	for (int i = 0; i < po.size(); ++i) 
    	A += cross(po[i], po[(i+1)%po.size()]);
	//????????????????????????????????¨????????????
  	return A/2;
}

bool isconvex(const G &p) {
	int n = p.size();
	if(cross(p[0]-p[n-1],p[n-2]-p[n-1]) < 0) return false;
	for(int i = 1; i < n-1; ++i) {
		if(cross(p[i+1]-p[i],p[i-1]-p[i]) < 0) return false;
	}
	return true;

}
	
int main() {
	int n;
	cin >> n;
	G po;
	for(int i=0; i<n; ++i) {
		double x, y;
		cin >> x >> y;
		P p(x, y);
		po.push_back(p);
	}
	int q;
	cin >> q;
	for(int i=0; i<q; ++i) {
		double x, y;
		cin >> x >> y;
		P p(x, y);
		if(contains(po, p) == IN) cout << 2 << endl;
		else if(contains(po, p) == ON) cout << 1 << endl;
		else cout << 0 << endl;
	}
}

Measured memory_bytes: 3228
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>


using std::cout;
using std::cin;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;




ll gcd(ll a, ll b) {
    while (b != 0) {
        auto tmp = a;
        a = b;
        b = tmp % a;
    }
    return a;
}



void oneCase () {
    int n;
    cin >> n;
    int count = 0;
    int m = n;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        if (a <= m) {
            ++count;
        }
        m = min(m, a);
    }
    cout << count << "\n";


}




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

    return 0;
}

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

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    int N = sc.nextInt();
    int[] A = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextInt();
    }
    Arrays.sort(A);
    int max = 0;
    for (int i = 1; i < N; i++) {
      max = Math.max(A[i] - A[i-1], max);
    }
    max = Math.max(K + A[0] - A[N-1], max);
    System.out.print(K - max);
  }
}


Measured memory_bytes: 84868
#include<stdio.h>
int main(void){
	int h,m,s,a;
	while(scanf("%d %d %d",&h,&m,&s),h!=-1){
		a=7200-(h*3600+m*60+s);
		h=a/3600;
		m=(a-h*3600)/60;
		s=a-(h*3600+m*60);
		printf("%02d:%02d:%02d\n",h,m,s);
		a*=3;
		h=a/3600;
		m=(a-h*3600)/60;
		s=a-(h*3600+m*60);
		printf("%02d:%02d:%02d\n",h,m,s);
	}
	return 0;
}

Measured memory_bytes: 612
#include<bits/stdc++.h> 
using namespace std; 
  
const int MAX = 5e5 + 10; 

struct Query 
{ 
    int l, r, idx; 
}; 
bool cmp(Query x, Query y) 
{ 
    return x.r < y.r; 
} 
void update(int idx, int val, int bit[], int n) 
{ 
    for (; idx <= n; idx += idx&-idx) 
        bit[idx] += val; 
} 
int query(int idx, int bit[], int n) 
{ 
    int sum = 0; 
    for (; idx>0; idx-=idx&-idx) 
        sum += bit[idx]; 
    return sum; 
} 
void answeringQueries(int arr[], int n, Query queries[], int q) 
{ 
    int bit[n+1]; 
    memset(bit, 0, sizeof(bit)); 
    int last_visit[MAX]; 
    memset(last_visit, -1, sizeof(last_visit)); 
    int ans[q]; 
    int query_counter = 0; 
    for (int i=0; i<n; i++) 
    { 
        if (last_visit[arr[i]] !=-1) 
            update (last_visit[arr[i]] + 1, -1, bit, n); 
        last_visit[arr[i]] = i; 
        update(i + 1, 1, bit, n); 
        while (query_counter < q && queries[query_counter].r == i) 
        { 
            ans[queries[query_counter].idx] = 
                     query(queries[query_counter].r + 1, bit, n)- 
                     query(queries[query_counter].l, bit, n); 
            query_counter++; 
        } 
    } 
    for (int i=0; i<q; i++) 
        cout << ans[i] << endl; 
} 
void solve(){
    int  n, q;
    cin >> n >> q;
    int arr[n];
    for(int i = 0; i < n; i++){
        cin >> arr[i];
    }
    Query queries[q]; 
    for(int i = 0; i < q; i++){
        cin >> queries[i].l >> queries[i].r;
        queries[i].r--;
        queries[i].l--;
        queries[i].idx = i;
    }
    sort(queries, queries+q, cmp); 
    answeringQueries(arr, n, queries, q); 
}

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

    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
        
    int t = 1;

    while(t--){
        solve();
    }

    return 0;
}

Measured memory_bytes: 17444
import java.util.*;
class Main{
	static Scanner s=new Scanner(System.in);
	public static void main(String[]$){
		long i=g(),o=g(),t=g(),j=g(),l=g(),r=l/2*2+j/2*2+i/2*2;
		if(l>0&&j>0&&i>0)
			r=Math.max(r,3+(l-1)/2*2+(j-1)/2*2+(i-1)/2*2);
		System.out.println(r+o);
	}
	static long g(){
		return s.nextLong();
	}
}

Measured memory_bytes: 23764
#include <stdio.h>
int main() {
    char ar[100];
    int x=0,i,j;
    
        scanf("%s",&ar);
   if (ar[0]== 'M' && ar[1]== 'O')
      x=6;
   else if (ar[0]== 'T' && ar[1]== 'U') 
    x = 5;
    else if (ar[0]== 'W' && ar[1]== 'E') 
    x = 4;
    else if (ar[0]== 'T' && ar[1]== 'H') 
    x = 3;
    else if (ar[0]== 'F' && ar[1]== 'R') 
    x = 2;
    else if (ar[0]== 'S' && ar[1]== 'A') 
    x = 1;
    else 
    x = 7;
    
    printf("%d",x);
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <functional>
#include <cmath>
#include <array>
 
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
 
using namespace std;
typedef long long ll; typedef vector<int> VI;
typedef pair<int,int> pii;
const int mod = (int)1e9+7;

const int KJ = 3000;

int main()
{
	
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, a;
	cin >>n >>a;
	VI x(n);
	rep(i,n) cin >> x[i];
	
	vector<ll> cp( KJ*2, 0);
	cp[KJ] = 1;
	auto np = cp;
	rep(i, n){
		rep2(j, KJ-a*n,  KJ +a*n+2) if(cp[j]>0){
			np[j + a -x[i]] += cp[j];
		}
		cp = np;
	}
	
	cout << cp[KJ] - 1 <<endl;
	
	return 0;
}

Measured memory_bytes: 508
#include<stdio.h>

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

 scanf("%d%d%d",&a,&b,&c);

 if((a>=b)&&(a>=c))printf("%d\n",10*a+b+c);
 else if((b>=a)&&(b>=c))printf("%d\n",10*b+a+c);
 else printf("%d\n",c*10+a+b);

 return 0;
}

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

#define ld long double
#define ll long long
#define ALL(a)  (a).begin(),(a).end()
#define spa << " " <<
ll MOD = 1e9+7;
void chmin(ll &a, ll b) { if (a > b) a = b; }
void chmax(ll &a, ll b) { if (a < b) a = b; }

int main(){
  ll i, j;
  ll n, k;
  cin >> n >> k;
  vector<ll> x(n);
  for(i = 0; i < n; i++)
    cin >> x[i];
  ll mint = MOD;
  for(i = 0; i <= n - k; i++){
    if(x[i + k - 1] <= 0)
      chmin(mint, -x[i]);
    else if(x[i] >= 0)
      chmin(mint, x[i + k - 1]);
    else
      chmin(mint, x[i + k - 1] - x[i] + min(-x[i], x[i + k - 1]));
  }
  cout << mint << endl;

  return 0;
}

Measured memory_bytes: 1024
def calc1(x1,y1,x2,y2,x3,y3):
  a=x1-x2
  b=y1-y2
  c=x2-x3
  d=y2-y3
  if a*d-b*c==0:
    return [0,0,0]
  x4=(d*((x1**2+y1**2)-(x2**2+y2**2))-b*((x2**2+y2**2)-(x3**2+y3**2)))/(2*(a*d-b*c))
  y4=(-c*((x1**2+y1**2)-(x2**2+y2**2))+a*((x2**2+y2**2)-(x3**2+y3**2)))/(2*(a*d-b*c))
  r=((x1-x4)**2+(y1-y4)**2)**0.5
  return [x4,y4,r]
def calc2(x1,y1,x2,y2):
  r=(((x2-x1)**2+(y2-y1)**2)**0.5)/2
  return [(x1+x2)/2,(y1+y2)/2,r]

eps=10**(-9)
n=int(input())
arr=[list(map(int,input().split())) for _ in range(n)]
ans=10**18
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      cx,cy,r=calc1(arr[i][0],arr[i][1],arr[j][0],arr[j][1],arr[k][0],arr[k][1])
      for l in range(n):
        tx,ty=arr[l]
        if ((cx-tx)**2+(cy-ty)**2)>r**2+eps:
          break
      else:
        ans=min(ans,r)
for i in range(n):
  for j in range(i+1,n):
    cx,cy,r=calc2(arr[i][0],arr[i][1],arr[j][0],arr[j][1])
    for k in range(n):
      tx,ty=arr[k]
      if ((cx-tx)**2+(cy-ty)**2)>r**2+eps:
        break
    else:
      ans=min(ans,r)
print(ans)

Measured memory_bytes: 3444
#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 ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n,m,k; cin >> n >> m >> k;
  vector<ll> a(n), b(m);
  REP(i,n) cin >> a[i];
  REP(i,m) cin >> b[i];
  
  vector<ll> as(n+1, 0), bs(m+1, 0);
  REP(i,n) as[i+1] = as[i] + a[i];
  REP(i,m) bs[i+1] = bs[i] + b[i];

  int ans = 0;
  REP(i,n+1){
    if(as[i]>k) break;
    ll rest = k - as[i];
    auto itr = upper_bound(ALL(bs), rest);
    itr--;
    int tmp = i + (itr - bs.begin());
    ans = max(ans, tmp);
  }
  REP(i,m+1){
    if(bs[i]>k) break;
    ll rest = k - bs[i];
    auto itr = upper_bound(ALL(as), rest);
    itr--;
    int tmp = i + (itr - as.begin());
    ans = max(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 9528
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()

    var ans = arrayOfNulls<Int>(n)
    val a = readLine()!!.split(" ").map(String::toInt)
    var cnt = 1
    a.forEach {
        ans[it -1] = cnt
        cnt++
    }
    for (i in 1..n) {
        if (i > 1) print(" ")
        print(ans[i -1])
    }
    println()
}


Measured memory_bytes: 60380
d,n = gets.chomp.split(" ").map(&:to_i)

if d == 0 then
  if n == 100 then
    puts 101
  else
    puts n
  end
elsif d == 1 then
  if n == 100 then
    puts 100 * n + 100
  else
    puts 100 * n
  end
else
  if n == 100 then
    puts 10000 * n + 10000
  else
    puts 10000 * n
  end
end


Measured memory_bytes: 1788
def main():
    N = int(input())
    c = input()
    ans = c.count('W')
    if ans == 0 or ans == N:
        print(0)
        exit()
    
    Ws = []
    Rs = []
    for i in range(N):
        if c[i] == 'W':
            Ws.append(i)
        if c[N-1-i] == 'R':
            Rs.append(N-1-i)

    Ws.append(N+1)
    Rs.append(-1)
    tmp = 0
    while Ws[tmp] < Rs[tmp]:
        tmp += 1
    
    print(min(ans,tmp))

if __name__ == "__main__":
    main()

Measured memory_bytes: 80780
# coding: utf-8

# https://atcoder.jp/contests/abc119


def main():
    N, A, B, C = map(int, input().split())
    ls = [None] * N
    for i in range(N):
        ls[i] = int(input())

    abc_mp = []

    def rec(i, a, b, c, mp, ls):
        if i == len(ls):
            if a > 0 and b > 0 and c > 0:
                abc_mp.append([a, b, c, mp-30])
        else:
            rec(i+1, a+ls[i], b, c, mp+10, ls)
            rec(i+1, a, b+ls[i], c, mp+10, ls)
            rec(i+1, a, b, c+ls[i], mp+10, ls)
            rec(i+1, a, b, c, mp, ls)

    rec(0, 0, 0, 0, 0, ls)
    a0, b0, c0, mp0 = abc_mp[0]
    ans = mp0 + abs(A-a0) + abs(B-b0) + abs(C-c0)
    for a, b, c, mp in abc_mp:
        cand = mp + abs(A-a) + abs(B-b) + abs(C-c)
        if cand < ans:
            ans = cand

    return ans


print(main())


Measured memory_bytes: 15280
import java.util.TreeMap;
import java.util.Map.Entry;
import java.util.Map;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String, Integer> map = new TreeMap<>();
		int max = 0;
		for(int i=0;i<n;i++){
			String s = sc.next();
			int c = 0;
			if(map.containsKey(s)){
				c = map.get(s);
			}
			map.put(s, ++c);
			if(max<c){
				max = c;
			}
		}
		sc.close();
		for(Entry<String, Integer> s : map.entrySet()){
			if(s.getValue()==max)System.out.println(s.getKey());
		}
	}
}

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

int main() {
	while (1) {
		map<int, int>s;
		int a;
		cin >> a;
		if (a == 0)break;
		for (int b = 0; b < a; b++) {
			int  c, d, e;
			cin >> c >> d >> e;
			s.insert(pair<int, int>(d + e, c));
		}
		auto m = s.end();
		m--;
		cout << m->second <<" "<< m->first << endl;
   }
}

Measured memory_bytes: 3556
# -*- coding: utf-8 -*-
import math

a,b,x = map(int,input().split())

if 2*x/(a*b) <= a:
    print(math.degrees(math.atan(a*b**2/(2*x))))
else:
    print(math.degrees(math.atan(2*(a**2*b-x)/a**3)))

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

using namespace std;
#define ll long long int
int main()
{
    ll n,sum;
    cin>>n;
    ll a[n];
    for(int i=0;i<n;i++)cin>>a[i];

    sort(a,a+n,greater<int>());
    sum=0;
    for(int i=1;i<n;i++)sum+=a[i/2];

    cout<<sum<<endl;

}


Measured memory_bytes: 5192
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
    int N; cin >> N;
    vl data(N);
    F0R(i, N) cin >> data[i];

    ll ans = 0;
    F0R(bit, 60) {
        ll mul = (1ll << bit);
        ll count[2]; count[0] = 0; count[1] = 0;
        mul %= MOD;
        int cur = 0;
        F0R(i, N) {
            cur = 0;
            if (data[i] & (1ll << bit)) cur = 1;
            count[cur]++;
        }
        ll prod = count[0] * count[1]; prod %= MOD;
        prod *= mul; prod %= MOD;
        ans += prod; ans %= MOD;
    }
    cout << ans << endl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343



Measured memory_bytes: 2560
#include<stdio.h>
#include<string.h>
int main()
{
    char s[100];char s1[100]="Sunny";char s2[100]="Cloudy";char s3[100]="Rainy";
    gets(s);
    strcmp(s,s1);
    if(strcmp(s,s1)==0){
        printf("Cloudy");
    }
    else if(strcmp(s,s3)==0){
        printf("Sunny");
    }
    else if(strcmp(s,s2)==0){
        printf("Rainy");
    }
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string.h>
#include <queue>
#include <stack>
#include <set>
#include <time.h>
#define _USE_MATH_DEFINES
#define LL long long
#define front top
using namespace std;
const double PI = acos(-1.0);

int max_num(int ary[],int length) {
	int max = ary[0];
	for (int i = 1; i < length; i++)
		if (max < ary[i]) max = ary[i];
	return max;
}

int max_ord(int ary[], int length) {
	int max;
	max = max_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == max) return i;
	}
	return -1;
}

int min_num(int ary[], int length) {
	int min = ary[0];
	for (int i = 1; i < length; i++)
		if (min > ary[i]) min = ary[i];
	return min;
}

int min_ord(int ary[], int length) {
	int min;
	min = min_num(ary, length);
	for (int i = 0; i < length; i++) {
		if (ary[i] == min) return i;
	}
	return -1;
}

int main() {
	LL n, min;
	string s;
	cin >> n;
	min = n;
	for (LL i = 1; i <= (LL)sqrt(n); i++) {
		if (n%i == 0)
			if (max(i, n / i) < min)
				min = max(i, n / i);
	}
	s = to_string(min);
	cout << s.size() << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
string s;
int l;
int main()
{
    cin>>s;
    l=s.size();
    for( int i=0;i<l;i++)
    {
        if(s[i]=='C')
        {
            for( int j=i+1;j<l;j++)
            {
                if(s[j]=='F')
                {
                    cout<<"Yes";
                    return 0;
                }
            }
        }
    }
    cout<<"No";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i, n) for (int i=0; i < n; i++)
#define repd(i, n) for (int i = n-1; i > -1; i--)
#define repran(i, a,b) for (int i = a; i<b;i++)
#define all(x) (x).begin(), (x).end()
#define v(T) vector<T>
#define vv(T) vector<v(T)>
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
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 (a > b) {a = b; return true;}
    return false;
}

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll 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 { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
}c(100050);

int main()
{
    int n, k;
    cin >> n >> k;
    vll a(n);
    v(mint) s(n+1);
    s[0] = (mint)0;
    rep(i, n) cin >> a[i];
    sort(all(a));
    mint ans = 0;
    rep(i, n) {
        s[i+1] = s[i]+a[i];
    }
    for (int i = k;i <= n;i++){
        ans += (s[n]-s[n-i+1]-s[i-1])*c(i-2, k-2);
    }
    cout << ans << endl;
    
}



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

int ctoi(char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  
  string A[n];
  int ans = 0;
  
  rep(i,n){
    string k = to_string(i+1);
    A[i] = k;
    
    int sum = 0;
    
    rep(j, A[i].size()){
      sum += ctoi(A[i][j]);
    }
    
    if(sum>=a && sum<=b){
      ans += (i + 1);
    }
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 768
#define _DEBUG
#include "bits/stdc++.h"
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef _DEBUG
#define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
#else
#define debug(...)
#endif
#define rep(index,num) for(int index=0;index<(int)num;index++)
#define rep1(index,num) for(int index=1;index<=(int)num;index++)
#define brep(index,num) for(int index=(int)num-1;index>=0;index--)
#define brep1(index,num) for(int index=(int)num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=(ll)1e+18+1;
int INF=1e+9+1;
int main(){
	srand(time(NULL));
	std::chrono::system_clock::time_point start = std::chrono::system_clock::now();
	int nowtime=0;
	int TIMEMAX=1950;
	int D,c[27],s[366][27];
	scan(D);
	rep(i,26){
		scan(c[i]);
	}
	rep(i,D){
		rep(j,26){
			scan(s[i][j]);
		}
	}
	ll ptmax=0;
	int anst[366];
	while(nowtime<TIMEMAX){
		ll t[366];
		set<ll> tst[26];
		ll pt=0;
		rep(i,26){
			tst[i].insert(-1);
			tst[i].insert(D);
		}
		rep(i,D){
			t[i]=rand()%26;
			tst[t[i]].insert(i);
			pt+=s[i][t[i]];
		}
		rep(i,26){
			for(auto itr=tst[i].begin();itr!=tst[i].end();itr++){
				if(itr==tst[i].begin()) continue;
				auto itr2=itr; itr2--;
				pt-=((*itr)-(*itr2))*((*itr)-(*itr2)-1)*c[i]/2;
			}
		}
		if(pt>ptmax){
			rep(i,D) anst[i]=t[i];
		}
		nowtime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - start).count();
	}
	rep(i,D){
		prin(anst[i]+1);
	}
	return 0;
}


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

int main() {
 UL N; scanf("%u",&N);
 UL A[200000]; rep(i,N) scanf("%u",&A[i]);
 sort(A,A+N,greater<UL>());
 ULL ans=0;
 for(UL i=1; i<N; i++) ans+=A[i/2];
 printf("%llu\n",ans);
 return 0;
}



Measured memory_bytes: 4592
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin>>n;
  if(n==0){
    cout<<0<<endl;
    return 0;
  }
  ll two[40]={};
  int ans[40]={};
  for(int i=0;pow(2,i)<=1e10;i++){
    two[i]=pow(-2,i);
  }
  int c=0;
  for(int i=0;n!=0;i++){
    if(n%two[i+1]!=0){
      ans[i]=1;
      n-=two[i];
    }else{
      ans[i]=0;
    }
    c++;
    //cout<<n<<endl;
    //return 0;
  }
  for(int i=c-1;i>=0;i--){
    cout<<ans[i];
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scan = new Scanner(System.in);
		int k = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();

for(int i=a;i<=b;i++) {
 if(i%k == 0) {
	 System.out.println("OK");
	 return;
 }
}
	 System.out.println("NG");

	}
}


Measured memory_bytes: 27080
N = int(input())
A,B,C = [0],[0],[0]
for _ in range(N):
    a,b,c = map(int,input().split())
    A.append(a)
    B.append(b)
    C.append(c)

dp = [[0 for i in range(N+1)] for j in range(3)]
dp[0][1] = A[1]
dp[1][1] = B[1]
dp[2][1] = C[1]
for i in range(2,N+1):
    dp[0][i] = max(dp[1][i-1]+A[i],dp[2][i-1]+A[i])
    dp[1][i] = max(dp[0][i-1]+B[i],dp[2][i-1]+B[i])
    dp[2][i] = max(dp[0][i-1]+C[i],dp[1][i-1]+C[i])
print(max(dp[0][N],dp[1][N],dp[2][N]))

Measured memory_bytes: 26864
#include<stdio.h>

int main(void) {
        int m, n, i, j, c, sum;
        int a[100][100] = {};
        int b[100] = {};

        scanf("%d %d", &n, &m);
        for(j=0;j<n;j++) {
                for(i=0;i<m;i++) {
                        scanf("%d", &a[j][i]);
                }
        }

        for(i=0;i<m;i++) {
                scanf("%d", &b[i]);
        }

        for(j=0;j<n;j++) {
                sum = 0;
                for(i=0;i<m;i++) {
                        sum += a[j][i]*b[i];
                }
                printf("%d\n", sum);
        }
        return 0;
}

Measured memory_bytes: 648
string = gets.chomp
str = string.split('')
# p str
if str[0] == "A"
    if str[2..str.count - 2].count("C") == 1 && string.count('A-Z') == 2
        puts "AC"
    else
        puts "WA"
    end
else
    puts "WA"
end

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

#define INF ((1<<30)-1)
#define LLINF (1LL<<60)
#define EPS (1e-10)

int a[201010];
vector<int> g[201010];
int dp[201010];
int ans[201010];

void dfs(int v, int p=-1) {
    int pos = lower_bound(dp, dp+201010, a[v]) - dp;
    int prev = dp[pos];
    dp[pos] = a[v];
    ans[v] = pos;
    if (p != -1) ans[v] = max(ans[v], ans[p]);
    for (int u : g[v]) {
        if (u == p) continue;
        dfs(u, v);
    }
    dp[pos] = prev;
}

int main() {
    int N;
    cin >> N;
    rep(i, N) cin >> a[i];
    rep(i, N-1) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    fill(dp, dp+201010, INF);
    dp[0] = -INF;
    dfs(0);

    rep(i, N) cout << ans[i] << endl;
}


Measured memory_bytes: 31128
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    let k = 42;
    let n = k * (k - 1) + 1;
    let mut ans = vec![vec![]; n];
    for i in 0..k {
        ans[i].push(0);
        for j in 0..k - 1 {
            ans[i].push(i * (k - 1) + j + 1);
        }
    }
    for i in k..n {
        let a = (i - k) / (k - 1);
        let b = (i - k) % (k - 1);
        ans[i].push(a + 1);
        for j in 1..k {
            ans[i].push((b + (j - 1) * a) % (k - 1) + j * (k - 1) + 1);
        }
    }
    puts!("{} {}\n", n, k);
    for i in 0..n {
        for j in 0..k {
            puts!("{}{}", ans[i][j] + 1, if j + 1 == k { "\n" } else { " " });
        }
    }
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8828
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	private static final double DA = 9.8;
	private static final double DA2 = 4.9;


	public static void main(String[] args) {
		while(sc.hasNext()) {
			double v = sc.nextDouble();

			//?¨????
			double t = v / DA;
			double y = DA2 * t * t;

			int nFloor = 0;
			while(true) {
				double hight = 5 * (double)++nFloor - 5;

				if(hight > y) {
					break;
				}
			}

			System.out.println(nFloor);
		}
	}

}

Measured memory_bytes: 27640
n,k,s=map(int,input().split())
a=[]

if (s != 10**9):

    for i in range(k):
        a.append(s)
    for j in range(k,n):
        a.append(s+1)

else:

    for i in range(k):
        a.append(s)
    for j in range(k,n):
        a.append(1)

b=map(str,a)

print(" ".join(b))

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

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

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    P = []
    for i in range(N):
        P.append(I())
    s = sum(P)
    s -= max(P)
    s += max(P) // 2
    print(s)

main()



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

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

int n,a[200010],b[1000010],ans=0;

int main()
{
	cin>>n;
	rep(i,n)
	{
		scanf("%d",&a[i]);
		b[a[i]]++;
	}
	rep(i,n)
	{
		if(b[a[i]]>1) continue;
		bool ok=true;
		for(int j=1;j*j<=a[i];j++)
		{
			if(a[i]%j!=0) continue;
			//cout<<i<<' '<<j<<' '<<b[j]<<endl;
			if(j!=a[i]&&b[j]>0)
			{
				ok=false;
				break;
			}
			if(j!=1&&b[a[i]/j]>0)
			{
				ok=false;
				break;
			}
		}
		//cout<<i<<' '<<ok<<endl;
		if(ok) ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 8200
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}

int main() {
    int n;
    cin >> n;
    vector<int>a(n+1);
    rep(i,n) cin >> a[i+1];
    vector<int>b(n+1);
    int ans = 0;
    for(int i = n;i>=1;i--) {
        int sum = 0;
        for(int j = i+i;j<=n;j += i) {
            sum += b[j];
        }
        if(sum%2 != a[i]) {
            ans++;
            b[i]++;
        }    
    } 
    cout << ans << endl;
    rep(i,n+1) {
        if(b[i])cout << i <<" ";
    }
    cout << endl;
}

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

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

using namespace std;

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

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

const int N_MAX = 100000;
const int IMPOSSIBLE = N_MAX + 1;
int N;
vector<int> edges[N_MAX];

int f(int v, int parent, bool has_antennas)
{
    if (edges[v].size() == 1) {
        if (has_antennas) {
            return 1;
        } else {
            return 0;
        }
    } else if (edges[v].size() == 2) {
        for (int child: edges[v]) {
            if (child != parent) {
                return f(child, v, has_antennas);
            }
        }
    } else {
        if (!has_antennas) {
            return IMPOSSIBLE;
        }
        int s = 0;
        int m = IMPOSSIBLE;
        for (int child: edges[v]) {
            if (child == parent) {
                continue;
            }
            int x = f(child, v, true);
            s += x;
            amin(m, f(child, v, false) - x);
        }
        return min(s, s + m);
    }
}

int main(void)
{
    cin >> N;
    REP(i, N - 1) {
        int a, b;
        cin >> a >> b;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }
    int result = 1;
    REP(v, N) {
        if (edges[v].size() >= 3) {
            result = f(v, -1, true);
            break;
        }
    }
    cout << result << endl;
    return 0;
}

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

char str[(int)1e6 + 5];
int n, flag = 1;

int main() {
	scanf("%s", str + 1);
	n = strlen(str + 1);
	for(int i = 1; i <= n; ++i) {
		if(i & 1) {
			if(str[i] != 'h') flag = 0;
		}
		else {
			if(str[i] != 'i') flag = 0;
		}
	}
	if(flag && n % 2 == 0) puts("Yes");
	else puts("No");
	return 0;
}


Measured memory_bytes: 256
//https://atcoder.jp/contests/abc152/tasks/abc152_a
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}
int main() {
    ll N,M; cin>>N>>M;    
    cout<<(M>=N?"Yes":"No")<<endl;
    return 0;
}

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

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    ll l, r, d;
    cin >> l >> r >> d;
    int ans = 0;
    for (ll i = l; i <= r; i++) {
        if (i % d == 0)ans++;
    }
    cout << ans << endl;

}


Measured memory_bytes: 3588
#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;

ll t=1;


void solve()
{
    cin>>n;
    vector<ll>v(n);
    for(ll i=0;i<n;i++)cin>>v[i];
   // sort(v.begin(),v.end());
    k=v[0];
    for(ll i=0;i<n;i++)
    k=__gcd(k,v[i]);
    m=0;
    map<ll,ll>visited;
    for(ll j=0;j<n;j++){
        
        if(visited[v[j]]>=1 and v[j]!=1LL){m=1;break;}
        
        for(ll i=2;i*i<=v[j];i++)
        {
            if(v[j]%i==0 and (visited[i]>=1 or visited[v[j]/i]>=1)){m=1;break;}
            else if(v[j]%i==0)visited[i]++,visited[v[j]/i]++;
        }
        if(m==1)break;
        visited[v[j]]++;
    }
    
    if(m==1)
    {
        cout<<((k==1)?"setwise coprime":"not coprime");
    }
    else cout<<"pairwise coprime";
 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: 11088
#include<iostream>
using namespace std;
 
int Euclied(int x,int y){
   int a,b,c,r;
   if(x>=y){
     a = x;b = y;
   }else{
     a = y;b = x;
   }
   r = a % b;
   c = b; 
   while(r>0){
     c = r;
     r = a % b;
     a = b;
     b = r;
   }
   return c;
}
 
int main(){
   int x,y,gcd;
 
   cin >> x >> y;
   gcd = Euclied(x,y);
 
   cout << gcd << endl;
 
   return 0;
}

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

int main() {
  int N;
  int P=0,W=0,G=0,Y=0;
  cin >> N;
  for(int i = 0; i < N; i++){
    string color;
    cin >> color;
    if(color == "W"){
      W = 1;
    }
    if(color == "P"){
      P = 1;
    }
    if(color == "G"){
      G = 1;
    }
    if(color == "Y"){
      Y = 1;
    }
  }
  if(P+W+G+Y == 3){
    cout << "Three" << endl;
  }
  if(P+W+G+Y == 4){
    cout << "Four" << endl;
  } 
}


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

int main()
{
  int n, m;
  cin >> n >> m;
  if(m == 0){
    if(n == 1){
      cout << 0 << endl;
      system("pause");
      return 0;
    }
    rep(i, n){
      if(i == 0){
        cout << 1;
      }else{
        cout << 0;
      }
    }
    cout << endl;
    system("pause");
    return 0;
  }
  vector<pair<int, int> >v(m);
  rep(i, m){
    int s, c;
    cin >> s >> c;
    v[i] = make_pair(s, c);
  }
  sort(v.begin(), v.end());
  vector<int> ans(50, -1);
  if(n != 1 && v[0].first == 1 && v[0].second == 0){
    cout << "-1" << endl;
    system("pause");
    return 0;
  }
  for(int i = 0; i < m; i++){
    if((ans[v[i].first-1] != -1 && ans[v[i].first-1] != v[i].second)){
      if(n == 1 && v[i].first == 1 && v[i].second == 0)continue;
      cout << "-1" << endl;
      system("pause");
      return 0;
    }
    ans[v[i].first-1] = v[i].second;
  }
  for(int i = 0; i < n; i++){
    if(ans[i] == -1){
      ans[i] = 0;
    }
  }
  if(ans[0] == 0 && n != 1){
    ans[0] = 1;
  }
  rep(i, n){
    cout << ans[i];
  }
  cout << endl;
  system("pause");
  return 0;
}


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

  int N;
  scanf("%d",&N);
  int i,ans;
  int digit=N/100;

  if(N>(digit*100+10*digit+digit)){
    digit+=1;
    ans=(digit*100+10*digit+digit);
    if(digit==10){
      ans=1111;
    }
  }
  else{
    ans=(digit*100+10*digit+digit);
  }

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


Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main()
{
  int n,a = 0; 
  cin >> n >> a;
  
  if ((n < 500) && (n <= a))
  {
    cout << "Yes" << endl;
  }
  else if ((n >= 500) && ((n % 500) <= a))
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}

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

int main() {
    int a, b;
    cin >> a >> b;
    if((a * b) % 2 == 0 ){
        cout << "Even" << endl;
    }
    else if((a * b ) % 2 != 0 ){
        cout << "Odd" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
# define ll int64_t
#define rep(i,n) for(ll i=0;i<n;i++)
#define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007

using namespace std;

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

bool my_compare(pair<string,ll> a,pair<string,ll> b){
    
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

int main(){
    ll n,t;
    cin>>n>>t;
    vector<ll> a(n);
    rep(i,n) {
        cin>>a[i];
    }
    ll sum=t;
    rep(i,n-1){
        if(a[i+1]-a[i]>=t) sum+=t;
        else sum+=a[i+1]-a[i];
    }
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 1e5 + 10;
int N;
LL H[MAX];

int main(void) {
    cin >> N;
    REP(i, N) {
        cin >> H[i];
    }

    int ans = 0;
    int cur = 0;
    FOR(i, 1, N) {
        if (H[i - 1] >= H[i]) {
            cur++;
        } else {
            chmax(ans, cur);
            cur = 0;
        }
    }
    cout << max(ans, cur) << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <ctime>
using namespace std;

#define rep(i,a,n) for(int i=a; i<n; i++)
#define repr(i,a,n) for(int i=a; i>=n; i--)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 999999999

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long int ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int const MOD = 1000000007;

namespace std {
    bool operator<(const P a, const P b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int main() {
    string a,b,c;
    while(cin >> a >> b >> c) {
        rep(i,0,4 - a.length()) a = '0' + a;
        if(b.length() == 1) b = '0' + b;
        if(c.length() == 1) c = '0' + c;
        string s = a + b + c;
        if(s < "18680908") cout << "pre-meiji" << endl;
        else if("18680908" <= s && s <= "19120729") {
            printf("meiji %d %d %d\n",atoi(a.c_str()) - 1867, atoi(b.c_str()), atoi(c.c_str()));
        }
        else if("19120730" <= s && s <= "19261224") {
            printf("taisho %d %d %d\n",atoi(a.c_str()) - 1911, atoi(b.c_str()), atoi(c.c_str()));
        }
        else if("19261225" <= s && s <= "19890107") {
            printf("showa %d %d %d\n",atoi(a.c_str()) - 1925, atoi(b.c_str()), atoi(c.c_str()));
        }
        else {
            printf("heisei %d %d %d\n",atoi(a.c_str()) - 1988, atoi(b.c_str()), atoi(c.c_str()));
        }
    }
    return 0;
}

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

int main()
{
	string s;
	cin>>s;
	for(int i=0;i<4;i++)
		cout<<s[i];
	cout<<" ";
	for(int i=4;i<12;i++)
		cout<<s[i];
	cout<<endl;
	return 0;
}


Measured memory_bytes: 256