akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
using namespace std;
typedef long long ll;

int prime[1000009];

// 素因数分解
void prime_factorize(long long N) {
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        // 割れる限り割り続ける
        while (N % a == 0) {
            N /= a;
        }
        prime[a]++;
    }
    // 最後に残った数について
    if (N != 1) prime[N]++;
    return;
}

int main(){
  int N;
  cin >> N;
  REP(i,N) {
    ll a;
    cin >> a;
    prime_factorize(a);
  }
//  for (int i=2; i<20; i++ ) cout << i << " : " << prime[i] << endl;
  int ans = 0;
  for (int i=2; i<1000001; i++ ) {
    if (prime[i] == 0) continue;
    if (prime[i] == N) {
      ans = 2;
      break;
    }
    if (prime[i] > 1) ans = 1;
  }
  if (ans == 0) cout << "pairwise coprime" << endl;
  else if (ans == 2)  cout << "not coprime" << endl;
  else  cout << "setwise coprime" << endl;
}


Measured memory_bytes: 7480
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define pll pair<ll,ll>
ll INF = 1000000007;


//-----------------//
  #define amin main
//-----------------//


int amin()
{
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll t,i,j;
	
	ll n;
	cin>>n;
	ll arr[n];
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	sort(arr,arr+n);
	ll cnt= 0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			for(ll k=j+1;k<n;k++)
			{
				if(arr[i]!=arr[j] && arr[k]!=arr[j] && arr[i]!=arr[k])
				{
					if(arr[i]+arr[j]>arr[k])
						cnt++;
				}
			}
		}
	}
	cout<<cnt<<endl;

	
	


	
	return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
 
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 dp[35][5100];
lli score[35][5100];
int P[5100];
int C[5100];
 
void func(int N, int K){
 
    lli ans = -INF;
    REP(i,0,N){
        dp[0][i] = P[i];
        score[0][i] = C[P[i]];
        chmax(ans,score[0][i]);
    }
 
    REP(i,0,33){
        REP(j,0,N){
            dp[i+1][j] = dp[i][dp[i][j]];
            score[i+1][j] = score[i][dp[i][j]]+score[i][j];
        }
    }

    REP(j,0,N){
        lli now = j;
        lli sum = 0;
        REP(k,0,min(30000,K)){
            now = P[now];
            sum += C[now];
            chmax(ans,sum);
        }
    }
 
    REP(j,0,N){
        lli base = K-30000;
        if(base<=0)base = 1;
        
        lli sum = 0;
        int now = j;
        
        REP(k,0,33){
            if(base&(1LL<<k)){
            //now = dp[k][now];
                sum += score[k][now];
                now = dp[k][now];
                
                chmax(ans,sum);
            }
        }
        chmax(ans,sum);
        LOG(base);
        REP(k,base+1,K+1){
            LOG(k);
            
            chmax(ans,sum);
            now = P[now];
            sum += C[now];
            chmax(ans,sum);
        }
    }
    
    cout<<ans<<endl;
 
}
 
int main(){
    // cout << fixed << setprecision(5);
 
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    for(int i = 0 ; i < N ; i++){
        scanf("%d",&P[i]);
        P[i]--;
    }
    for(int i = 0 ; i < N ; i++){
        scanf("%d",&C[i]);
    }
    func(N, K);
    return 0;
}

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

using namespace std;
typedef long long int ll;

#define p(V) for(int iiv=0;iiv<V.size();iiv++) cout<<V[iiv]<<" ";
#define mp make_pair
#define pb push_back
#define graph vector<vector<int> >
#define pf first
#define ps second
#define pq priority_queue
const int N = 1e5;
const int l = 18;
const double pi = acos(-1);

int n, w , vn , r;
ll dp[101][N+1];
vector<pair<int,int> > v;
ll getW(){
    for(int i=0;i<=r;i++) 
        if((i+v[n-1].ps) >= vn)
            dp[n-1][i]=v[n-1].pf;
        else
            dp[n-1][i]=1e18;
    for(int i=n-2;i>=0;i--)
        for(int j=0;j<=r;j++){
            dp[i][j] = dp[i+1][j];
            if(v[i].ps+j <= r) dp[i][j]=min(dp[i][j],v[i].pf+dp[i+1][j+v[i].ps]);
            if(v[i].ps+j >= vn) dp[i][j]=min(dp[i][j],1ll*v[i].pf);
        }
    return dp[0][0];
}
int main(){   
    scanf("%d%d",&n,&w);
    v.resize(n);
    int l=0,mid , ans =0;
    for(int i=0;i<n;i++) scanf("%d%d",&v[i].pf,&v[i].ps) , r+=v[i].ps;
    while(l<=r){
        mid=(l+r)/2;
        vn=mid;
        if(getW() <= w) ans=mid,l=mid+1;
        else r=mid-1;
    }
    printf("%d",ans);
    return 0;
}



Measured memory_bytes: 78336
s = set(list(input()))
ans = 'Yes'
if 'N' in s and not 'S' in s or 'S' in s and not 'N' in s:
    ans = 'No'
elif 'W' in s and not 'E' in s or 'E' in s and not 'W' in s:
    ans = 'No'
print(ans)

Measured memory_bytes: 38384
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional> // std::function<void(int)>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int Dy[8] = {-1,-1,0,1,1,1,0,-1};
int Dx[8] = {0,1,1,1,0,-1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 111111;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int k,t;
    cin>>k>>t;
    vector<int> a(t);
    for(int i=0;i<t;i++)cin>>a[i];
    sort(All(a),greater<int>());
    int r=k-a[0];
    cout<<max(a[0]-r-1,0LL)<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int fib(int);
int main()
{
  int n;
  int *a;
  scanf("%d",&n);
  printf("%d\n",fib(n));

  return 0;
}


int fib(int n)
{
  int k=0;  
  if(n<4)return n;
  else
    {
      k=fib(n-1)+fib(n-2);
      return k;
    }

}





Measured memory_bytes: 2112
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define REPr(i,n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define VSCD(v,N) REP(i,N){int x; SCD(x); v.PB(x);}
#define VSCLLD(v,N) REP(i,N){long long x; SCLLD(x); v.PB(x);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x,S) (S.count(x) != 0)
using namespace std;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
////////////////////////////////////////////////////////////////////
int main(){
	int n; SCD(n);
	int N = n/2;
	static int count1[100002] = {};
	static int count2[100002] = {};
	static int acount1[100002] = {};
	static int acount2[100002] = {};
	vector<int> v1,v2;
	REP(i,N){
		int a,b; SCD2(a,b);
		v1.PB(a);
		v2.PB(b);
		count1[a]++;
		count2[b]++;
		acount1[a]++;
		acount2[b]++;
	}

	int M1,m1,M2,m2;
	sort(count1,count1+100002,greater<int>());
	sort(count2,count2+100002,greater<int>());
	M1 = count1[0]; m1 = count1[1];
	M2 = count2[0]; m2 = count2[1];

	int ans;
	if ((m1 == M1) or (m2 == M2)){
		ans = N - M1 + N - M2;
	}else{
		int xin,yin;
		REP(i,100002){
			if (M1 == acount1[i]) xin = i;
			if (M2 == acount2[i]) yin = i;
		}

		if (xin != yin) {
			ans = N - M1 + N - M2;
		}else{
			ans = min(N - m1 + N - M2, N - M1 + N - m2);
		}
	}

	PRINTD(ans);

}


Measured memory_bytes: 2428
# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N = int(input())
	A = getlist()
	S = sum(A)
	S %= con
	ans = 0
	for i in range(N):
		ans += A[i] * (S - A[i])
		ans %= con

	ans = ans * pow(2, con - 2, con)
	ans %= con
	print(ans)

if __name__ == '__main__':
	main()

Measured memory_bytes: 93380
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>
#include<tuple>
#include<stack>


using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> tpl;
int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };

#define ARRAY_MAX 305

const ll INF = 1e9 + 7;
const ll MOD = 10000;

int main() {

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

	vector<int> ans;
	int siz = a.size();

	while (siz > 0)
	{
		bool exist = false;
		for (int i = siz-1; i >= 0; i--)
		{
			if (a[i] == i + 1)
			{
				ans.push_back(a[i]);
				for (int j = i; j < a.size()-1; j++)
				{
					a[j] = a[j + 1];
				}
				exist = true;
				break;
			}
		}
		if (exist == false)
		{
			cout << "-1" << endl;
			return 0;
		}
		siz--;
	}
	
	reverse(ans.begin(), ans.end());
	for (int i = 0; i < ans.size(); i++)
	{
		cout << ans[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 256
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
from decimal import Decimal

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	A, B = list(input().split())
	A = int(A)
	B = Decimal(B)
	ans = (int(A * B // 1))
	print(ans)





if __name__ == '__main__':
	main()

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

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

typedef long long ll;

const int mod = 1e9 + 7;

using namespace std;



int main(void) {
	int H, W; cin >> H >> W;
	vector<string> S(H);
	rep(i, H) {
		cin >> S[i];
	}

	rep(i, H)rep(j, W) {
		if (S[i][j] == '#')continue;

		S[i][j] = '0';
		for (int k = i - 1; k <= i + 1; k++)for (int l = j - 1; l <= j + 1; l++) {
			if (k < 0 || H <= k || l < 0 || W <= l)continue;
			if (S[k][l] == '#')S[i][j]++;
		}
	}

	for (auto x : S) {
		cout << x << endl;
	}

	return 0;
}

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

int main(){
    int N;
    cin>>N;
    vector<int> A(N);
    map<int,int> cnt;
    for(int i=0; i<N; i++){
        cin>>A[i];
        cnt[A[i]]++;
    }

    int odd,even;
    odd = even = 0;

    for(auto a : cnt){
        if(a.second == 1) odd++;
        else if(a.second % 2 == 0) even++;
        else if(a.second % 2 != 0) odd++;
    }

    int ans = odd + even;
    if(even%2) ans--;

    cout<<ans<<endl;

}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

using ll = long long;
using ld = long double;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int res = 1;
vector<vector<pair<int, int> > > g;
vector<int> color;

void dfs(int c = -1, int v = 0, int p = -1) {
    int cur = 1;
    rep (i, g[v].size()) {
        if (g[v][i].first == p) continue;
        if (cur == c) cur++;
        color[g[v][i].second] = cur;
        dfs(cur, g[v][i].first, v);
        cur++;
    }
    res = max(res, cur - 1);
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
    int n;
    cin >> n;
    g = vector<vector<pair<int, int> > >(n);
    color = vector<int>(n);
    rep (i, n - 1) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        g[a].emplace_back(b, i);
        g[b].emplace_back(a, i);
    }
    dfs();
    cout << res << endl;
    rep (i, n - 1) cout << color[i] << endl;
    
    return 0;
}



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

const int mod = 998244353;
int a, b;
long long dp[3010][3010];
long long dfs(const int &x, const int &y);

int main() {
	int c, d;
	scanf("%d%d%d%d", &a, &b, &c, &d);
	printf("%lld\n", (dfs(c, d) + mod) % mod);
	return 0;
}

long long dfs(const int &x, const int &y) {
	if (x < a || y < b)
		return 0;
	else if (x == a && y == b)
		return 1;
	long long &ret = dp[x][y];
	if (ret)
		return ret;
	ret = (dfs(x - 1, y) * y + dfs(x, y - 1) * x - dfs(x - 1, y - 1) * (x - 1) * (y - 1)) % mod;
	return ret;
}



Measured memory_bytes: 74940
#include <iostream>

using namespace std;

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

    long long X,i=0,M=100;
    cin >> X;

    while(M<X){
        M*=1.01;
        i++;
    }
    cout << i << "\n";
    return 0;
}


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

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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<63;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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; }

int main(void){
    ll N,M; cin >> N >> M;
    
    ll ans = 0;
    for(ll i=1; i*i<=M; i++){
        if(M%i == 0){
            if(M/i >= N) chmax(ans, i);
            if(M/(M/i) >= N) chmax(ans, M/i);
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
  int X;
  cin >> X;
  int pos=0;
  int res=0;
  int time=0;
  int N=1000000000;
  for(int i=0;i<N;++i){
    if(i*(i+1)/2>=X){
      time =i;
      break;
    }
  }
  cout << time;
}

Measured memory_bytes: 256
object Main extends App {
	val pw = new java.io.PrintWriter(System.out)

	@scala.annotation.tailrec
	def loop(start: Int, end: Int)(f: Int => Unit): Unit =
		if (start < end) {
			f(start)
			loop(start + 1, end)(f)
		}

	val h, w, k = Scanner.nextInt
	val c = Array.fill(h)(Scanner.next.toArray.map(_ == '#'))

	val cnt = c.map(_.count(cij => cij)).sum

	def f(hs: Seq[Int], ws: Seq[Int]): Int =
		hs.map(i => c(i).count(cij => cij)).sum + ws.map(j => c.count(ci => ci(j))).sum -
		hs.map { i =>
			ws.map { j =>
				if (c(i)(j)) 1 else 0
			}.sum
		}.sum

	var ans = 0
	loop(0, h+1) { i =>
		loop(0, w+1) { j =>
			for {
				hs <- (0 until h).combinations(i)
				ws <- (0 until w).combinations(j)
				if (cnt - f(hs, ws) == k)
			} {
				ans += 1
			}
		}
	}

	pw.println(ans)
	pw.flush()
}

object Scanner {
	private val buf = new Array[Byte](1024); private var ptr = 0; private var len = 0

	@inline private def isPrintableChar(c: Int): Boolean = 33 <= c && c <= 126
	@inline private def hasNextByte(): Boolean = if (ptr >= len) { ptr = 0; len = System.in.read(buf); len > 0 } else true
	@inline private def hasNext(): Boolean = {
		while (hasNextByte() && !isPrintableChar(buf(ptr))) ptr += 1
		hasNextByte()
	}
	@inline private def readByte(): Byte = if (hasNextByte()) { val res = buf(ptr); ptr += 1; res } else -1

	def next(): String = {
		if(!hasNext()) ???
		val sb = new StringBuilder; var b = readByte()
		while (isPrintableChar(b)) { sb.append(b.toChar); b = readByte() }
		sb.toString
	}

	def nextInt(): Int = {
		val n = nextLong()
		if (n < Int.MinValue || Int.MaxValue < n) ???
		n.toInt
	}

	def nextLong(): Long = {
		if(!hasNext()) ???
		var minus = false; var b = readByte()
		if (b == '-') { minus = true; b = readByte() }

		@scala.annotation.tailrec
		def go (b: Byte, n: Long = 0): Long = if ('0' <= b && b <= '9') go(readByte(), n * 10 + b - '0') else if (minus) -n else n

		go(b)
	}

	def nextDouble(): Double = next().toDouble
}


Measured memory_bytes: 57804
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class Main
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in)); 
         char[] arr = infile.readLine().toCharArray();
         int N = arr.length;
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int X = Integer.parseInt(st.nextToken());
         int Y = Integer.parseInt(st.nextToken());
         ArrayList<Integer> ls = new ArrayList<Integer>();
         char curr = arr[0];
         int size = 1;
         for(int i=1; i < N; i++)
         {
            if(curr == arr[i])
               size++;
            else
            {
               ls.add(size);
               size = 1;
               curr = arr[i];
            }
         }
         ls.add(size);
         if(arr[0] == 'F')
         {
            X -= ls.get(0);
            ls.remove(0);
         }
         if(ls.size() == 0)
         {
            if(X != 0 || Y != 0)
               System.out.println("No");
            else
               System.out.println("Yes");
            return;
         }
         int par = 0;
         ArrayList<Integer> hort = new ArrayList<Integer>();
         ArrayList<Integer> vert = new ArrayList<Integer>();
         for(int i=0; i < ls.size(); i++)
         {
            if(i%2 == 0)
            {
               par += ls.get(i);
               par = (par&1);
            }
            else
            {
               if(par == 0)
                  hort.add(ls.get(i));
               else
                  vert.add(ls.get(i));
            }
         }
         //solve
         if(!found(X, hort) || !found(Y, vert))
            System.out.println("No");
         else
            System.out.println("Yes");
      }
      public static boolean found(int target, ArrayList<Integer> ls)
      {
         HashSet<Integer> set = new HashSet<Integer>();
         set.add(0);
         for(int x: ls)
         {
            HashSet<Integer> temp = new HashSet<Integer>();
            for(int v: set)
            {
               temp.add(v+x);
               temp.add(v-x);
            }
            set = temp;
         }
         return set.contains(target);
      }
   }

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

int numWays[1000005];
void testTriple(int x, int y, int z)
{
	int sum = (x * x) + (y * y) + (z * z) + (x * y) + (y * z) + (z * x);
	numWays[sum]++;
}

int main()
{
	for(int i = 1; i <= 100; i++)
	{
		for(int j = 1; j <= 100; j++)
		{
			for(int k = 1; k <= 100; k++)
				testTriple(i, j, k);
		}
	}
	
	int N;
	scanf("%d", &N);
	
	for(int i = 1; i <= N; i++)
		printf("%d\n", numWays[i]);
}


Measured memory_bytes: 4016
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const array<pair<int,int>,4> fd{make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

int main(){
  int a,b;cin>>a>>b;
  int ans = 0;
  repd(i,a,b+1){
    string s = to_string(i);
    if(s[0] == s[4] && s[1] == s[3])ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
bool sortbysec(const pair<int,int> &a,
               const pair<int,int> &b)
{
    return (a.second < b.second);
}
int main()
{
    ll t=1,i,j,k=0,n,z,a,b,c,d,x,y,m,p,q,r;
    //cin>>t;
    while(t--)
    {
       string s;
       cin>>s;
       ll sum=0;
       for(i=0;i<s.length();i++)
       {
           sum+=(s[i]-'0');
       }
       if(sum%9==0)
        cout<<"Yes"<<endl;
       else
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 300 + 5;
const ll INF = 1LL << 60;
ll adj[maxn][maxn], adj2[maxn][maxn];
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, m; ll l;
    cin >> n >> m >> l;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            if (i != j)
                adj[i][j] = INF;
    int a, b; ll c;
    while (m--) {
        cin >> a >> b >> c;
        adj[a][b] = adj[b][a] = c;
    }
    for (int k = 1; k <= n; ++k)
        for (int i = 1; i <= n; ++i)
            for (int j = 1; j <= n; ++j)
                if (adj[i][k] != INF && adj[k][j] != INF)
                    adj[i][j] = min(adj[i][j], adj[i][k] + adj[k][j]);
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            adj2[i][j] = i == j? 0: adj[i][j] > l? INF: 1;
    for (int k = 1; k <= n; ++k)
        for (int i = 1; i <= n; ++i)
            for (int j = 1; j <= n; ++j)
                if (adj2[i][k] != INF && adj2[k][j] != INF)
                    adj2[i][j] = min(adj2[i][j], adj2[i][k] + adj2[k][j]);
    int q;
    cin >> q;
    while (q--) {
        cin >> a >> b;
        cout << (adj2[a][b] == INF? -1: adj2[a][b] - 1) << '\n';
    }
    return 0;
}

Measured memory_bytes: 2048
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>

typedef long long int ll;


using namespace std;

int q;
double x;

double f(){
	return x*x*x-q;
}
double df(){
	return 3*x*x;
}

double calc(){
	x=q/2.0;
	while(1){
		if((fabs(f())>-0.00001*q&&fabs(f())<0.00001*q)){
			break;
		}
		x=(x*df()-f())/df();
	}
	return x;
}

int main(){
	while(1){
		cin>>q;
		if(q==-1)break;
		printf("%.15lf\n", calc());
	}
}

Measured memory_bytes: 1192
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextWord() string {
	sc.Scan()
	str := sc.Text()
	return str
}

func nextInt() int {
	i, e := strconv.Atoi(nextWord())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	n, q := nextInt(), nextInt()
	result := make([]int, n)
	adj := make([][]int, n+1)
	var e, p [][]int
	for i := 0; i < n-1; i++ {
		e = append(e, []int{nextInt(), nextInt()})
	}
	for i := 0; i < q; i++ {
		p = append(p, []int{nextInt(), nextInt()})
	}
	//	fmt.Println(e)
	//	fmt.Println(p)
	//fmt.Println(adj)
	//	fmt.Println(result)
	ans := solve(e, p, adj, result)
	//	fmt.Println(adj)
	for _, s := range ans {
		fmt.Print(s, " ")
	}
}

func solve(n, q [][]int, adj [][]int, result []int) []int {

	for _, e := range n {
		adj[e[0]] = append(adj[e[0]], e[1])
		adj[e[1]] = append(adj[e[1]], e[0])
	}

	for _, d := range q {
		result[d[0]-1] += d[1]
	}

	dfs(1, 0, adj, result)
	return result
}

func dfs(root, parent int, adj [][]int, result []int) {
	for _, node := range adj[root] {
		if node == parent {
			continue
		}
		result[node-1] += result[root-1]
		dfs(node, root, adj, result)
	}
}


Measured memory_bytes: 100224
import math
from functools import reduce
from collections import deque

def s(generator, splitter, mapper):
    return [ mapper(s) for s in generator().split(splitter) ]

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行区切りの入力をn行読み込んで数値リストにして返します。
def get_nums_n(n):
    return [ int(input()) for _ in range(n)]

n,m = get_nums_l()

l_max = 0
r_min = n
for i in range(m):
    l,r = get_nums_l()
    if l_max < l:
        l_max = l
    if r_min > r:
        r_min = r

print(max(r_min - l_max + 1, 0))

Measured memory_bytes: 46184
Nc = input()
N = int(Nc)
c = map(int,input().split())
cor = ''
l = list(c)
l2 = []
maxL = 0
gambiarra = 0
m = 0

for num in l:
    if 1 <= N <= 100 and 1 <= num <= 4800 and type(num) == int and len(l) == N:
        if  1 <= num <= 399:
            cor = 'cinzento'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m + 1
        elif 400 <= num <= 799:
            cor = 'a'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m + 1
        elif 800 <= num <= 1199:
            cor = 'b'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m + 1
        elif 1200 <= num <= 1599:
            cor = 'c'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m + 1
        elif 1600 <= num <= 1999:
            cor = 'd'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m +1
        elif 2000 <= num <= 2399:
            cor = 'e'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m + 1
        elif 2400 <= num <= 2799:
            cor = 'f'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
                m = m + 1
        elif 2800 <= num <= 3199:
            cor = 'g'
            if cor not in l2:
                l2.append(cor)
                maxL = maxL + 1
        elif 3199 <= num <= 4800:
            maxL = maxL + 1
            cor = 'escolha'
            if cor not in l2:
                l2.append(cor)
                m = m + 1
            
           
print(m, maxL) 

Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <cstdio>
#include <cassert>
using namespace std;

const int N = 55555;
bool flag[N];

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

	vector<int> primes;
	for (int p = 2; p < N; p++) {
		if (flag[p]) continue;
		if (p % 5 == 1) primes.push_back(p);
		for (int q = p+p; q < N; q += p) flag[q] = true;
	}
	//~ cout << primes.size() << endl;
	
	int n; 
	cin >> n;
	for (int i = 0; i < n; i++) cout << primes[i] << ' ';
	cout << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;


int n;
int a[101][101];
int table[101][101];

int main(){
	cin >> n;
	REP(i, n){
		REP(j, n){
			cin >> a[i][j];
			if (i == 0)table[i][j] = a[i][j];
			else{
				table[i][j] = a[i][j] + table[i - 1][j];
			}
		}
	}
	REP(i, n){
		for (int j = 1; j < n; j++){
			table[i][j] += table[i][j - 1];
		}
	}
	//REP(i, n){
	//	REP(j, n){
	//		cout << table[i][j] << " ";
	//	}
	//	cout << endl;
	//}
	int ans = -10000000;
	REP(i, n){
		REP(j, n){
			REP(k, i + 1){
				REP(l, j + 1){
					int num = table[i][j];
					if (k != 0)num -= table[k - 1][j];
					if (l != 0)num -= table[i][l - 1];
					if (k != 0 && l != 0)num += table[k - 1][l - 1];
					ans = max(ans, num);
				}
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 1240
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll L_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;
// const double PI = M_PI;

ll N;
// vector<int> A;

vector<pair<ll, ll>> prime_factor(ll n) {
  vector<pair<ll, ll>> v;

  for (ll p = 2; p * p <= n; ++p) {
    if (n % p != 0) {
      continue;
    }
    ll num = 0;
    while (n % p == 0) {
      ++num;
      n /= p;
    }
    v.push_back(make_pair(p, num));
  }

  if (n != 1) {
    v.push_back(make_pair(n, 1));
  }

  return v;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  // A.resize(N);
  // for (int i = 0; i < N; i++) {
  //   int tmp;
  //   cin >> tmp;
  //   A[i] = tmp;
  // }

  ll cnt = 0;
  auto v = prime_factor(N);
  for (ll i = 0; i < v.size(); i++) {
    ll sum = 0;
    ll j = 1;
    while (sum < v[i].second) {
      cnt++;
      sum += j;
      j++;
    }
    if (sum != v[i].second) {
      cnt--;
    }
  }

  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 3188
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
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;

int main(){
    int N;
    cin >> N;
    ll s[N];
    rep(i, N){
        cin >> s[i];
    }

    ll ans = 0;
    REP(i,1, N){
        ll res = 0;
        ll c = i;
        ll tmp1 = 0;
        ll tmp2 = N-1;
        ll res1 = 0;
        if ((N - 1) % c == 0) {
//            cout << tmp1 << " 1 " << tmp2 << endl;
            while(tmp1 < tmp2 ) {

                res1 += s[tmp1] + s[tmp2];
                chmax(res, res1);
                tmp1 += c;
                tmp2 -= c;
            }
            chmax(ans, res);
        } else {
//            cout << tmp1 << " 2 " << tmp2 << endl;
            while(tmp1 < N - 1 && tmp2 > c) {

                res1 += s[tmp1] + s[tmp2];
                chmax(res, res1);
                tmp1 += c;
                tmp2 -= c;
            }
            chmax(ans, res);
        }

//        cout << ans << endl;
    }

    cout << ans << endl;
}

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

// @@ !! LIM()

int main(/* int argc, char *argv[] */) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll N, M, X; cin >> N >> M >> X;
  vector<ll> C(N);
  vector A(N, vector(M, 0LL));
  for (ll i = 0; i < N; i++) {
    cin >> C[i];
    for (ll j = 0; j < M; j++) cin >> A[i][j];
  }
  ll ans = LLONG_MAX;
  for (ll x = 0; x < (1LL << N); x++) {
    ll cost = 0;
    vector skill(M, 0LL);
    for (ll i = 0; i < N; i++) {
      if ((x >> i) & 1) {
	cost += C[i];
	for (ll j = 0; j < M; j++) {
	  skill[j] += A[i][j];
	}
      }
    }
    bool fail = false;
    for (ll j = 0; j < M; j++) {
      if (skill[j] < X) {
	fail = true;
	break;
      }
    }
    if (!fail) {
      ans = min(ans, cost);
    }
  }
  if (ans == LLONG_MAX) {
    cout << -1 << endl;
  }else {
    cout << ans << endl;
  }

  return 0;
}



Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n; cin >> n;
	string s; cin >> s;
	auto bad = [&](){
		cout << "No" << endl;
		exit(0);
	};
	if(n&1) bad();
	else {
		string t = s.substr(0, n / 2);
		if(t + t == s) cout << "Yes" << endl;
		else bad();
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
// ミント
const int mod = 1e9+7 ;
//998244353;

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, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
//昆布
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];
  }
}   ;
 
mint dp[15][100005] ;
mint sum[100005] ;
int main(){
 string s ;cin>> s ;
  ll k=s.size() ;
  rep(i,k) if(s[i]!='?') s[i]= s[i]-'0' ;
  rep(i,k){
    rep(j,13) dp[j][i]= 0;
  } 
  rep(i,k){
    rep(j,13){
      
      if(i==0){
        if(s[0]=='?') {
          if(j<=9)
          dp[j][i]=1 ;
          else dp[j][i]=0 ;
        sum[i]=10 ;
        }
        else {
          if(s[0]==j) dp[j][i]=1 ;
          else dp[j][i]= 0 ;
          sum[i]=1 ;
        }
      }
     

    else{
      
      if(s[i]=='?'){
        rep(z,10){
        dp[((j*10)+z)%13][i]+=dp[j][i-1] ;
        }
      }
    
     
      else{
        dp[((j*10)+s[i])%13][i]+=dp[j][i-1] ;
        sum[i]+=dp[j][i] ;
      }
    }

    }
    
  }
    cout<<dp[5][k-1] <<endl ;
    return 0;
  }

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

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll> 
#define vpll vector<pll>
#define all(X) X.begin(),X.end()
#define endl "\n"

int main()
{
    ll n;
    cin>>n;
    ll dp[100010],h[100010];
    for(ll i=0;i<n;i++)
        cin>>h[i];
    dp[0] = 0;
    dp[1] = abs(h[1]-h[0]);
    for(ll i=2;i<n;i++)
    {
        dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
    }
    cout<<dp[n-1]<<"\n";

}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
using lli = long long;
#define rep(i,n) for(int i=0;i<n;i++)
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; }

lli n;

int main(void){
    cin >> n;
    vector<lli> a(n);
    rep(i, n) cin >> a[i];
    lli ans = 0;
    rep(i, n){
        if(a[i] == 0) continue;
        //a(i-1), a(i)
        if(i > 1){
            if(a[i-1] > 0){
                lli p = min(a[i-1], a[i]);
                a[i-1]-=p;
                a[i]-=p;
                ans+=p;
            }
        }
        //a(i), a(i)
        ans+=a[i]/2;
        a[i]%=2;

        //a(i), a(i+1)
        if(i < n-1){
            if(a[i+1] > 0){
                lli p = min(a[i+1], a[i]);
                a[i+1]-=p;
                a[i]-=p;
                ans+=p;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3964
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdio.h>

using namespace std;

void solve() {
    int d; cin >> d;
    string res;
    if(d == 25) res = "Christmas";
    else if(d == 24) res = "Christmas Eve";
    else if(d == 23) res = "Christmas Eve Eve";
    else res = "Christmas Eve Eve Eve";
    cout << res << endl;
}

int main() {
    solve();
    return 0;
}

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

 int  main() {
	 std::string s;
	 while (std::cin >> s) {

		 if (s.find("AC") == -1) {
			 std::cout << "No" << std::endl;
		 }
		 else {
			 std::cout << "Yes" << std::endl;
		 }
	 }
}

Measured memory_bytes: 256
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint


def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def main():
    x,y=map(int,input().split())
    n=list(map(int,input().split()))
    n=sorted(n)
    iti=x
    minn=10000

    for i in range(iti, 102):
        if i not in n:
            if abs(x - i) < abs(minn - x):
                minn = i
                break
    for i in range(iti,-1,-1):
        if i not in n:
            if abs(x-i)<=abs(minn-x):
                minn=i
                break
    print(minn)







if __name__ == "__main__":

    main()

Measured memory_bytes: 72676
X = int(input())

if (X >= 1800):
    print(1)
elif (X >= 1600):
    print(2)
elif (X >= 1400):
    print(3)
elif (X >= 1200):
    print(4)
elif (X >= 1000):
    print(5)
elif (X >= 800):
    print(6)
elif (X >= 600):
    print(7)
else:
    print(8)


Measured memory_bytes: 9172
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>

using namespace std;
const double PI (acos(-1));


int main()
{
 int A;
 cin >> A;
 if(A == 0)
 {
    cout << 1;    
 }else{
     cout << 0;
 }
}


Measured memory_bytes: 3620
a,b,c,d,e,f=map(int,open(0).read().split())
a,b,c=sorted((s*s+t*t)**.5for s,t in((a-c,b-d),(c-e,d-f),(e-a,f-b)))
d=a+b+c
s=d/2
s=(s*(s-a)*(s-b)*(s-c))**.5
r=2*s/d
l,h=0,1e5
while h-l>1e-9:
  m=(h+l)/2
  if c*(r-m)/r<2*m:h=m
  else:l=m
print(l)

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

using namespace std;


const int maxn = 2005;
int a[maxn], b[maxn];
map<int, int> mp;
bool cmp(int x,int y)
{
    return x < y;
}

struct cmp1{
    bool operator ()(int &a,int &b){
        return a>b;//最小值优先
    }
};
priority_queue<int, vector<int>, cmp1 > q1, q2;
int main()
{
    int n, k, q;
    scanf("%d%d%d", &n, &k, &q);
    for(int i = 0; i < n; i++)
    {
        scanf("%d", a + i);
        b[i] = a[i];
    }
    sort(b, b + n, cmp);
    int ans = 1e9+7;
    for(int i=0;i<n;i++)
    {
        if(i&&b[i]==b[i-1]) continue;
        while(!q1.empty())
            q1.pop();
        while(!q2.empty())
            q2.pop();
        int num = q-1;
        for(int j=0;j<n;j++)
        {
            if(a[j]>=b[i]){
                q2.push(a[j]);
            }
            else{
                while(q2.size()>=k){
                    q1.push(q2.top());
                    q2.pop();
                }
                while(!q2.empty()) q2.pop();
            }
        }
        while(q2.size()>=k){
            q1.push(q2.top());
            q2.pop();
        }
        while(num&&(!q1.empty())){
            q1.pop();num--;
        }
        if(q1.empty()) break;
        ans = min(ans, q1.top() - b[i]);
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
(defun shift-only (n)
	(setq ans 0 even-flg NIL)
  	(setq a (make-array n))
  	(dotimes (i n)
		(setf (aref a i) (read))
    )

	(loop
		(dotimes (i n)
			(if (zerop(rem (aref a i) 2))
				(setf (aref a i) (/ (aref a i) 2))
				(setf even-flg t)
			)
		)
		(if (equal even-flg t)
			(return)
			(incf ans)
		)
	)
	ans
)
 
(format t "~D~%" (shift-only (read)))

Measured memory_bytes: 6504
#include<bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
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; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
const ll mod = 1000000007;
// const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"
#define TO_STRING(VariableName) # VariableName

template <typename T>ostream &operator<<(ostream &out,const vector<T> &v) {rep(i,(int)v.size()-1)cout<<v[i]<<" ";cout<<v[(int)v.size()-1];return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const map<T1, T2> &p) {out << "(" << p.first << ", " << p.second << ")";return out;}
template <typename T1, typename T2>ostream &operator<<(ostream &out, const pair<T1, T2> &p){out << "(" << p.first << ", " << p.second << ")";return out;}
template<class T>void debag(const T &obj){cout<<obj<<endl;}

bool solve(){
  ll k,a,b;cin>>k>>a>>b;
  for(ll i=a;i<=b;i++)if(i%k==0){
    cout<<"OK"<<endl;
    return false;
  }
  cout<<"NG"<<endl;
    return false;
  return false;
}

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(30);
  solve();
}


Measured memory_bytes: 3636
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>	
#include <stdio.h>    
 
using namespace std;
     
#define F first
#define S second
#define lb lower_bound          	    
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair
#define bpp __builtin_popcount                                                                                        
#define sqr(x) ((x) * (x))
#define al 0x3F3F3F3F
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
//#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;                                  
const int N = (int)2e5 + 123;
const ll inf = (ll)3e18 + 1;
                                       
const double pi = acos(-1.0);
const double eps = 1e-7;
const int dx[] = {0, 0, 1, 0, -1};										
const int dy[] = {0, 1, 0, -1, 0};  		
 
ll n, a[N], sum;

inline void boost () {
	ios_base :: sync_with_stdio (NULL);
	cin.tie (NULL), cout.tie (NULL);          
}

inline void Solve () {
	cin >> n;
	for (int i = 1; i <= n; i ++) cin >> a[i], sum += a[i];
	if (sum % (n * (n + 1) / 2) != 0) cout << "NO", exit (0);
	sum /= (n * (n + 1) / 2);
	for (int i = 2; i <= n; i ++) {
		if (a[i] - a[i - 1] > sum || (a[i] - a[i - 1] - sum) % n != 0) cout << "NO", exit (0);
	}
	cout << "YES";
}                                          
                  
int main () {                                       
//	freopen (".in", "r", stdin);    
//	freopen (".out", "w", stdout); 	          
	boost ();
	int tt = 1;
//	cin >> tt;   
	while (tt --) {
		Solve ();
	}                                               
	return 0;      
}         	                                                    

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<"!"<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
const int MAX_N = 2010;
ll row,col;
ll rui[MAX_N][MAX_N];
ll ele[MAX_N][MAX_N];
void make_sum(ll r,ll c){
  row=r;col=c;
  for(int i=1;i<=row+1;i++)
    for(int j=1;j<=col+1;j++)
      rui[i][j] = ele[i][j] + rui[i-1][j] + rui[i][j-1] - rui[i-1][j-1];
}

ll ret_sum(int lx,int ly,int rx,int ry){//閉区間
  if(lx>rx||ly>ry)return 0;
  else return rui[rx][ry] - rui[lx-1][ry] - rui[rx][ly-1] + rui[lx-1][ly-1]; 
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,k;cin>>n>>k;

  for(int i=0;i<n;i++){
    ll a,b;char c;
    cin>>a>>b>>c;
    if(c=='W')a+=k;
    
    a%=(2*k);
    b%=(2*k);
    ele[a+1][b+1]++;
  }
  make_sum(2*k,2*k);
  ll ans=0;
  for(int i=1;i<=k;i++){
    for(int j=1;j<=k;j++){
      ll sum=ret_sum(0,0,i-1,j-1)
	+ret_sum(i,j,i+k-1,j+k-1)
	+ret_sum(i+k,j+k,2*k,2*k)
	+ret_sum(i+k,0,2*k,j-1)
	+ret_sum(0,j+k,i-1,2*k);
      ans=max(ans,max(n-sum,sum));
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

typedef long long ll;
typedef vector<int> vi;

const double PI=acos(-1.0);
const int MOD=2019;

string S; int N; int dp[2019];
void input()
{
    cin>>S;
    for(int i=0;i<2019;++i) dp[i]=0;
    dp[0]++;    
}

void solve()
{
    N=S.length();
    int num[N];
    int POW=1;
    num[0]=S[N-1]-'0'; dp[num[0]]++;
    for(int i=1;i<N;++i){
        POW=(POW*10)%MOD;
        num[i]=(num[i-1]+POW*(S[N-1-i]-'0'))%MOD;
        dp[num[i]]++;
    }
    int ans=0;
    for(int i=0;i<2019;++i){
        ans+=dp[i]*(dp[i]-1)/2;
    }
    cout<<ans<<endl;
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 4508
#include<iostream>
#include<string>
#include<fstream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>

using namespace std;

int main(void)
{
	int n, ans;
	cin >> n;
	if (n % 2 == 0)
	{
		cout << n<<endl;
	}
	else
	{
		cout << n * 2 << endl;
	}
	return 0;
}

Measured memory_bytes: 256