akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < x; i++)
#define repn(i, x) for (long long i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
vector<pair<string, P> > vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long X) {
    ll res = 0, n = 100;
    while (n < X) {
        n *= 1.01;
        res++;
    }
    cout << res << endl;
}

int main() {
    long long X;
    scanf("%lld", &X);
    solve(X);
    return 0;
}


Measured memory_bytes: 3760
#include<bits/stdc++.h>
long long arr[1000000];
using namespace std;
int main()
{
	long long i,n,k,ans;
	ans=0;
	cin>>n>>k;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
		if (arr[i]>=k)
		{
			ans++;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <functional>
#include <numeric>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main(void) {
	string S, T;
	cin >> S >> T;
	string tmp = T.substr(0,T.length() - 1);
	//cout << tmp << endl;
	if (S == tmp) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <stdio.h>
int main()
{
    int a,b,c;//定义a,b,c三个变量（各位大佬也可以用short,long,long long等）
    scanf("%d %d %d",&a,&b,&c);//读入
    if((b*10+c)%4==0) printf("YES");//判断：只要末两位可以被4整除，它本身就可以被4整除
        else printf("NO");//否则就不被4整除
}

Measured memory_bytes: 128
package main

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

// https://atcoder.jp/contests/abc106/tasks/abc106_b

func main() {

	var flg bool
	var cnt int
	str := StrStdin()

	var result int

	for _, v := range str {
		if string(v) == "A" || string(v) == "C" || string(v) == "G" || string(v) == "T" {
			if !flg {
				flg = true
			}
			cnt++
			if result <= cnt {
				result = cnt
			}

		} else {
			flg = false
			cnt = 0
		}
	}

	fmt.Println(result)
}

// StrStdin 1行の文字列を入力
// Example:
// -----------------
// hogehoge
// -----------------
func StrStdin() string {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	return strings.TrimSpace(scanner.Text())
}

// IntStdin 1つの符号付き整数値(64bit)入力
// Exapmle:
// ------------------
// 1000000007
// ------------------
func IntStdin() int {
	stringInput := StrStdin()
	num, _ := strconv.ParseInt(strings.TrimSpace(stringInput), 10, 64)
	return int(num)
}

// UintStdin 1つの符号なし整数値(64bit)入力
// Exapmle:
// ------------------
// 1000000007
// ------------------
func UintStdin() uint {
	stringInput := StrStdin()
	num, _ := strconv.ParseUint(strings.TrimSpace(stringInput), 10, 64)
	return uint(num)
}

// Float64Stdin 1つの符号付き浮動小数点数(64bit)の入力
// Exapmle:
// ------------------
// 33.4
// ------------------
func Float64Stdin() float64 {
	stringInput := StrStdin()
	num, _ := strconv.ParseFloat(strings.TrimSpace(stringInput), 64)
	return num
}

// SplitWithoutEmpty 空白や空文字だけの値を除去したSplit
func SplitWithoutEmpty(stringTargeted string, delim string) []string {
	stringSplited := strings.Split(stringTargeted, delim)
	strs := []string{}

	for _, str := range stringSplited {
		if str != "" {
			strs = append(strs, str)
		}
	}
	return strs
}

// SliceStrsStdin 空白区切りで複数の文字列を1行で入力
// Example:
// --------------------
// hoge fuga hage
// --------------------
func SliceStrsStdin(delim string) []string {
	stringInput := StrStdin()
	return SplitWithoutEmpty(stringInput, delim)
}

// SliceInt64Stdin 空白区切りで複数の符号付き整数値(64bit)を1行で入力
// Example:
// --------------------
// 45 -100 23
// --------------------
func SliceInt64Stdin() []int64 {
	stringSplited := SliceStrsStdin(" ")

	int64Slice := []int64{}

	for ni := range stringSplited {
		num, _ := strconv.ParseInt(stringSplited[ni], 10, 64)
		int64Slice = append(int64Slice, num)
	}

	return int64Slice
}

// SliceUint64Stdin 空白区切りで複数の符号なし整数値(64bit)を1行で入力
// Example:
// --------------------
// 43 7 21
// --------------------
func SliceUint64Stdin() []uint64 {
	stringSplited := SliceStrsStdin(" ")

	uint64Slice := []uint64{}

	for ni := range stringSplited {
		num, _ := strconv.ParseUint(stringSplited[ni], 10, 64)
		uint64Slice = append(uint64Slice, num)
	}

	return uint64Slice
}

// SliceFloat64Stdin 空白区切りで複数の符号付き浮動小数点数(64bit)を入力
// Example:
// --------------------
// 45.0 -62.1 11.7
// --------------------
func SliceFloat64Stdin() []float64 {
	stringSplited := SliceStrsStdin(" ")

	float64Slice := []float64{}

	for ni := range stringSplited {
		num, _ := strconv.ParseFloat(stringSplited[ni], 64)
		float64Slice = append(float64Slice, num)
	}

	return float64Slice
}


Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main (String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        while (scanner.hasNext()) {
            int n =scanner.nextInt();
            int result = 0;
            boolean[] prime = new boolean[n+1];
            
            for (int i = 2; i < n+1; i++) {
                prime[i] = true;
            }
            
            for (int i = 2; i < n+1; i++) {
                if (prime[i]) {
                    result++;
                    for (int j = i+i; j < n+1; j += i) {
                        prime[j] = false;
                    }
                }
            }
            System.out.println(result);
        }
    }
}

Measured memory_bytes: 35644
N = input()
res = sum(map(int, N))
res = max(res, max(0, int(N[0]) - 1 + 9 * (len(N) - 1)))
for i in range(1, len(N) - 1):
    if int(N[i]) > 0:
        t = 0
        for j in range(i):
            t += int(N[j])
        t += int(N[i]) - 1 + 9 * (len(N) - i - 1)
        res = max(res, t)
print(res)


Measured memory_bytes: 9148
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

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

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

	map<int, int> m;

	int r = 0;
	bool f = true;
	int minv = inf;
	for (int l = 0; l < n; l++)
	{
		while (r < n && r - l < k)
		{
			m[a.at(r)] ++;
			r++;
		}

		if (r - l == k)
		{
			map<int, int>::iterator iter = begin(m);
			pair<int, int> p = *iter;

			minv = min(minv, p.first);
			cout << (f ? "" : " ") << minv;

			minv = inf;
			f = false;
		}

		if (l == r)
		{
			r++;
		}
		else
		{
			m[a.at(l)] --;
			if (m[a.at(l)] == 0)
			{
				m.erase(a.at(l));
			}
		}
	}
	cout << endl;
}


Measured memory_bytes: 11432
import java.io.*;
import java.util.*;
import java.lang.*;

public class Main{

	public static void main(String[] args) {
		FastReader in = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		char[] num = in.next().toCharArray();
		long ans = 0;
		for(char x:num) {
			ans+= x-'0'; 
		}
		out.println(ans%9==0?"Yes":"No");
		out.close();
	}

	static final Random random=new Random();
	//	static void ruffleSort(Pair[] a) {
	//		int n=a.length;//shuffle, then sort 
	//		for (int i=0; i<n; i++) {
	//			int oi=random.nextInt(n);
	//			Pair temp=a[oi];
	//			a[oi]=a[i]; a[i]=temp;
	//		}
	//		Arrays.sort(a);
	//	}
	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	static void ruffleSort(char[] a) {
		int n=a.length;//shuffle, then sort 
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n);
			char temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}
	static class FastReader 
	{ 
		BufferedReader br; 
		StringTokenizer st; 

		public FastReader() 
		{ 
			br = new BufferedReader(new
					InputStreamReader(System.in)); 
		} 

		String next() 
		{ 
			while (st == null || !st.hasMoreElements()) 
			{ 
				try
				{ 
					st = new StringTokenizer(br.readLine()); 
				} 
				catch (IOException  e) 
				{ 
					e.printStackTrace(); 
				} 
			} 
			return st.nextToken(); 
		} 

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

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

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

		String nextLine() 
		{ 
			String str = ""; 
			try
			{ 
				str = br.readLine(); 
			} 
			catch (IOException e) 
			{ 
				e.printStackTrace(); 
			} 
			return str; 
		} 

		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
	}
}

//class Pair implements Comparable<Pair>{
//    int a;
//    int b;
//    public Pair(int a, int b) {
//        this.a = a;
//        this.b = b;
//    }
//    public int compareTo(Pair o) {
//        if(this.a==o.a)
//            return this.b - o.b;
//        return this.a - o.a;
//    }   
//}

Measured memory_bytes: 29680
#include<iostream>
#include<cmath>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<cstdlib>
#include<queue>
#include<list>
#include<cctype>
using namespace std;

int main() {
    string s;
    cin>>s;
    long long ans=0;
    
    for(int bit=0; bit<(1<<(s.size()-1)); bit++){
        long long num=s[0]-'0';
        for(int i=0; i<s.size()-1; i++){
            if(bit&1<<i){
                ans+=num;
                num=0;
            }
            num=num*10+s[i+1]-'0';
        }
        ans+=num;
    }
    cout<<ans<<endl;
}


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

using namespace std;
typedef long long ll;

int main(){
  ll L, R;
  cin >> L >> R;
  if (R - L > 2019){
    cout << 0 << endl;
  }
  else{
    vector<ll> rem;
    for (ll i=L; i<=R; i++){
      rem.push_back(i % (ll)2019);
    }
    ll mini = 1e9;
    for (int i=0; i<rem.size() - 1; i++){
      for (int j=i+1; j<rem.size(); j++){
        mini = min(mini, (rem[i]*rem[j]) % (ll)2019);
      }
    }
    cout << mini << endl;
  }
  return 0;
}

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

int main()
{
	int ta,ji,sa,si,ha,total=0;
	cin >> ta >> ji >> sa >> si >> ha;

	if(ta>=40){
		total += ta;
	}else{
		total += 40;
	}
	if(ji>=40){
		total += ji;
	}else{
		total += 40;
	}
	if(sa>=40){
		total += sa;
	}else{
		total += 40;
	}
	if(si>=40){
		total += si;
	}else{
		total += 40;
	}
	if(ha>=40){
		total += ha;
	}else{
		total += 40;
	}
	cout << total/5 << "\n";
	return 0;
}

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

#define ll long long

using namespace std;

int main() {
	int n, k;
	int d;
	int i;
	int cnt = 0;
	set<int> hash;
	cin >> n >> k;
	while (k) {
		cin >> d;
		while (d) {
			cin >> i;
			hash.insert(i);
			--d;
		}
		--k;
	}
	for (int j = 1; j <= n; ++j)
		if (!hash.count(j)) ++cnt;
	cout << cnt << endl;
	return 0;
}

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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define rrepa(i,a,n) for(int i=n;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

bool comp(pi x,pi y){
    if(x.second == y.second)return x.first<y.first;
    return x.second<y.second;
}

int main(){

    int n;
    cin>>n;
    vc<pi> ab;
    rep(i,n){
        int a,b;
        cin>>a>>b;
        ab.emplace_back(a,b);
    }

    sort(all(ab));
    if(n%2==1){
        int a,b;
        a=ab[(n+1)/2-1].first;
        sort(all(ab),comp);
        b=ab[(n+1)/2-1].second;
        cout<<b-a+1<<"\n";
    }else{
        int a1,a2,b1,b2;
        a1=ab[n/2-1].first;
        a2=ab[n/2].first;
        sort(all(ab),comp);
        b1=ab[n/2-1].second;
        b2=ab[n/2].second;
        cout<<b1+b2-a1-a2+1<<"\n";
    }

    return 0;

}

Measured memory_bytes: 5288
#include<iostream>
#include<cstdio>
using namespace std;
int field[30][30]={0};
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
void solve(int x, int y);
int main(){
  while(scanf("%1d",&field[10][10]) != EOF){
    for(int i=0; i<12; i++)
      for(int j=0; j<12; j++)
	if(i!=0 || j!=0) scanf("%1d",&field[i+10][j+10]);
    int ans = 0;
    for(int i=0; i<12; i++){
      for(int j=0; j<12; j++){
	if(field[i+10][j+10] == 1){
	  ans++;
	  solve(i+10,j+10);
	}
      }
    }
    cout <<ans<<endl;
  }
  return 0;
}
void solve(int x, int y){
  field[x][y] = 0;
  for(int i=0; i<4; i++)
    if(field[x+dx[i]][y+dy[i]] == 1) solve(x+dx[i],y+dy[i]);
}

Measured memory_bytes: 1212
#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void)

{

char num_str[1002] ;

int num ;

long sum = 0 ;

int i ;

char tmp ;

while(1){

fgets(num_str, sizeof(num_str),stdin) ;

if(num_str[0] == '0') break ;

for(i = 0; i < strlen(num_str)-1 ;i++){

tmp = num_str[i] ;

num = atoi(&tmp) ;

sum = sum + num ;

}

printf("%ld\n",sum) ;

sum = 0 ;

memset(num_str, 1002, 0) ;

}

return 0 ;

}

Measured memory_bytes: 532
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int pop();
void push(int);


int main(){
  int x,y;
  char s[100];

  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
      x = pop();
      y = pop();
      push(x+y);

    } else if ( s[0] == '-' ){
      y = pop();
      x = pop();
      push(x-y);

    } else if ( s[0] == '*' ){
      x = pop();
      y = pop();
      push(x*y);

    } else {
      x = atoi(s);
      push(x);
    }
  }
  printf("%d\n",pop());

  return 0;
}


int stac[1000],top;

void push(int x){
  stac[++top] = x;
  
}

int pop(){
  top--;
  return stac[top+1];
}



Measured memory_bytes: 2104
/******* all required header files *******/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;

/*****All definitions*******/
#define w(t) int t; cin>>t; while(t--)
#define vi vector<int>
#define vs vector<string>
#define vc vector<char>
#define mp make_pair
#define ll long long int
#define pb push_back
#define F first
#define S second
/***************************/

int main()
{
/*#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif*/

	ios_base::sync_with_stdio(0);
	cin.tie(0);

	string str1, str2, str3;
	cin>>str1>>str2>>str3;

	char a, b, c;
	a = str1[0];
	b = str2[0];
	c = str3[0];

	a = a ^ 32;
	b = b ^ 32;
	c = c ^ 32;

	cout<<a<<b<<c;

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int main(){
	int N,a[100],i,j,temp,ali=0,bob=0;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&a[i]);
	}
	
	for (i = 0; i < (N - 1); i++) {
		for (j = (N - 1); j > i; j--) {
			if (a[j-1] < a[j]) {
        	temp = a[j-1];
        	a[j-1] = a[j];
        	a[j] = temp;
			}
		}
 	}
	for(i=0;i<N;i++){
		if(i%2 == 1){
			bob += a[i];
		}else{
			ali += a[i];
		}
	}
	printf("%d\n",ali - bob);
	return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N,M;
int L[222222],R[222222];
vint lis[222222];

int sum[4444444];

bool C(int x){
    priority_queue<int,vint,greater<int>>que;

    vint v;

    rep(i,M+1){
        for(auto r:lis[i])que.push(r);
        while(que.size()>i){
            v.pb(que.top());
            que.pop();
        }
    }

    rep(i,v.size())v[i]=M+1-v[i]+x;
    memset(sum,0,sizeof(sum));
    rep(i,v.size())sum[v[i]]++;
    rep(i,444444){
        if(i)sum[i]+=sum[i-1];
        if(sum[i]>i)return false;
    }
    return true;
}

signed main(){
    cin>>N>>M;
    rep(i,N)cin>>L[i]>>R[i];

    rep(i,N)lis[L[i]].pb(R[i]);

    int lb=max(0ll,N-M)-1,ub=N;
    while(ub-lb>1){
        int mid=(ub+lb)/2;
        if(C(mid))ub=mid;
        else lb=mid;
    }
    cout<<ub<<endl;
    return 0;
}


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

class Main{
  public static void main(String args[]){
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    int a[] = new int[n];
    for(int i=0;i<n;i++)
      a[i] = in.nextInt();

    int dp[] = new int[n];
    dp[0] = 0;
    dp[1] = Math.abs(a[0]-a[1]);

    for(int i=2;i<n;i++){
      dp[i] = Math.min(Math.abs(a[i-2]-a[i]) + dp[i-2], Math.abs(a[i-1]-a[i]) + dp[i-1]);
    }

    System.out.println(dp[n-1]);
  }
}

Measured memory_bytes: 49808
#include <cstdio>
#include <cstring>

const int MAXN = 1E5 + 10;

int K;
char s[MAXN];

int main(){
	scanf("%s", s);
	scanf("%d", &K);
	for (int i = 0; s[i]; ++i){
		if (s[i] == 'a')
			continue;
		if (26 - (s[i] - 'a') > K)
			continue;
		else if (26 - (s[i] - 'a') == K){
			s[i] = 'a';
			K = 0;
			break;
		}
		else{
			K -= 26 - (s[i] - 'a');
			s[i] = 'a';
		}
	}
	int n = strlen(s);
	s[n - 1] = 'a' + (s[n - 1] - 'a' + K) % 26;
	puts(s);
	return 0;
}


Measured memory_bytes: 384
function Main(input){
  input = input.split("\n");
  inputStr = input[0].split(" ");
  var S = inputStr[0];
  var i = 0;
  var counter = 0;
  var tmp = "";

  while(S.length >= 2 && i+1 < S.length ){  
    //console.log('i=$1',i);
    if (S.substr(i,1) != S.substr(i+1,1) ){
      //console.log(S.substr(i,1));
      //console.log(S.substr(i+1,1));
      
	  //console.log("捨てる");
      //iとi+1番目の配列要素を捨てる
	  tmp = S.substr(1,i) + S.substr(i+2)
      S = tmp;
      //console.log(tmp);
      counter += 2;
      //ループカウンタを戻す
      if ( i > 0 ) {
        i -= 1;
      } else {
        i = 0;
      }
    } else {
      //次の要素に進める
      i += 1;
    }
  }
  console.log(counter);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 40864
//08
#include<iostream>
#include<cmath>

using namespace std;

int gcd(int a,int b){
  return b?gcd(b,a%b):a;
}

int main(){
  for(int p,n;cin>>p>>n,p|n;){
    double a,b,c,d;
    double sp=sqrt(p);
    bool l=false,h=false;
    for(double i=1;i<=n;i++){
      for(double j=max(int(i/sp),1);j<=min(n,int(i/sp+1));j++){
	if(gcd(i,j)==1){
	  if(i/j<sp){
	    if(!l||i/j>a/b){
	      a=i;
	      b=j;
	      l=true;
	    }
	  }else{
	    if(!h||i/j<c/d){
	      c=i;
	      d=j;
	      h=true;
	    }
	  }
	}
      }
    }
    cout<<c<<'/'<<d<<' '<<a<<'/'<<b<<endl;
  }
  return 0;
}

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

using namespace std;

int main() {
    string s;
    cin >> s;
    int flag[26];
    for (int i = 0; i < 26; i++) {
        flag[i] = false;
    }

    for (int i = 0; i < s.length(); i++) {
        flag[s[i] - 'a'] = true;
    }

    for (int i = 0; i < 26; i++) {
        if (!flag[i]) {
            cout << (char)('a' + i) << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

ll gcd(ll a,ll b){
  if(min(a,b)==0){
    return max(a,b);
  }
  else if(a%b==0){
    return b;
  }
  else
    return gcd(b,a%b);
}
int main() {
  ll n,k;
  cin >> n >> k;
  vl a(n);
  rep(i,n){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  ll min=a[0],max=a[n-1];
  ll GCD=a[1]-a[0];
  rep(i,n-1){
    GCD=gcd(a[i+1]-a[i],GCD);
  }
  if(GCD!=0){
    if(k<=max&&(k-min)%GCD==0){
      cout << "POSSIBLE" << endl;
    }
    else{
      cout << "IMPOSSIBLE" << endl;
    }
  }
  else if(GCD==0){
    if(k==0||k==a[0]){
      cout << "POSSIBLE" << endl;
    }
    else{
      cout << "IMPOSSIBLE" << endl;
    }
  }
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define nout(ans) cout << (ans) << "\n"
#define sout(ans) cout << (ans) << " "
using namespace std;

const double pi = 3.14159265359;
const ll INF = 1e12;
const ll MOD = 1e9 + 7;
const ll N = 1e5+5; 
/*
Decimal Places: cout << fixed << setprecision(n) << ans << endl
*/

bool compare(const pair<int, int>&i, const pair<int, int>&j)
{
    return i.second < j.second;
}

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


string s, t;

void solve()
{
    cin >> s >> t;
    ll ans=INF;
    int n=s.size(), m=t.size();
    for (int i=0; i<=n-m; ++i) {
    	ll cnt=0;
    	for (int j=i; j<=i+m-1; j++) {
    		cnt += (s[j]!=t[j-i]);
    	}
    	ans=min(ans,cnt);
    }
    nout(ans);
    
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    //cin >> t;
    for (int i=1; i<=t; i++)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3644
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define in(x, l, r) (ll)(l) <= (x) && (x) < (ll)(r)

int main() {
    string S;
    cin >> S;
    int ans = 0;
    int tmp = 0;
    rep(i,0,3) {
        if (S[i] == 'R') {
            tmp++;
            ans = ans < tmp ? tmp : ans;
        } else {
            tmp = 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3592
function Main(input){
  
  var str = input;
  var tmp = str.split("\n");
  var k = tmp[5];
  tmp.pop();
      //console.log(abcde);
  
  var max = Math.max.apply(null, tmp);
  var min = Math.min.apply(null, tmp);
  
  if(max-min>k){
  console.log(":(");
  }else{
    console.log("Yay!");

  }

}//function end
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21192
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;

int main(){
  double a, b, C;
  cin >> a >> b >> C;
  C = C * M_PI / 180.0;
  cout << fixed << setprecision(10) << a*b*sin(C) / 2.0  << endl;
  double c = sqrt(pow(a, 2.0) + pow(b, 2.0) - 2*b*a*cos(C));
  cout << fixed << setprecision(10) << c + a + b  << endl;
  double sA = c * sin(C) / c;
  cout << fixed << setprecision(10) <<  b * sA << endl;
  return 0;
}

Measured memory_bytes: 1332
//https://codeforces.com/gym/102465/problem/E
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
ll gcd(ll x, ll y){
	return y == 0 ? x : gcd(y, x%y);
}
int main(){
	int n;
	cin >> n;
	int cnt = 0;
	ll ans = 0;
	for (int i = 1; i <= n; i++){
		for (int j = 1; j <= n;j++)
		for (int k = 1; k <= n; k++){
			ans += gcd(gcd(i, j), k);
		}
	}
	cout << ans << endl;
	return 0;
}

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;

const ll mod = 1e9+7;
const int maxn = 1e6 + 5;
const int inf = 1e9;



int a[maxn];
int n, m;
vector<pair<int,int>> g[maxn];
bool act[maxn];
int color[maxn];
int edges[maxn];

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

    memset(color,-1,sizeof(color));

    
    cin>>n>>m;


    vector<pair<int,int>> nodes;
    for (int i=0; i<n; i++) {
	cin>>a[i];
	nodes.push_back({a[i],i});
    }

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

    for (int i=0; i<m; i++) {
	int u,v; cin>>u>>v;--u;--v;
	g[u].push_back({i,v});
	g[v].push_back({i,u});
    }

    for (int i=0; i<n; i++) {
	bool ok = false;
	for (auto ed: g[i]) {
	    int to = ed.second;
	    if (a[to] <= a[i]) {
		ok = true;
		break;
	    }
	}
	if (!ok) out(-1);
    }

    for (auto node: nodes) {
	int at = node.second;
	bool done = false;
	for (auto ed: g[at]) {
	    int id = ed.first;
	    int to = ed.second;
	    if (act[to]) {
		if (a[at] == a[to]) {
		    if (color[to] == -1) {
			color[at] = 0;
			color[to] = 1;
		    } else if (color[at] == -1) {
			color[at] = 1-color[to];
		    }
		    edges[id] = a[at];
		    done = true;
		}
	    }
	}

	if (done) {
	    for (auto ed: g[at]) {
		int to = ed.second;
		int id = ed.first;
		if (act[to] && a[to] < a[at]) {
		    edges[id] = inf;
		}
	    }
	} else {
	    for (auto ed: g[at]) {
		int to = ed.second;
		int id = ed.first;
		if (act[to]) {
		    assert(a[to] < a[at]);
		    if (color[at] == -1) {
			color[at] = color[to];
			edges[id] = a[at] - a[to];
		    } else {
			edges[id] = inf;
		    }
		}
	    }
	    
	}
	
	act[at]=true;
    }

    for (int i=0; i<n; i++) {
	cout<<(color[i]?'B':'W');
    }
    cout<<endl;
    for (int i=0; i<m; i++) {
	cout<<edges[i]<<"\n";
    }
    
    
    return 0;
}


Measured memory_bytes: 40308
#include<iostream>
#include<cstdio>
using namespace std;
int a[100005];
int main()
{
    int n,x;


    scanf("%d%d",&n,&x);
     long long sum=0;
          for(int i=1;i<=n;i++)
            scanf("%d",&a[i]);
        for(int i=1;i<=n;i++)
        {
            if(a[i]+a[i+1]<=x) continue;
            else
            {
              sum+=(a[i]+a[i+1]-x);
              int c=x-a[i];
              if(c<=0) a[i+1]=0;
                else a[i+1]=x-a[i];
            }


        }
    printf("%lld\n",sum);


    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int i = sc.nextInt();
		sc.close();

		int plus = 1;
		System.out.print(n - i + plus);
	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")

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

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main() {
    int A, B;
    cin >> A >> B;
    if (A-B*2 < 0) {
        cout << 0 << endl;
    } else {
        cout << A-B*2 << endl;
    }
    return 0;
}


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

using namespace std;

int main() {
	string s;
	cin >> s;
	int l = s.length();
	int z = 0, o = 0;
	for (int i = 0; i < l; i++) {
		if (s[i] == '0') {
			z++;
		} else {
			o++;
		}
	}
	cout << min(z, o) * 2 << endl;
}

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

using namespace std;

vector<long>ff(100000,-1);

int calc(long n){
    if(n==0){
        return 0;
    }else{
        if(n < 100000 && ff[n] != -1){
            return ff[n];
        }
        int c = 0;
        for(int bit=1;bit<=n;bit*=2){
            if(n & bit)c++;
        }
        if(n%c==0)return 1;
        else return ff[n] = 1+calc(n%c);
    }
}


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

    // for(int i=0;i<n;i++){
    //     char c = '0' + i%2;
    //     x += c;
    // }


    long pop = 0;
    for(int i=0;i<n;i++){
        if(x[i]=='1')pop++;
    }
    long modm1[n];
    long mod[n];
    long modp1[n];
    
    long tmp = 1;
    long tmpp = 1;
    long tmpm = 1;
    
    for(int i=0;i<n;i++){
        modm1[i] = tmpm;
        modp1[i] = tmpp;

        if(pop>1)tmpm = (tmpm*2)%(pop-1);
        else if(pop==1)tmpm = 0;
        tmpp = (tmpp*2)%(pop+1);
    }

    long m = 0;
    long p = 0;
    for(int i=n-1;i>=0;i--){
        if(x[i]=='1'){
            m += modm1[n-1-i];
            p += modp1[n-1-i];
            
            if(pop > 1)m %= (pop-1);
            else if(pop == 1)m = 0;
            p %= (pop+1);
        }
    }

    vector<long>ans(n);
    
    for(int i=0;i<n;i++){
        long popp = pop;
        long xx = 0;
        if(x[i] == '0'){
            popp++;
            xx = p + modp1[n-1-i];
        }else{
            popp--;
            xx = m - modm1[n-1-i];
            while(popp != 0 && xx < 0){
                xx += 1000000*popp;
            }
        }

        if(popp == 0){
            ans[i] = 0;
            continue;
        }else if(popp == 1){
            ans[i] = 1;
            continue;
        }else{
            ans[i] = 1 + calc(xx%popp);
        }

        
    }

    
    
    for(int i=0;i<n;i++){
        cout << ans[i]<<endl;
    }
    
}

Measured memory_bytes: 9140
// 1915
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
#define int long long
#define MOD 1000000007
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 1e18
#define For(i,a,b) for (int i = a; i < b; i++)
#define Rep(i,a,b) for (int i = a; i <= b; i++)
#define ps(x,y) fixed << setprecision(y) << x 
#define pb push_back 
#define mp make_pair 
 
int32_t main()
{
    fast;
    int x, val; cin >> x;
    val = sqrt(2 * x);
    ++val;
    Rep(i, 1, val) {
        int res = (i * (i+1) / 2);
        if(res >= x) {
            cout << i;
            return 0;
        }
    }

    
    
    
    return 0;
}

Measured memory_bytes: 3700
C = [list(map(int, input().split())) for i in range(3)]

for i in range(2):
    if C[i+1][0]-C[0][0] == C[i+1][1]-C[0][1] == C[i+1][2]-C[0][2]:
        continue
    else:
        print('No')
        exit()

for j in range(2):
    if C[0][j+1]-C[0][j] == C[1][j+1]-C[1][j] == C[2][j+1]-C[2][j]:
        continue
    else:
        print('No')
        exit()

print('Yes')

Measured memory_bytes: 3064
N = int(input())
table = []
for _ in range(N):
    x, y, h = map(int, input().split())
    table.append((x, y, h))

def f(Cx,Cy,x,y,H):
    return max(H-abs(x-Cx)-abs(y-Cy),0)

for Cx in range(101):
    for Cy in range(101):
        H = 0
        flag = 1
        for i in range(N):
            x, y, h = table[i]
            if h > 0:
                H = h + abs(x-Cx) + abs(y-Cy)
                break
        for i in range(N):
            x, y, h = table[i]
            if f(Cx,Cy,x,y,H) != h:
                flag = 0
                break

        if flag:
            print(Cx,Cy,H)
            exit()


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

int main(){
	string a,b;
	cin>>a>>b;
	if(a.size()>b.size()){
		cout<<"GREATER"<<endl;
		return 0;
	}
	if(a.size()<b.size()){
		cout<<"LESS"<<endl;
		return 0;
	}
	for(int i = 0;i<a.size();i++){
		if(a[i]-'0'>b[i]-'0'){
			cout<<"GREATER"<<endl;
			return 0;
		}
		if(a[i]-'0'<b[i]-'0'){
			cout<<"LESS"<<endl;
			return 0;
		}
	}
	cout<<"EQUAL"<<endl;
	
	
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const int N=1000100;
inline int read(){
	int x=0,f=0,c=getchar();
	for(;c>'9'||c<'0';f=c=='-',c=getchar());
	for(;c>='0'&&c<='9';c=getchar())
	x=(x<<1)+(x<<3)+c-'0';return f?-x:x;
}
inline void write(ll x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);putchar(x%10+'0');
}
ll K;
ll n,i,k,m,x[N],y[N],a[N],b[N];
void mul(ll*c,ll*A,ll*B){
	static int a[N],b[N],i;
	for(i=1;i<=n;i++)a[i]=A[i],b[i]=B[i];
	for(i=1;i<=n;i++)c[i]=a[b[i]];
}
int main(){
	//freopen("1.out","w",stdout);
	n=read();
	for(i=1;i<=n;i++)x[i]=read();
	for(i=n;i;i--)x[i]=x[i]-x[i-1];
	for(i=1;i<=n;i++)a[i]=b[i]=i;
	m=read();scanf("%lld",&K);
	//printf("%lld\n",K);
	for(i=1;i<=m;i++)
		k=read(),swap(b[k],b[k+1]);
	for(;K;K>>=1,mul(b,b,b))
	if(K&1)mul(a,a,b);
	for(i=1;i<=n;i++)y[i]=y[i-1]+x[a[i]],printf("%lld.0\n",y[i]);;
	return 0;
}

Measured memory_bytes: 16512
#include <stdio.h>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

char st1[200];
char st2[200];


int main()
{
    int n;scanf("%d",&n);
    scanf("%s",st1);
    scanf("%s",st2);

    for (int i=0;i<n;++i)
        printf("%c%c",st1[i],st2[i]);

}


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

int main() {
    int n;
    cin >> n;
    vector<vector<int>> cnt(10,vector<int>(10));
    for(int num = 1; num <= n; num++){
        string nums = to_string(num);
        cnt[nums[0]-'0'][nums[nums.size()-1]-'0']++;
    }
    ll ans = 0;
    for(int i=0; i<=9; i++){
        for(int j=0; j<=9; j++){
            ans += cnt[i][j]*cnt[j][i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3676
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define debug cout << "hi" << endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<long long ,long long>pll;

ll gcd(ll a, ll b) {return (!b ? a : gcd(b, a % b));}
ll lcm(ll a, ll b) {return ((a*b)/gcd(a,b));}
bool cmp(int a,int b){return a>b;}

const ll mod = 1e9 + 7;
const ll MOD = 998244353;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;
const ld pi = 3.141592653589793;

 long long modpow(long long n, long long k,long long mod)
{
if (k == 0) return 1;
long long r = modpow(n * n % mod, k >> 1, mod);
if (k & 1) r = r * n % mod;
return r;
}
vector<vector<int>>adj(1e5+10);
vector<bool>b(1e5+10,0);
void dfs(int v){
   b[v] = 1;
   for(int i = 0;i<adj[v].size();i++){
    int vi = adj[v][i];
    if(!b[vi]) dfs(vi);
   }
}
void solve(){
    int n,m;cin >> n >> m;
    int ans = -1;
    for(int i = 0;i<m;i++){
        int v,u;cin >> v >> u;
        v--;u--;
        adj[v].push_back(u);
        adj[u].push_back(v);
    }
    for(int i = 0;i<n;i++){
        if(!b[i]){
            dfs(i);
            ans++;
        }
    }
    cout << ans;
}

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

Measured memory_bytes: 9516
#include <algorithm>
#include <iostream>

using namespace std;

int main()
{
  int k, n; cin >> k >> n;
  int a[200000]; for (int i = 0; i < n; ++i) cin >> a[i];
  int dif[200000]; for (int i = 0; i < n-1; ++i) dif[i] = a[i+1]-a[i];
  dif[n-1] = a[0] - a[n-1] + k;
  int mx = 0; for (int i = 0; i < n; ++i) mx = max(mx, dif[i]);
  cout << k - mx << endl;
  return 0;
}

Measured memory_bytes: 1792
weights = [512, 256, 128, 64, 32, 16, 8, 4, 2, 1]

$<.each_line do |line|
  g = line.to_i
  a = []
  weights.each{|weight|
    if weight <= g
      a.push weight
      g -= weight
    end
  }
  puts a.sort.join(" ")
end

Measured memory_bytes: 8664
#include<iostream>
using namespace std;
int main(){
int f,e;
char o;
while(cin>>f>>o>>e){
if(o=='?')return 0;
if(o=='+'){
cout<<f+e<<endl;
}
else if(o=='-'){
cout<<f-e<<endl;
}
else if(o=='*'){
cout<<f*e<<endl;
}
else if(o=='/'){
cout<<f/e<<endl;
}
}
return 0;
}


Measured memory_bytes: 3096
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <numeric>
#include <string>

using namespace std;

typedef long long ll;
const int INF = 1001001001;

int main(){
    int X, Y, Z, K;
    cin >> X >> Y >> Z >> K;
    vector<ll> A(X), B(Y), C(Z);
    for(int i = 0; i < X; ++i){
        cin >> A[i];
    }
    for(int i = 0; i < Y; ++i){
        cin >> B[i];
    }
    for(int i = 0; i < Z; ++i){
        cin >> C[i];
    }
    sort(C.begin(), C.end(), greater<ll>());
    
    vector<ll> AB;
    for(int i = 0; i < X; ++i){
        for(int j = 0; j < Y; ++j){
            AB.push_back(A[i] + B[j]);
        }
    }
    sort(AB.begin(), AB.end(), greater<ll>());
    
    vector<ll> ABC;
    for(int i = 0; i < min(K, X * Y); ++i){
        for(int j = 0; j < Z; ++j){
            ABC.push_back(AB[i] + C[j]);
        }
    }
    sort(ABC.begin(), ABC.end(), greater<ll>());
    
    for(int i = 0; i < K; ++i){
        cout << ABC[i] << endl;
    }
}

Measured memory_bytes: 43112
import std.stdio;
import std.string;
import std.conv;

struct BloodData {
    int number;
    string bloodGroup;
}



void main() {
    string[] input = new string[](2);
    BloodData[] list;
    int[] count = [0, 0, 0, 0];

    while ((input = readln.chomp.split(",")).length != 0) {
        BloodData temp = {number:input[0].to!int, bloodGroup:input[1]};
        list ~= temp;
    }

    foreach (data; list) {
        if (data.bloodGroup == "A") {
            count[0]++;
        } else if (data.bloodGroup == "B") {
            count[1]++;
        } else if (data.bloodGroup == "AB") {
            count[2]++;
        } else if (data.bloodGroup == "O") {
            count[3]++;
        }
    }

    foreach (num; count) {
        writeln(num);
    }
}

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

int main() {
	int n;
	cin >> n;
	vector<int> v(n), c(n);
	for (int i = 0; i < n; i++) cin >> v[i];
	for (int i = 0; i < n; i++) cin >> c[i];
	int ans = 0;
	for (int i = 0; i < n; i++) {
		ans += max(0, v[i] - c[i]);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll = long long;
 
int main(){
  ll n; cin >> n;
  vector<ll> s(0);
  while(n > 0){
    s.push_back(n % 10);
    n /= 10;
  }
  
  ll sum = 0;
  for(int bit = 0; bit < (1<<s.size()-1); bit++){  
    ll res = s[0];
    ll k = 1;
    for(int i = 0; i < s.size()-1; i++){
      if(bit & (1<<i)){
        sum += res; res = s[i+1];
        k = 1;
        }
      else{
        res += pow(10LL, k) * s[i+1];
        k++;
      }
    }
    sum += res;
    
    //cout << sum << endl;
  } 
  //sum += s[s.size()-1] * pow(2, s.size()-1);
  cout << sum << endl;
}
    


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int in = scanner.nextInt();

        int h = in / (60 * 60);
        int m = Math.max(0, in - h * 60 * 60) / 60;
        int s = Math.max(0, in - h * 60 * 60 - m * 60);

        System.out.println(h + ":" + m + ":" + s);
    }
}


Measured memory_bytes: 26320
import sys
readline = sys.stdin.readline

N = int(readline())
rest = [None] * N
for i in range(N):
  s,p = readline().split()
  rest[i] = [s,int(p),i + 1]
  
rest = sorted(rest, key = lambda x:(x[0],-x[1]))
for r in rest:
  print(r[2])


Measured memory_bytes: 9116
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    if S[2] != S[3]:
        return 'No'

    if S[4] != S[5]:
        return 'No'
    return 'Yes'


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()


Measured memory_bytes: 7748
x_max, y_max, n = gets.chomp.split(' ').map(&:to_i)
points = n.times.map{gets.split(' ').map(&:to_i)}
x_min = 0
y_min = 0
(0...n).each do |i|
  if points[i][2] == 1
    x_min = points[i][0] if x_min < points[i][0]
  elsif points[i][2] == 2
    x_max = points[i][0] if x_max > points[i][0]
  elsif points[i][2] == 3
    y_min = points[i][1] if y_min < points[i][1]
  elsif points[i][2] == 4
    y_max = points[i][1] if y_max > points[i][1]
  end
end

if (x_max - x_min) < 0 || (y_max - y_min) < 0
  puts 0
else
  puts (x_max - x_min) * (y_max - y_min)
end

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

int main() {
  string s; cin>>s;
  int n=s.size();
  vector<int> v(n,0);

    int i=0,x;
    while(i<n){
      int c=0;
      while(s[i]=='R'){c++;i++;}
      int x=c; int y=i;
      while(s[i]=='L'){c++;i++;}
      
      if(x%2==0){v[y-1]=c/2;}
      else{v[y-1]=(c+1)/2;}
      v[y]=c-v[y-1];
    }
  rep(i,n){cout<<v[i]<<" ";}

}


Measured memory_bytes: 3816
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <functional>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int n, x, t;

signed main() {
	std::random_device rnd;
	std::mt19937_64 mt(rnd());
	cin >> n >> x >> t;
	cout << (n + x - 1) / x * t << endl;
}

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] h = new int[n];
		long ans = 0;
		for (int i = 0; i < n; i++){
			h[i] = sc.nextInt();
		}
		Arrays.sort(h);
		for (int i = 0; i < n-k; i++) {
			ans += h[i];
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 65380
n,l=map(int,input().split())
y=l
k=[]
m=100000
for i in range(n):
    k.append(y)
    y+=1
for i in range(n):
    if abs(k[i])<abs(m):
        m=k[i]
k.pop(k.index(m))
print(sum(k))

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

int main(){
  int n, a, d;
  int ans = 100;
  cin >> n;
  rep(i, n) {
    d = 0;
    cin >> a;
    while (a % 2 == 0) {
      a /= 2;
      d++;
    }
    if (d < ans) ans = d;
  }
  cout << ans << endl;
}


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

signed main()
{
    int A, B;
    cin >> A >> B;
    for(int C = 1; C <= 3; ++C) {
        if((A * B * C) % 2 == 1) {
            printf("Yes\n");
            return 0;
        }
    }
    printf("No\n");
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>

int main(void) {
    int sum = 0, digit;
    int len, i;
    char str[81];
    
    while(scanf("%s", str) != EOF) {
        int count_num = 0;
        len = (int)strlen(str);
        
        for(i = len - 1; i >= 0; i--) {
            if(isdigit(str[i])) {
                digit = pow(10, count_num);
                count_num++;
                sum += ((str[i] - '0') * digit);
            } else {
                count_num = 0;
            }
        }
    }
    
    printf("%d\n", sum);
    
    return(0);
}

Measured memory_bytes: 580
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		SC sc = new SC(System.in);
		int N=sc.nextInt();
		int C=sc.nextInt();
		int[] channels=new int[200003];
		Arrays.fill(channels, 0);
		int[] channel=new int[31];
		channel[0]=1;
		for(int i=1; i<31; i++) {
			channel[i]=channel[i-1]*2;
		}
		for(int i=0; i<N; i++) {
			int from=sc.nextInt()*2-1;
			int to=sc.nextInt()*2;
			int ch=sc.nextInt()-1;
			channels[from]+=channel[ch];
			channels[to]+=(-channel[ch]);
			//pl(from+" "+to+" "+ch);
		}
		for(int i=1; i<200003; i++) {
			channels[i]=channels[i]+channels[i-1];
		}
		int honsu=0;
		for(int i=0; i<200003; i++) {
			honsu=Math.max(honsu,pop(channels[i]));
		}
		pl(honsu);
		/*for(int i=0; i<40; i++) {
			pl(channels[i]);
		}*/
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	public static int pop(int a) {
		int ans=0;
		for(int i=0; i<32; i++) {
			if(a%2==1) {
				ans++;
			}
			a/=2;
		}
		return ans;
	}
}

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

int main(){
    int a,b,c,x1,x2,y1,y2,z1,z2;
    cin >> a >> b >> c;

    x1 = (a >= b)? a:b;
    x2 = (a < b)? a:b;
    y1 = (x1 >= c)? x1:c;
    y2 = (x1 < c)? x1:c;
    z1 = (x2 >= y2)? x2:y2;
    z2 = (x2 < y2)? x2:y2;

    cout << z2 << " " << z1;
    cout << " " << y1 << endl;

    return 0;
}
 

Measured memory_bytes: 3072