akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>

void main(void)
{
  long int a,b,c,k;
  long int result=0;
  scanf("%ld %ld %ld %ld",&a,&b,&c,&k);
  if(a>=k){
    result=k;
  }else if(a+b>=k){
    result=a;
  }
  else{
    result=a-(k-a-b);
  }
  printf("%ld\n",result);
}


Measured memory_bytes: 1732
# -*- coding:utf-8 -*-
n = int(raw_input())
a = [[int(k),i+1] for i,k in enumerate(raw_input().split())]
a.sort(reverse=True)
z = [l[1] for l in a]
s=[0]*n
a.append([0,0])
min_a_i = float('inf')
for i,p in enumerate(a[:-1]):
    min_a_i = min(min_a_i, a[i][1])
    if not p[0] == a[i+1][0]:
        q = p[0] - a[i+1][0]
        s[min_a_i-1] += (i+1)*q

for t in s:
    print(t)

Measured memory_bytes: 24112
/*
 * b.cc: 
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 100;
const int INF = 1 << 30;

/* typedef */

typedef pair<int,int> pii;
typedef vector<pii> vpii;

/* global variables */

vpii nbrs[MAX_N];
int dists[MAX_N];

/* subroutines */

/* main */

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

  for (int i = 0; i < n; i++) {
    int u, k;
    cin >> u >> k;
    for (int j = 0; j < k; j++) {
      int v, c;
      cin >> v >> c;
      nbrs[u].push_back(pii(v, c));
    }
  }

  for (int i = 0; i < n; i++) dists[i] = INF;
  dists[0] = 0;

  priority_queue<pii> q;
  q.push(pii(0, 0));

  while (! q.empty()) {
    pii u = q.top(); q.pop();
    int ud = -u.first, &ui = u.second;
    if (dists[ui] != ud) continue;

    vpii& nbru = nbrs[ui];
    for (vpii::iterator vit = nbru.begin(); vit != nbru.end(); vit++) {
      int &vi = vit->first, vd = ud + vit->second;
      if (dists[vi] > vd) {
	dists[vi] = vd;
	q.push(pii(-vd, vi));
      }
    }
  }

  for (int i = 0; i < n; i++) printf("%d %d\n", i, dists[i]);

  return 0;
}

Measured memory_bytes: 1240
#include<iostream>
#include<cstring>

using namespace std;

int main()
{
	long long x;
	cin>>x;
	long long a = 100.0;
	long long cnt = 1;
	while(1)
	{
		a *= (1.0 + 0.01);
		if(a >= x)
		{
			cout<<cnt;
			return 0;
		}
		cnt++;
	}
	return 0;
}

Measured memory_bytes: 3192
#include <stdio.h>
#include <string.h>
int main( void ){
	char a[84], b[84], t[84];
	int n, la, lb, x, c, i;
	for(scanf("%d ",&n);n--;){
		memset( a, 0, 84 );
		memset( b, 0, 84 );
		la=strlen(fgets(t,84,stdin))-1;
		memcpy(a+81-la,t,la);
		lb=strlen(fgets(t,84,stdin))-1;
		memcpy(b+81-lb,t,lb);
		t[81] = t[0] = c = 0;
		t[80] = '0';
		for( i = 81; i--; ){
			if(!a[i]&&!b[i]&&!c)break;
			x = (a[i]&15) + (b[i]&15) + c;
			c = x > 9;
			t[i] = x % 10 + '0';
		}
		puts(*t?"overflow":t+i+1);
	}
	return 0;
}

Measured memory_bytes: 0
N = int(input())
H = list(map(int, input().split()))

H[0] -= 1
for i in range(N - 1):
	if H[i] < H[i + 1]:
		H[i + 1] -= 1
	elif H[i] > H[i + 1]:
		print('No')
		exit()
print('Yes')

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

int main(){
  int N;
  cin>>N;
  vector<vector<int>> data(N, vector<int>(2));
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> data.at(i).at(j);
    }
  }
  string ans="No";
  for (int i = 0; i < N-2; i++) {
    if(data.at(i).at(0)==data.at(i).at(1)&&data.at(i+1).at(0)==data.at(i+1).at(1)&&data.at(i+2).at(0)==data.at(i+2).at(1)){
      ans = "Yes";
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3608
#include <stdio.h>
int main(void){
    int a, b, d, r;
    double f;
    scanf("%d %d",&a,&b);
    d = a/b;
    r = a%b;
    f = (double)a/b;
    printf("%d %d %f\n",d, r, f);
    return 0;
}



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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a, b; cin >> a >> b;
  int ans = -1;
  for (int i = 1; i < 2000; i++) {
    if (i * 8 / 100 == a && i / 10 == b) {
      ans = i;
      break;
    }
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String S = sc.next();
		sc.close();
		int cnt = 0;
		String ans = S;
		for(int i = 0; i < N; i++) {
			if(S.charAt(i) == '(') {
				cnt++;
			}else {
				cnt--;
			}
			if(cnt < 0) {
				ans = "(" + ans;
				cnt++;
			}
		}
		for(int i = 0; i < cnt; i++) {
			ans = ans + ")";
		}
		System.out.println(ans);
	}
}

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


using namespace std;
using ll = long long;

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


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

using namespace std;
int main() {
	int N;
	long Y;
	cin >> N >> Y;
	for (int i = N; i >=0; i--) {
		for (int j = N-i; j >= 0; j--) {
			if (10000 * i + 5000 * j + 1000*(N-i-j)==Y) {
				cout << i <<" "<< j <<" "<< N - i - j << endl;
				return 0;
			}
		}
	}
	cout << -1 <<" "<< -1 <<" "<< -1 << endl;
}

Measured memory_bytes: 256
/*
    アリナ・グレイはかわいい
*/

#include<bits/stdc++.h>
using namespace std;
#define itn int
#define ll long long

int main(void){
    ll x;
    cin >> x;
    ll sum = (x / 500)*1000;
    x %= 500;
    sum += (x / 5)*5;
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>
#include <numeric>

using namespace std;

// マクロ&定数 ============================================================
typedef unsigned int uint;
typedef long long ll;
//typedef pair<int, int> P;

typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;
typedef vector<string> vstring;
typedef vector<char> vchar;

typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<double, double>> vpdouble;

typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<bool>> vvbool;

const int c_YET = -1;
const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = { 0,0,1,-1, 1, 1, -1, -1, 0 }; // 4;４近傍
const int DY[9] = { 1,-1,0,0, 1, -1, 1, -1, 0 }; // 8:８近傍 9:(0,0)を含む
const ll MOD = 1e9 + 7; //10^9 + 7
const ll MAX = 1e9;
const double PI = 3.14159265358979323846264338327950288;
//========================================================================


vbool made(1e8);

bool k;

int main() {

	//==================================
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(30);
	//==================================


	ll X, Y;
	cin >> X >> Y;

	ll N = 1;
	ll now = X;
	while (true)
	{

		now *= 2;
		if (now > Y)
		{
			cout << N << endl;
			return 0;
		}

		N++;


	}







}



Measured memory_bytes: 12416
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <queue>
#include <map>
using namespace std;
typedef long long int ll;

ll d[300][300];
ll dd[300][300];

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n,m,l; cin >> n >> m >> l;
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			if(i!=j)d[i][j]=dd[i][j]=1e18;
		}
	}
	for(int i=0;i<m;i++){
		int a,b; ll c; cin >> a >> b >> c;
		a--; b--;
		d[a][b]=d[b][a]=c;
	}
	for(int k=0;k<n;k++){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
			}
		}
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			dd[i][j]=(d[i][j]<=l?1:1e9);
		}
	}
	for(int k=0;k<n;k++){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				dd[i][j]=min(dd[i][j],dd[i][k]+dd[k][j]);
			}
		}
	}
	int q; cin >> q;
	for(int i=0;i<q;i++){
		int x,y; cin >> x >> y;
		x--; y--;
		if(dd[x][y]>=1e9){
			cout << -1 << endl;
		}
		else{
			cout << dd[x][y]-1 << endl;
		}
	}
}

Measured memory_bytes: 1920
/* 	ex5_4
   	masaaki52	*/
#include <stdio.h>
#include <string.h>
int main(void){
  char string[11];
  int i,count=0,max=0;
  scanf("%s",string);
  //文字列stringの頭からnull文字まで、以下の操作を行う
  for(i=0;i<strlen(string)+1;i++){
    switch(string[i]){//stringのi番目が
      case 'A': case 'C': case 'G': case 'T'://A,C,G,Tのどれかなら
        count++;//countに1を加える
        break;
      default://A,C,G,T以外の場合
        if(count > max){//もしcountがmaxより大きいなら
          max = count;//そのcountをmaxとする
        }
        count = 0;//countの初期化
    }
  }
  printf("%d",max);
  return 0;
}

Measured memory_bytes: 1712
/*
g++ -std=c++14 -o2 -Wall ABC126A.cpp -o .\out\ABC126A.out
.\out\ABC126A.out
*/

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

typedef long long ll;

int main(){
//  freopen("./input/input.txt", "r", stdin);
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  s[k-1] = 'a' + (s[k-1]-'A');
  cout << s;
  return 0;
}


Measured memory_bytes: 892
import sys
from itertools import combinations as combi
input = sys.stdin.readline
N, M = map(int, input().split())
if N == 1:
  print(M)
  exit(0)
i = 2
res = 1
while i * i <= M:
  t = 1
  if M % i == 0 and (M // i >= N):
    res = max(res, i)
    t = M // i
  if M % t == 0 and (M // t >= N):
    res = max(res, t)
  i += 1
print(res)

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

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

  int ans1 = a*x+b*y;
  int ans2,ans3;
  if(x>y){
    ans2 = c*2*y + a*(x-y);
    ans3 = c*2*x;
  }
  else{
    ans2 = c*2*x + b*(y-x);
    ans3 = c*2*y;
  }
  cout << min({ans1,ans2,ans3}) << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include <math.h>
int main(void){
    int i,j,N;
    double xa[100],ya[100],ra[100],xb[100],yb[100],rb[100];
    scanf("%d",&N);
    for(i = 0;i < N;i++){
        scanf("%lf",&xa[i]);
        scanf("%lf",&ya[i]);
        scanf("%lf",&ra[i]);
        scanf("%lf",&xb[i]);
        scanf("%lf",&yb[i]);
        scanf("%lf",&rb[i]);
    }
    for(j = 0;j < N;j++){
        double dist = sqrt((xa[j] - xb[j]) * (xa[j] - xb[j]) + (ya[j] - yb[j]) * (ya[j] - yb[j]));
        if(dist < ra[j] - rb[j]){
            printf("2\n");
        }
        else if(dist < rb[j] - ra[j]){
            printf("-2\n");
        }
        else if(dist > rb[j] + ra[j]){
            printf("0\n");
        }
        else{
            printf("1\n");
        }
    }
    return 0;
}

Measured memory_bytes: 624
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)

	var p = make([]int, n)
	for i := range p {
		fmt.Scan(&p[i])
	}

	p2 := 0
	count := 0
	for i := 0; i < len(p)-2; i++ {
		tmp := []int{p[i], p[i+1], p[i+2]}

		p2 = p[i+1]
		sort.Ints(tmp)
		if p2 == tmp[1] {
			count++
		}
	}
	fmt.Println(count)
}


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

int main() {
  int64_t A,B,K;
  cin >> A >> B >> K;
  if(A+B >= K){
    if(K >= A){
      cout << 0 << endl << B-(K-A) << endl;
    }else{
      cout << A-K << endl << B << endl;
    }
  }else{
    cout << 0 << endl << 0 << endl;
  }    
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

int main()
{
	map<string,int> m;
	for(string s;cin>>s;m[s]++)
		;
	
	string freq="",longest="";
	tr(m,i){
		if(m[freq]<i->second)
			freq=i->first;
		if(longest.size()<i->first.size())
			longest=i->first;
	}
	cout<<freq<<" "<<longest<<endl;
	
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

int main(){
  
  int n;
  cin>>n;
  int a[n];
  int ocnt = 0;
  int ecnt = 0;
  REP(i,n){
    cin>>a[i];
    if(a[i]%2 == 0){
      ecnt++;
    }else{
      ocnt++;
    }
  }
  
  if(ocnt%2 == 0){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
  return 0;
}


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

#define rng(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define pb push_back
#define eb emplace_back
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed

int main() {
  int n, a, b, ans = 0;
  string s;
  cin >> a;
  //vector<int> v(n), c(n);
  //if(1) {}
  //
  //for(int i = 0; i < n; i++){}
  cout << (a / 500) * 1000 + (a % 500 / 5) * 5 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using ll = long long;

auto R(int s, int n) {
    return boost::irange(s, n);
}
auto R(int n) {
    return boost::irange(0, n);
}
void show(const auto& v){
    for(auto i:v) cout << i << " ";
    cout << endl;
}

int main() {
    int n;
    vector<int> a(100004,0);
    cin >> n;
    for(int i:R(n)){
        int j;
        cin>>j;
        if(j==0){
            a.at(0)++;
            a.at(1)++;
        }else{
            a.at(j-1)++;
            a.at(j)++;
            a.at(j+1)++;
        }
    }
    int ans=0;
    for(int i:R(100004)){
        if(a.at(i)>ans){
            ans=a.at(i);
        }
    }
    cout <<ans<<endl;

    return 0;
}


Measured memory_bytes: 640
N=input()
A=map(int, raw_input().split())
B=map(int, raw_input().split())
C=map(int, raw_input().split())

ans=0
prev=None
for i in range(N):
	a=A[i]
	ans+=B[a-1]
	if prev is None:
		pass
	elif prev+1==a:
		ans+=C[prev-1]
	prev=a

print ans

Measured memory_bytes: 28012
class SWAG():
    __slots__=('unit','f','fold_r','fold_l','data_r','data_l')
    def __init__(self,unit,f,data):
        self.unit=unit
        self.f=f
        self.fold_r=[unit]
        self.fold_l=[unit]
        self.data_r=[]
        self.data_l=[]
        sep=len(data)//2
        for t in data[sep:]:
            self.append(t)
        for t in data[sep-1::-1]:
            self.appendleft(t)
    def append(self,x):
        self.fold_r.append(self.f(self.fold_r[-1],x))
        self.data_r.append(x)
    def appendleft(self,x):
        self.fold_l.append(self.f(self.fold_l[-1],x))
        self.data_l.append(x)
    def pop(self):
        if not self.data_r:
            self.__init__(self.unit,self.f,self.data_l[::-1])
        self.fold_r.pop()
        return self.data_r.pop()
    def popleft(self):
        if not self.data_l:
            self.__init__(self.unit,self.f,self.data_r)
        self.fold_l.pop()
        return self.data_l.pop()
    def fold_all(self):
        return self.f(self.fold_r[-1],self.fold_l[-1])
n,k,*p=map(int,open(0).read().split())
c=[0]
for a,b in zip(p,p[1:]):c+=c[-1]+(a<b),
*c,f=[b-a==k-1for a,b in zip(c,c[k-1:])]
x=not f
s_min=SWAG(10**18,min,p[:k-1])
s_max=SWAG(0,max,p[1:k])
for i,(a,b,c)in enumerate(zip(p,p[k:],c)):
    f|=c
    s_min.append(p[i+k-1])
    s_max.append(b)
    if not c and(a!=s_min.fold_all()or b!=s_max.fold_all()):x+=1
    s_min.popleft()
    s_max.popleft()
print(x+f)

Measured memory_bytes: 120892
#pragma region template 2.4
#include <bits/stdc++.h>
using namespace std;
template <typename T>
using pq_asc = priority_queue<T, vector<T>, greater<T>>;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define FOR(i, a) for (auto &i : a)
#define CH(f, x, y) x = f(x, y)
#define IN(T, x) \
    T x;         \
    cin >> x;
#define AIN(T, a, n) \
    vector<T> a(n);  \
    FOR(i, a)        \
    cin >> i;
#define A2IN(T1, a, T2, b, n) \
    vector<T1> a(n);          \
    vector<T2> b(n);          \
    REP(i, n)                 \
    cin >> a[i] >> b[i];
#define OUT(x) cout << (x) << endl;
#define FOUT(x) cout << fixed << setprecision(15) << (x) << endl;
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define DUMPA(a)          \
    cout << #a << " = {"; \
    JOUT(ALL(a), ", ", cout) << "}" << endl;

template <typename T>
ostream &JOUT(T s, T e, string sep = " ", ostream &os = cout)
{
    if (s != e)
    {
        os << *s;
        ++s;
    }
    while (s != e)
    {
        os << sep << *s;
        ++s;
    }
    return os;
}

ostream &YES(bool cond, string yes = "Yes", string no = "No", ostream &os = cout)
{
    if (cond)
    {
        os << yes << endl;
    }
    else
    {
        os << no << endl;
    }
    return os;
}

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

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << '[';
    JOUT(ALL(v), ", ", os) << ']';
    return os;
}

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion template

int main()
{
    IN(ll, N);
    A2IN(ll, A, ll, B, N);
    vii T(N);
    REP(i, N)
    {
        T[i] = {B[i], A[i]};
    }
    SORT(T);
    ll t = 0;
    for (auto [b, a] : T)
    {
        t += a;
        if (t > b)
        {
            OUT("No");
            return 0;
        }
    }
    OUT("Yes");
}

Measured memory_bytes: 9572
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

int main(int argc, const char * argv[]) {

    cin.tie(0);
    ios::sync_with_stdio(false);

    int cnt;

    cin >> cnt;

    int min = cnt+1;
    int result = 0;
    for(int i=0; i < cnt; i++) {
        int p;
        cin >> p;
        if (i == 0) {
            min = p;
            result++;
        } else if (p <= min) {
            result++;
            min = p;
        }
    }

    cout << result;

    return 0;
}


Measured memory_bytes: 888
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
let hour = Math.floor(input / 3600);
let minite = Math.floor((input - 3600 * hour) / 60);
let sec = (input - 3600 * hour) - (minite * 60);
console.log(hour + ":" + minite + ":" + sec);


Measured memory_bytes: 15124
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)

b = []
a.each_with_index do |e, i|
  if i.even?
    b.push e
  else
    b.unshift e
  end
end

if a.size.odd?
  b.reverse!
end
puts b.join(' ')




Measured memory_bytes: 27860
Imports System.Collections.Generic

Module Module1
    Sub Main()
        '情報取得
        Dim N() As String = Console.ReadLine.Split(" ")
        Dim totalCount As Integer = Integer.Parse(N(0))
        Dim totalMoney As Integer = Integer.Parse(N(1))

        Dim oneCount As Integer = 0
        For tenCount As Integer = 0 To totalCount                           '枚数ループ：1万
        For fiveCount As Integer = 0 To (totalCount - tenCount)         '枚数ループ：5千円
        oneCount = totalCount - tenCount - fiveCount                '枚数：千円
        If (tenCount * 10000 + fiveCount * 5000 + oneCount * 1000) = totalMoney Then
          Console.WriteLine(tenCount & " " & fiveCount & " " & oneCount)
          Exit Sub
          End If
        Next
      Next
      Console.WriteLine("-1 -1 -1")
    End Sub
End Module


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

typedef long long LL;
typedef long long ll;
#define SZ(a) int((a).size())
#define FOR(var,a,b) for(__typeof(b) var=(a)-((a)<(b)?0:1);var!=(b)-((a)<(b)?0:1);var+=((a)<(b)?1:-1))
#define REP(var,n) FOR(var,0,n)
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define INT(n) int n;scanf("%d",&n)
#define VPI(v, n) vector<pair<int,int>> v;int a, b;REP(i,n){scanf("%d %d", &a, &b);v.EB(MP(a,b));}
#define MSET(arr,val)  memset(arr,val,sizeof(arr))

int main(){
  INT(h); INT(w); INT(n); VPI(ab, n);
  set<pair<int,int>> s; for(auto p: ab){s.insert(p);}
  LL ans[10]; MSET(ans, 0);
  ans[0] = (LL)(h - 2) * (w - 2);
  for(auto p:ab){
    int a = p.first, b = p.second;
    for(int i = max(a - 2, 1); i < min(a + 1, h - 1); i++){
      for(int j = max(b - 2, 1); j < min(b + 1, w - 1); j++){
        int cnt = 0;
        REP(k, 3){
          REP(l, 3){
            if (s.count(MP(i + k, j + l))){cnt++;}
          }
        }
        ans[cnt]++;
      }
    }
  }
  FOR(i, 2, 10){ans[i] /= (LL)i;}
  FOR(i, 1, 10){ans[0] -= ans[i];}
  for(LL e:ans){printf("%lld\n",e);}
  return 0;
}


Measured memory_bytes: 5748
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		int K = sc.nextInt();
		char[][] arr = new char[h][w];
		for(int i=0;i<h;i++){
			String s = sc.next();
			for(int j=0;j<s.length();j++){
				arr[i][j]=s.charAt(j);
			}
		}
		int ans=0;
		for(int i=0;i<(1<<h);i++){
			for(int j=0;j<(1<<w);j++){
				int black=0;
				for(int k=0;k<h;k++) {
					for(int l=0;l<w;l++) {
						if(((i>>k)&1)==0 && ((j>>l)&1)==0 && arr[k][l]=='#') {
							black++;
						}
					}
				}
				if(black==K){
					ans++;
				}
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 35608
#include <bits/stdc++.h>
using namespace std;
const int m1=110000;
int a,b,c[m1],d[m1];
int main()
{
    scanf("%d%d",&a,&b);
    for (int i = 1; i <= a; i++) 
        scanf("%d",&c[i]); 
    memset(d,0x3f,sizeof(d)),d[1]=0;
    for (int i = 2; i <= a; i++) 
        for (int j = 1; j<i && j<=b; j++)
            d[i]=min(d[i],d[i-j]+abs(c[i]-c[i-j]));
    printf("%d",d[a]);
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	int maxx=a+b;
	if(maxx<a-b){
		maxx=a-b;
	}
	if(maxx<a*b){
		maxx=a*b;
	}
	printf("%d",maxx);
}

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

int n, a, b, c, d;
string s;

signed main() {
	cin >> n >> a >> b >> c >> d >> s;
	s = " " + s;
	while(a < c) {
		if(s[a + 1] == '.') {
			if(a + 2 == b) a++;
			else if(a + 1 == b) {
				if(b == c) {
					if(s[b + 1] == '.') {
						b++;
					} else if(s[b + 2] == '.') {
						b += 2;
					} else {
						break;
					}
					a++;
				}
				if(s[a + 2] == '.') a += 2;
				else {
					if(b < d && s[b + 1] == '.') b++;
					else if(b + 2 <= d && s[b + 2] == '.') b += 2;
					else break;
					a++;
				}
			} else a++;
		} else if(s[a + 1] == '#' && s[a + 2] == '.') {
			if(a + 2 == b) {
				if(s[b + 1] == '.' && b < d) b++;
				else if(s[b + 1] == '#' && s[b + 2] == '.' && b + 2 <= d) b += 2;
				else break;
			}
			a += 2;
		} else {
			break;
		}
	}
	while(b < d) {
		if(s[b + 2] == '.' && b + 2 <= d) b += 2;
		else if(s[b + 1] == '.') b++;
		else if(s[b + 1] == '#' && s[b + 2] == '.') b += 2;
		else break;
	}
	if(a == c && b == d) cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 772
N = int(input())
n = 10
for A in range(1, 100001):
    if N % A != 0:
        continue
    B = int(N / A)
    a = len(str(A))
    b = len(str(B))
    m = max(a, b)
    n = min(n, m)
print(n)

Measured memory_bytes: 3444
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll N = 100005;
const ll mm = 1e+18;
void solve()
{
    int sx,sy,tx,ty;
    cin>>sx>>sy>>tx>>ty;
    string ans="";
    rep0(i,tx-sx) ans+='R';
    rep0(i,ty-sy) ans+='U';
    rep0(i,tx-sx) ans+='L';
    rep0(i,ty-sy) ans+='D';
    ans+='D';
    rep0(i,tx-sx+1) ans+='R';
    rep0(i,ty-sy+1) ans+='U';
    ans+='L';
    ans+='U';
    rep0(i,tx-sx+1) ans+='L';
    rep0(i,ty-sy+1) ans+='D';
    ans+='R';
    pr(ans);
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}

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

int count(int n) {
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (n % i == 0)ans++;
	}
	return ans;
}

int main() {
	int n;
	cin >> n;
	int cnt = 0;
	for (int i = 1; i <= n; i +=2) {
		if (count(i) == 8)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

def par(a):
    if P[a] < 0: return a
    t = par(P[a])
    P[a] = t
    return t
def unite(a, b):
    if par(a) == par(b): return 0
    C[par(a)], C[par(b)] = C[par(a)] + C[par(b)], C[par(a)] + C[par(b)]
    if P[par(b)] == P[par(a)]:
        P[par(b)] = par(a)
        P[par(a)] -= 1
    elif P[par(b)] > P[par(a)]:
        P[par(b)] = par(a)
    else:
        P[par(a)] = par(b)
N, H, W = map(int, input().split())
P = [-1 for i in range(H+W)]
C = [1] * (H+W)
X = []
for _ in range(N):
    r, c, a = map(int, input().split())
    X.append((a, r-1, c+H-1))
X = sorted(X)
ans = 0
while X:
    a, r, c = X.pop()
    unite(r, c)
    if C[par(r)]:
        ans += a
        C[par(r)] -= 1
print(ans)

Measured memory_bytes: 25788
#include<bits/stdc++.h>
using namespace std;
    static const double pi = 3.141592653589793;
 
 
int main(){
int a;
  cin>>a;
  vector<int>op(a);
  vector<int>ab(a);
  for(int i=0;i<a;i++)
  {
  int x,y;
    cin>>x>>y;
    op.at(i)=x;
    ab.at(i)=y;
  
  }
  int b=1;
  for(int i=1;i<a+1;i++)
  {
 b=b*i; 
  }
 double t=0.0000000000;
  for(int i=0;i<a;i++)
  {
 for(int j=0;j<a;j++)
 {
 t=t+b/a*sqrt((op.at(i)-op.at(j))*(op.at(i)-op.at(j))+(ab.at(i)-ab.at(j))*(ab.at(i)-ab.at(j)));
 
 }

  }
  
    cout << fixed << setprecision(10) <<t/b<<endl;
    
  
  
  
}
 
 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1e9
#define endl '\n'
#define ALL(x) (x).begin(), (x).end()
#define SORT(c) sort((c).begin(), (c).end())
#define SORTR(c) sort((c).begin(), (c).end(), greater<int>())
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int   N, T, A;
    float H;
    int   ansN = 0;
    float ansD = INF;
    cin >> N >> T >> A;
    for (int i = 0; i < N; i++) {
        cin >> H;
        H = abs(A - (T - H * 0.006));
        if (ansD > H) {
            ansD = H;
            ansN = i;
        }
    }
    cout << ansN + 1 << endl;
}


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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define size_t unsigned long long
#define ll long long
#define rep(i,a) for(ll i=0;i<(a);i++)
#define repr(i,a) for(int i=(int)(a)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(int)(b)-1;i>=a;i--)
#define ALL(a) a.begin(), a.end()
using namespace std;
int si() { int x; scanf("%d", &x); return x; }
long long sl() { long long x; scanf("%lld", &x); return x; }
string ss() { string x; cin >> x; return x; }
void pi(int x) { printf("%d ", x); }
void pl(long long x) { printf("%lld ", x); }
void pd(double x) { printf("%.15f ", x); }
void ps(const string &s) { printf("%s ", s.c_str()); }
void br() { putchar('\n'); }

const int MOD = 1e9 + 7;

struct mint {
    int n;
    mint(int n_ = 0) : n(n_) {}
};

mint operator+(mint a, mint b) { a.n += b.n; if (a.n >= MOD) a.n -= MOD; return a; }
mint operator-(mint a, mint b) { a.n -= b.n; if (a.n < 0) a.n += MOD; return a; }
mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }

typedef pair<int, int> P;

const int N = 1e5+5;
string s;
vector<ll> v;
ll a,b;
ll bg, sm;
int result;
int h;

// 素因数分解O(ルートn)
map<ll,ll> prime_factor(ll n, ll m) {
  map<ll,ll> res;
  // cout << n << " : " << m << endl;
  for(ll i = 2; i*i <= n || i*i <= n; i++) {
    // cout << i << endl;
    while(n%i == 0 && m%i == 0) {
      // cout << 'a' << endl;
      ++res[i];
      n /= i; m/= i;
    }
    while(n%i == 0) n /= i;
    while(m%i == 0) m /= i;
  }
  if(n%m == 0 && m!=1 && n!=1) {
    res[n]++;
    // cout << "n" << n << endl;
  }
  if(m%n == 0 && n!=1 && m!=1) {
    res[m]++;
    // cout << m << endl;
  }
  return res;
}

int main () {
  cin >> a >> b;
  map<ll,ll> res = a > b ? prime_factor(a,b) : prime_factor(b,a);
  ll count = 1;
  for (auto ite = res.begin(); ite != res.end(); ++ite) {
    // cout << ite->first << endl;
    
    count++;
  }
  cout << count << endl;
}


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

namespace CompetitiveProgCsLib
{
	class MainProg
	{
		static string R => Console.ReadLine();
		static int RI => int.Parse(R);
		static double RD => double.Parse(R);
		static int[] RIs => R.Split(' ').Select(int.Parse).ToArray();
		static double[] RDs => R.Split(' ').Select(double.Parse).ToArray();
		static void Out(object obj) => Console.WriteLine(obj);
		static void Outb(bool b) => Out(b ? "Yes" : "No");
		static void OutB(bool b) => Out(b ? "YES" : "NO");

		static void Main(string[] args)
		{
			var inp = RIs;
			var N = inp[0];
			var K = inp[1];
			long ans = 0;
			if (K == 0) ans = (long)N * N;
			else
			{
				for (int i = K; i <= N; i++)
				{
					ans += Math.Max(((N + 1) % i) - K, 0);
					ans += (((N + 1) - ((N + 1) % i)) / i) * (i - K);

				}
			}
			Out(ans);
		}
	}
}


Measured memory_bytes: 13396
n = int(input())
a = list(map(int, input().split()))

b = [0]*n
c = 0
d = 0

for i in range(n):
    c = a[i] - 1
    b[c] = b[c] + 1

for j in range(n):
    d = d + b[j]*(b[j]-1)/2

for k in range(n):
    c = a[k] - 1
    print(int(d-b[c]+1))


Measured memory_bytes: 26268
import java.util.Scanner;
import java.util.ArrayList;
public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	int n = Integer.parseInt(scan.nextLine());
	int[] preorder = new int[n];
	int[] inorder = new int[n];
	String[] inputPre, inputIn;
	inputPre = scan.nextLine().split(" ");
	inputIn = scan.nextLine().split(" ");
	for (int i = 0; i < n; i++) {
	    preorder[i] = Integer.parseInt(inputPre[i]);
	    inorder[i] = Integer.parseInt(inputIn[i]);
	}
	Reconstructer recnst = new Reconstructer(preorder, inorder);
	recnst.runReconstruct();
	recnst.printPostorder();
    }
}
class Reconstructer {
    int[] preorder;
    int[] inorder;
    int[] postorder;
    int prePosition, postPosition;
    Reconstructer (int[] preorder, int[] inorder) {
	this.preorder = preorder;
	this.inorder = inorder;
	postorder = new int[preorder.length];
    }
    void runReconstruct () {
	reconstruct(0, preorder.length);
    }
    void reconstruct (int left, int right) {
	if (left >= right) {
	    return;
	}	
	int inPosition = 0;
	int node = preorder[prePosition++];
	while (node != inorder[inPosition]) {
	    inPosition++;
	}
	reconstruct(left, inPosition);
	reconstruct(inPosition+1, right);
	postorder[postPosition++] = node;
    }
    void printPostorder () {
	StringBuilder sb = new StringBuilder();
	int n = postorder.length;
	for (int i = 0; i < n - 1; i++) {
	    sb.append(postorder[i] + " ");
	}
	sb.append(postorder[n-1] + "\n");
	System.out.print(sb);
    }
}



Measured memory_bytes: 26256
#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <string>
#include <cctype>
#include <cstdio>;


using namespace std;



int main() {
    int n;
    string T, H;
    int tp = 0, hp = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> T >> H;
        if (T > H) {
            tp += 3;
        }
        else if (H > T) {
            hp += 3;
        }
        else {
            tp++;
            hp++;
        }
    }
    cout << tp << " " << hp << endl;
}


Measured memory_bytes: 3168
#include <stdio.h>
#include <iostream>

using namespace std;

int main(){
	int temp,temp1,temp2,temp3;
	int N;
	int monsters[100002];
	int heros[100001];
	long long total;

	scanf("%d",&N);
	for(temp=1;temp<=N+1;temp++){
		scanf("%d",&monsters[temp]);
	}
	for(temp=1;temp<=N;temp++){
		scanf("%d",&heros[temp]);
	}

	for(temp=N;temp>=1;temp--){
		if(heros[temp]>=monsters[temp+1]){
			total+=(long long)monsters[temp+1];
			heros[temp]-=monsters[temp+1];
			monsters[temp+1]=0;
		}
		else{
			total+=(long long)heros[temp];
			monsters[temp+1]-=heros[temp];
			heros[temp]=0;
		}
		if(heros[temp]>=monsters[temp]){
			total+=(long long)monsters[temp];
			heros[temp]-=monsters[temp];
			monsters[temp]=0;
		}
		else{
			total+=(long long)heros[temp];
			monsters[temp]-=heros[temp];
			heros[temp]=0;
		}
	}
	printf("%lld\n",total);
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}


int main(){

    ll N;
    cin >> N;
    ll tmp = 0;
    rep(i, N){
        ll x;
        cin >> x;
        if(x == tmp + 1)tmp++;
    }
    if(tmp == 0)cout << -1 << endl;
    else cout << N - tmp << endl;

    return 0;
}

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()
#define all2(a, b) (a).begin(), (a).begin() + (b)
#define debug(vari) cerr << #vari << " = " << (vari) << endl;

int main()
{
    int N, M;
    cin >> N >> M;
    if (N == 1 || M == 1)
    {
        cout << 1 << endl;
        return 0;
    }
    ll ans = (ll)N * M / 2;
    if (N % 2 == 1 && M % 2 == 1)
    {
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
vector<pair<ll,ll>>adj[100100];
ll color[100100];
ll visited[100100];
ll maxindex,maxi;
ll dfs(ll x,ll pcol)
{
    //cout<<x<<" x "<<pcol<<endl;
    //cout<<x<<"\n";
    visited[x]=1;
    ll cur=pcol+1;
    if(cur>maxi)
        cur=1;
    if(x==maxindex)
    {
        for(pair<ll,ll>p:adj[maxindex])
        {
            color[p.second]=cur;
            //cout<<p.second<<" "<<cur<<endl;
            dfs(p.first,cur);
            cur+=1;
            if(cur>maxi)
                cur=1;
        }
    }
    else
    {
        for(pair<ll,ll>p:adj[x])
        {
            if(visited[p.first]==0)
            {
                    color[p.second]=cur;
                    //cout<<p.second<<" "<<cur<<endl;
                    if(visited[p.first]==0)
                        dfs(p.first,cur);
                    cur+=1;
            }
            if(cur>maxi)
                cur=1;
        }
    }
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a,b;
    maxi=0;
    for(ll i=1;i<n;i++)
    {
        cin>>a>>b;
        adj[a].push_back(make_pair(b,i));
        adj[b].push_back(make_pair(a,i));
    }
    for(ll i=1;i<=n;i++)
    {
        if(adj[i].size()>maxi)
        {
            maxi=adj[i].size();
            maxindex=i;
        }
    }
    dfs(maxindex,0);
    //cout<<maxindex<<endl;
    cout<<maxi<<endl;
    for(ll j=1;j<n;j++)
    {
        cout<<color[j]<<endl;
    }
}

Measured memory_bytes: 9600
/* B - Magic 2 */

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

int main(){
  int A, B, C, K;
  string str = "No";
  cin >> A >> B >> C >> K;
  for(int i = 0; i < K; i++){
    if(!(A < B && B < C)){
    	if(A >= B){
    	B *= 2;
    	}else if(B >= C){
      	C *= 2;
    	}
    }
    if(A < B && B < C){
      str = "Yes";
      break;
    }
  }
  cout << str << endl;
}


Measured memory_bytes: 3624
n = int(input())
v = list(map(int,input().split()))

def gcd(a,b):
  while b != 0:
    a, b = b, a % b
  return a

l_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[i-1])
    l_ans[i] = g
r_ans = [0] * n
g = 0
for i in range(1, n):
    g = gcd(g, v[n-i])
    r_ans[i] = g
r_ans.reverse()
ans = 1
for i in range(n):
    ans = max(ans, gcd(l_ans[i], r_ans[i]))
print(ans)



Measured memory_bytes: 14436
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  double a,b;
  vector<int> nl(4), nr(4);
  while(cin >> a>> b) {
    if (a>=1.1) nl[0]++;
    else if (a>=0.6 && a<1.1) nl[1]++;
    else if (a>=0.2 && a<0.6) nl[2]++;
    else nl[3]++;
    if (b>=1.1) nr[0]++;
    else if (b>=0.6 && b<1.1) nr[1]++;
    else if (b>=0.2 && b<0.6) nr[2]++;
    else nr[3]++;
  }
  REP(i,4) {
    cout << nl[i] << " " << nr[i] << endl;
  }
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define ll long long
auto speedup = [](){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
	#endif
	return 0;
}();


int main(){
	int n, x, t;
	cin>>n>>x>>t;
	int mult = ceil((float)n/x);
	cout<<mult*t<<endl;
	return 0;
}


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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int M = (int)2e5;
		bool[] isPrime = new bool[M];
		for(int i=2;i<M;i++) isPrime[i] = true;
		for(int i=2;i<M;i++){
			if(!isPrime[i]) continue;
			for(int j=i+i;j<M;j+=i) isPrime[j] = false;
		}
		for(int i=X;i<M;i++){
			if(isPrime[i]){
				Console.WriteLine(i);
				return;
			}
		}
		
		
	}
	int X;
	public Sol(){
		X = ri();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

using namespace std;

int n, a[205];

int main() {
    cin >> n;
    for(int i = 1; i <= 2 * n; i++) cin >> a[i];
    sort(a + 1, a + n + n + 1);
    int ans = 0;
    for(int i = 1; i <= 2 * n; i += 2) ans += a[i];
    cout << ans << endl;
    return 0;
}

//21:52:50

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

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

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
ll fact(ll n) { ll res = 1; for(ll i=2;i<=n;++i) res = res * i; return res;}
ll nCr(ll n, ll r) {return (fact(n)/fact(n-r)*fact(r)) ;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const int inf = 1 << 30;
// clang-format on

int N;
string S, T;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  cin >> S >> T;

  for (int i = 0; i < N; i++) {
    cout << S[i] << T[i];
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
#include<sstream>  
#include<map>
using namespace std;
int main(){
	map<int,int>m;
	for(int i=1;i<=500;i++)
		m[i*i]++;
	string a,b,s;
	cin>>a>>b;
	s=a+b;
	int num;
	num=atoi(s.c_str());
	if(m[num])
		printf("Yes\n");
	else
		printf("No\n");
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int a;
    int b;
    int c;
    cin >> a >> b >> c;
    if(a == b){
        cout << c << endl;
    }
    else if(a == c){
        cout << b << endl;
    }
    else{
        cout << a << endl;
    }
}

Measured memory_bytes: 256
//
//  main.cpp
//  Slim Span
//
//  Created by ?嘉? on 16/8/20.
//  Copyright ? 2016年 ?嘉?. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int maxn=100+10;
const int inf=1<<30;
int n,m,f[maxn],minimum,maximum;
struct road
{
    int u;
    int v;
    int w;
}roads[maxn*maxn/2];
int cmp(road a,road b)
{
    return a.w<b.w;
}
int getf(int i)
{
    if(f[i]==i) return i;
    else return f[i]=getf(f[i]);
}
void merge(int a,int b,int w)
{
    maximum=max(maximum,w);
    minimum=min(minimum,w);
    int fa=getf(a);
    int fb=getf(b);
    if(fa==fb) return;
    f[fa]=fb;
}
void init()
{
    for(int i=1;i<=n;i++) f[i]=i;
    minimum=inf;
    maximum=-inf;
}
int check()
{
    int cnt=0;
    int father=getf(1);
    for(int i=2;i<=n;i++)
    {
        if(getf(i)!=father) cnt++;
    }
    if(cnt==0) return 1;
    else return 0;
}
int main(int argc, const char * argv[]) {
    //freopen("/Users/zhangjiatao/Documents/暑期??/input.txt","r",stdin);
    while(scanf("%d%d",&n,&m))
    {
        if(n==0&&m==0) break;
        for(int i=1;i<=m;i++) scanf("%d%d%d",&roads[i].u,&roads[i].v,&roads[i].w);
        sort(roads+1,roads+m+1,cmp);
        int silm=inf;
        for(int l=1;l<=m;l++)
        {
            init();
            for(int r=l;r<=m;r++)
            {
                if(getf(roads[r].u)!=getf(roads[r].v))
                {
                    merge(roads[r].u,roads[r].v,roads[r].w);
                    if(check()==1)
                    {
                        if(maximum-minimum<silm) silm=maximum-minimum;
                        break;
                    }
                }
            }
        }
        if(silm==inf) printf("-1\n");
        else printf("%d\n",silm);
    }
    return 0;
}

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

using namespace std;

typedef long long ll;

const double pi = 3.14159265358979323846;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define MOD 1000000007LL
#define PS(p) cout << setprecision(15) << fixed << p << endl;
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
#define ALL(c) c.begin(), c.end()
#define CIN(v) cin >> v;
#define COUT(v) cout << v << "\n";

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

  int N, T, A;

  CIN(N >> T >> A);

  int H;
  double m = 10000;
  int r = 0;
  for (int i = 0; i < N; i++) {
    CIN(H);
    double c = abs(T - (H * 0.006) - A);
    m = min(c, m);
    if (m == c) {
      r = i;
    }
  }

  COUT(r + 1);
  return 0;
}


Measured memory_bytes: 256
//ALDS1_1_A_19140837_Ojima_Yukiya.cpp
//
//提出日 2020/07/01 wednesday
//
//プログラミング基礎演習2 CS 第8回課題 ALDS1_1_A
//
//学修番号 19140837　小島優希也

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

void display(vector<int> v) {
    for (int i = 0; i < v.size() - 1; i++) {
        cout << v.at(i) << " ";
    }
    cout << v.at(v.size() - 1) << endl;
}

void insertionsort(vector<int> a) {
    for (int i = 0; i < a.size(); i++) {
        int v = a.at(i);
        int j = i - 1;
        while (j >= 0 && a.at(j) > v) {
            a.at(j + 1) = a.at(j);
            j--;
        }
        a.at(j + 1) = v;
        display(a);
    }
}

int main(void) {
    vector<int> vec;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int value;
        cin >> value;
        vec.push_back(value);
    }
    insertionsort(vec);
    return 0;
}


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

int main() {
    long long a;
    string s;
    cin >> a >> s;
    int b, c;
    b = stoi(s.substr(0, 1));
    b *= 100;
    c = stoi(s.substr(2, 2));
    b += c;
    long long res = a * b;
    cout << res / 100 << endl;
}

Measured memory_bytes: 3544
#include <stdio.h>
#include <string.h>

#define N (1000 + 10)

#define max(a, b) (a < b ? b : a)

int dp[N][N];
char a[N], b[N];

int LCS(void)
{
  const int a_size = strlen(a) - 1; // last one is '\n'
  const int b_size = strlen(b) - 1;
  int i, j;

  memset(dp, 0, sizeof(dp));

  for (i = 1; i < a_size + 1; ++i) {
    for (j = 1; j < b_size + 1; ++j) {
      int mx = max(dp[i][j - 1], dp[i - 1][j]);
      if (a[i - 1] == b[j - 1]) {
        mx = max(mx, dp[i - 1][j - 1] + 1);
      }
      dp[i][j] = mx;
    }
  }

  return dp[a_size][b_size];
}

int main(void)
{
  /*
  while (fgets(a, N, stdin) && fgets(b, N, stdin)) {
    printf("%d\n", LCS());
  }
  */
  int n, i;
  scanf("%d\n", &n);
  for ( i = 0; i < n; i++ ){
    fgets(a, N, stdin);
    fgets(b, N, stdin);
    printf("%d\n", LCS());
  }
  return 0;
}


Measured memory_bytes: 5844