akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    int n, a, b, c, d;
    string s;
    cin >> n >> a >> b >> c >> d >> s;
    a--; b--; c--; d--;
    if(c > d){
        REP(i, a, c){
            if(s[i] == '#' && s[i+1] == '#'){
                cout << "No" << endl;
                return 0;
            }
        }
        REP(i, b-1, d){
            if(s[i] == '.' && s[i+1] == '.' && s[i+2] == '.'){
                cout << "Yes" << endl;
                return 0;
            }
        }
        cout << "No" << endl;
        return 0;
    }else{
        REP(i, a, d){
            if(s[i] == '#' && s[i+1] == '#'){
                cout << "No" << endl;
                return 0;
            }
        }
        cout << "Yes" << endl;
        return 0;
    }
}

Measured memory_bytes: 640
s = input()

ret = float('inf')
for c in set(s) :
  tmp = 0
  t = s[::]
  u = ''
  while t.count(c) != len(t) :
    tmp += 1
    for i in range(len(t) - 1) :
      if t[i] == c or t[i+1] == c :
        u += c
      else :
        u += t[i]
    t = u[::]
    u = ''
  ret = min(ret, tmp)
  
print(ret)

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

int main(){
  int a,b;
  cin >> a >> b;
  
  int ans = -1;
  
  for(int i = 1; i <= 1000; i++){
    if(i*8/100 == a && i*10/100 == b){
      ans = i;
      break;
    }
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

#define MAX 36

struct Card
{
	char suit;
	char value;
};

void PrintArray(const Card* pArray, int size);
void BubbleSort(Card* pArray, int size);
void SlectionSort(Card* pArray, int size);
bool IsStable(const Card* pBubbleArray1, const Card* pSelectionArray2, int size);

int main()
{
	int n;
	Card Array1[MAX], Array2[MAX];
	cin >> n;
	for (int i = 0; i < n; ++i) cin >> Array1[i].suit >> Array1[i].value;
	//memcpy(Array2, Array1, sizeof(Card) * n);
	for (int i = 0; i < n; ++i) Array2[i] = Array1[i];

	BubbleSort(Array1, n);
	cout << "Stable" << endl;
	SlectionSort(Array2, n);
	bool bIsStable = IsStable(Array1, Array2, n);
	cout << (bIsStable ? "Stable" : "Not stable") << endl;

	return 0;
}

void PrintArray(const Card* pArray, int size)
{
	for (int i = 0; i < size; ++i)
		cout << pArray[i].suit << pArray[i].value << ((i != size - 1) ? " " : "\n");
}

void BubbleSort(Card* pArray, int size)
{
	for (int i = 0; i < size; ++i)
	{
		for (int j = size - 1; j > i; --j)
		{
			if (pArray[j].value < pArray[j - 1].value)
			{
				Card pTemp = pArray[j];
				pArray[j] = pArray[j - 1];
				pArray[j - 1] = pTemp;
			}
		}
	}

	PrintArray(pArray, size);
}

void SlectionSort(Card* pArray, int size)
{
	for (int i = 0; i < size - 1; ++i)
	{
		int minIndex = i;
		for (int j = i + 1; j < size; ++j)
		{
			if (pArray[j].value < pArray[minIndex].value)
				minIndex = j;
		}
		if (i != minIndex)
		{
			Card pTemp = pArray[i];
			pArray[i] = pArray[minIndex];
			pArray[minIndex] = pTemp;
		}
	}

	PrintArray(pArray, size);
}

bool IsStable(const Card* pBubbleArray1, const Card* pSelectionArray2, int size)
{
	bool bIsStable = true;
	for (int i = 0; i < size; ++i)
	{
		if (pBubbleArray1[i].value != pSelectionArray2[i].value
			|| pBubbleArray1[i].suit != pSelectionArray2[i].suit)
		{
			bIsStable = false;
			break;
		}
	}

	return bIsStable;
}


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

vector<int> L;

struct Vertex{
	int left;
	int right;
};

void Postorder(vector<Vertex> &T,int root){
	if(T[root].left!=-1) Postorder(T,T[root].left);
	if(T[root].right!=-1) Postorder(T,T[root].right);
	L.push_back(root+1);
	return;
}

void Reconstruction(vector<Vertex> &T, vector<int> &Pre,vector<int> &In,int p,int q,int s,int t){
	int root = Pre[p];
	if(p==q){
		T[root].left=-1;
		T[root].right=-1;
		return ;
	}
	
	vector<bool> check(1000000,false);
	
	//k???In????????????root?????????????????????
	int k=-1;
	for(int i=s;i<t+1;i++){
		check[In[i]]=true;
		if (In[i]==root){
			k=i;
			break;
		}
	}

	//l???Pre?????????????????´?????¨???????????????????????????????????????
	int l=p;
	while(l<q){
		l++;
		if(check[Pre[l]]==false){
			l--;
			break;
		}
		if(l==q) break;
	}
	
	if(s==k){
		T[root].left=-1;
		T[root].right=Pre[l+1];
	
		Reconstruction(T,Pre,In,l+1,q,k+1,t);
	}else if(t==k){
		T[root].left=Pre[p+1];
		T[root].right=-1;
	
		Reconstruction(T,Pre,In,p+1,l,s,k-1);
	}else{
		T[root].left=Pre[p+1];
		T[root].right=Pre[l+1];
	
		Reconstruction(T,Pre,In,p+1,l,s,k-1);
		Reconstruction(T,Pre,In,l+1,q,k+1,t);
	}
}

int main(){
	int n,x;
	cin >> n;
	vector<int> Pre(n);
	vector<int> In(n);
	for (int i=0;i<n;i++){
		cin >> x;
		Pre[i]=x-1;
	}
	
	for (int i=0;i<n;i++){
		cin >> x;
		In[i]=x-1;
	}
	
	vector<Vertex> T(n);
	Reconstruction(T,Pre,In,0,n-1,0,n-1);
	Postorder(T,Pre[0]);
	
	for (int i=0;i<L.size();i++){
		if(i==L.size()-1){
			cout << L[i] <<endl;
		}else{
			cout << L[i] <<" ";
		}
	}
	return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  int a, b; cin >> a >> b;
  if(b % a==0) cout << a+b << endl;
  else cout << b-a << endl;

  return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())
A = list(map(int, input().split()))

cnt_yes = 0
for i in range(M):
    A.sort(reverse=True)
    # print(A[i], sum(A) / (4*M))
    if A[i] >= (sum(A) / (4*M)):
        cnt_yes += 1
        
if cnt_yes < M:
    print("No")
else:
    print("Yes")

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

using namespace std;

int main() {
  int N, M = 500, K; cin >> K;
  N = min(M, K);
  cout << N << endl;;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      int num = (i + j) % N;
      if ((K > M) && (num < K-M) && !(i & 1)) num += M;
      cout << num + 1 << " \n"[j==N-1];
    }
  }
  return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define ld long double
#define endl "\n"
using namespace std;

int32_t main() {
  int n,d;
  cin>>n>>d;
  int x,y,ans = 0;
  int lim = d*d;
  for(int i = 0;i < n;i++) {
    cin>>x>>y;
    if((x*x+y*y) <= lim) {
      ans++;
    }
  }
  cout<<ans;
  cout<<endl;
  return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
//#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx")
//#include<bits/extc++.h>
//using namespace __gnu_pbds;
using namespace std;
#define F(i,L,R) for (int i = L; i < R; i++)
#define FE(i,L,R) for (int i = L; i <= R; i++)
#define getI(a) scanf("%d", &a)
#define getII(a,b) scanf("%d%d", &a, &b)
#define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c)
#define VgetI(n) int (n); scanf("%d",&(n))
#define VgetII(n,m) int (n),(m); scanf("%d %d",&(n),&(m))
#define VgetIII(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k))
#define debug(x) cout<<(#x)<<"="<<x<<"\n";
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define f first
#define s second
#define ll long long
#define INF 2000000000
int a[200005];
int main(){
        int n;
        while(~getI(n)){
                F(i,0,n) getI(a[i]);
                sort(a,a+n);
                bool flag=1;
                F(i,1,n) if(a[i]==a[i-1]) flag=0;
                printf("%s\n",flag==1?"YES":"NO");
        }
}

Measured memory_bytes: 1024
#include<cstdio>
#include<cmath>
#include<math.h> 
#include<cstring>
#include<iostream>
#include<algorithm>
#define pi acos(-1);
using namespace std;
typedef long long ll;
double t, tang, pans, ans;
int a, b, x, v;
int main()
{
	cin >> a >> b >> x;
	v = a * a * b;
	if (x >= v / 2)
	{
		t = (double)(2 * v - 2 * x) / (a * a);
		tang = (double)t / a;
		pans = atan(tang);
		ans = (double)pans * 180 / pi;
	}
	else if (x < v / 2)
	{
		t = (double)2 * x / (a * b);
		tang = (double)b / t;
		pans = atan(tang);
		ans = (double)pans * 180 / pi;
	}
	printf("%.7f\n", ans);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstring>
#include <vector>
#include <tuple>
#include <string>
#include <algorithm>

 
using namespace std;

typedef long long ll;
typedef long double ld;
#define L(ID) ((ID*2)+1)
#define R(ID) ((ID*2)+2)
#define M(L,R) ((L+R)/2)
#define forr(start,end) for(int i = start; i < end; i++)
#define gap ' '
 
const int MAXN = 2 * 1e5 + 5;
int n, a[MAXN];

ll largest(ll a, ll b){
	return (a<b)?b:a;
}
ll smallest(ll a, ll b){
	if(a < b)return a;
	return b;
}
struct triple
{
	int x,y,z;
};

int main(){
	int a,b;
	cin >> a >> b;
	cout << a * b << endl;


    return 0;
}

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

void solve(){
  int n;
  cin >> n;
  vector<ll> an(n);
  for(int i=0; i<n; ++i) cin >> an[i];
  string s;
  cin >> s;
  vector<ll> bases;
  for(int i=n-1; i>=0; --i){
    ll x = an[i];
    for(ll base: bases){
      x = min(x, x^base);
    }
    if(s[i] == '0') bases.push_back(x);
    else if(x){
        cout << 1 << endl;
        return;
    }
  }
  cout << 0 << endl;
  return;
}

int main(){
  int t;
  cin >> t;
  for(int i=0; i<t; ++i) solve();
}

Measured memory_bytes: 3524
#include <cstdio>
#include <algorithm>
using namespace std;
using ll = long long int;

const int S = 200010;
ll x[S], s[S], dp[S];
int main() {
    ll N, ans; scanf("%lld", &N);
    for(int i=0; i<N; i++) {
        scanf("%lld%lld", &x[i], &s[i]);
    }

    ans = dp[0] = s[0];
    for(int i=1; i<N; i++) {
        dp[i] = max(s[i], dp[i-1] + s[i] - (x[i] - x[i-1]));
        ans = max(ans, dp[i]);
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 4864
import java.util.Arrays;
import java.util.Scanner;
public class Main{
  public static void main(String[] arsgs){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    int[] snake = new int[n];
    int result = 0;
    for(int i = 0; i < n; i++){
      snake[i] = Integer.parseInt(sc.next());
    }
    Arrays.sort(snake);
    
    while(k > 0){
      result += snake[n-1];
      k--;
      n--;
    }
    System.out.println(result);
  }
}

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

using namespace std;


void solve() {
    int m, k;
    cin >> m >> k;
    if (k >= 1<<m || (k == 1 && m == 1)) {
        cout << "-1";
        return;
    }
    if (k == 0 && m == 1) {
        cout << "0 0 1 1";
        return;
    }
    for (int i = (1<<m)-1; i >= 0; i--) {
        if (i != k) {
            cout << i << ' ';
        }
    }
    cout << k << ' ';
    for (int i = 0; i < 1<<m; i++) {
        if (i != k) {
            cout << i << ' ';
        }
    }
    cout << k;
}

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


Measured memory_bytes: 1792
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	k := getNextInt(scanner)
	sum := 0

	aa := make([]int, n)
	mm := make([]int, n)
	for i := 0; i < n; i++ {
		aa[i] = getNextInt(scanner)
		sum += aa[i]
	}

	max := 0
	for i := 1; i*i <= sum; i++ {
		if sum%i != 0 {
			continue
		}
		c := count(i, n, aa, mm)
		if k >= c && max < i {
			max = i
		}
		ii := sum / i
		c = count(ii, n, aa, mm)
		if k >= c && max < ii {
			max = ii
		}
	}

	fmt.Fprintln(writer, max)

	writer.Flush()
}

func count(i, n int, aa, mm []int) int {
	for ii := 0; ii < n; ii++ {
		mm[ii] = aa[ii] % i
	}
	sort.Ints(mm)
	for ii := 0; ii < n-1; ii++ {
		mm[ii+1] += mm[ii]
	}

	ans := mm[n-1-mm[n-1]/i]
	return ans
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int Digit_Sum(int n) {
	int Cmp = 0;
	while (n) {
		Cmp += n % 10;
		n /= 10;
	}
	return Cmp;
}
double Value(int n) {
	return (double)n / Digit_Sum(n);
}
int Digit(int n) {
	int Cmp = 0;
	while (n) {
		n /= 10;
		Cmp++;
	}
	return Cmp;
}
signed main() {
	int k, Cnt = 0;
	double Max = -1, Min = INF;
	cin >> k;
	// double KVal = (double)k / Digit_Sum(k);
	// for (int i = 9; i < 20000; i += 10) {
	// 	cout << i << " " << Value(i) << endl;
	// 	Max = max(Max, Value(i));
	// 	Min = min(Min, Value(i));
	// }
	// cout << endl << Max << " " << Min << endl;
	if (k <= 9) {
		for (int i = 1; i <= k; i++) {
			cout << i << endl;
		}
		return 0;
	}
	int Ans = 1, Cmp = 1;
	for (int i = 0; i < k; i++) {
		cout << Ans << endl;
		while (Value(Ans + Cmp) > Value(Ans + 2 * Cmp)) Cmp *= 10;
		Ans += Cmp;
	}
	return 0;
}

Measured memory_bytes: 256
import sys, math
from collections import defaultdict
from fractions import gcd
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7

def main():
    n = int(input())
    dic = defaultdict(int)
    dic1 = defaultdict(int)
    for _ in range(n):
        a,b = map(int,input().split())
        if a != 0 and b == 0:
            a = 1
        elif a == 0 and b != 0:
            b = 1
        else:
            if not (a==0 and b==0):
                m = gcd(a,b)
                a //= m
                b //= m
        if a < 0 and b < 0:
            a = -a
            b = -b
        if a < 0 and b > 0:
            a = -a
            b = -b
        index = ' '.join([str(a),str(b)])
        dic[index] += 1
        dic1[index] += 1
    ans = 1
    dic2 = defaultdict(int)
    for e in dic:
        a,b = map(int,e.split())
        if a == 0 and b == 0:
            continue
        flag = 0
        if a == 0 and b == 1:
            rev = ' '.join([str(1),str(0)])
        elif a == 1 and b == 0:
            rev = ' '.join([str(0),str(1)])
        elif a > 0 and b > 0:
            rev = ' '.join([str(b),str(-a)])
        else:
            rev = ' '.join([str(-b),str(a)])
        if dic1[rev] > 0 and dic2[rev] == 0:
            dic2[rev] = 1
            dic2[e] = 1
            flag = 1
        if flag:
            continue
        n1 = pow(2,dic[e],mod)
        n2 = pow(2,dic1[rev],mod)
        ans *= (n1+n2-1)
        ans %= mod
    print((ans-1+dic['0 0'])%mod)
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 84792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, n) for(int i = 1; i <= (int)(n); i++)
const long long INF = 1LL << 60;
const double PI=3.14159265358979323846;
int main() 
{
    int n;
    cin >> n;

    struct xy {int x,y;};
    struct xy a[n+10];

    rep(i,n){
        cin >> a[i].x >> a[i].y;
    }

    double sum=0;
    rep(i,n){
        for(int j=0;j<n;j++){
            sum += sqrt((a[i].x-a[j].x)*(a[i].x-a[j].x) + (a[i].y-a[j].y)*(a[i].y-a[j].y));
        }
    }

    int i=1,factn=1;
    while(i!=n+1){
        factn *= i;
        i++;
    }

    cout << setprecision(10) << sum/n << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll

const int md = 1000000007;
const int INF = 1<<30;

class UnionFind{
private:
    vi par,rank;
public:
    explicit UnionFind(int n){
        par.resize(n);
        rank.resize(n);
        rep(i,n) par[i] = i;
    }

    int root(int x){
        return x == par[x] ? x : par[x] = root(par[x]);
    }

    void unite(int x, int y){
        x = root(x);
        y = root(y);

        if(x == y) return;
        if(rank[x] > rank[y]) swap(x,y);

        par[x] = y;
        if(rank[x] == rank[y]) rank[x]++;
    }

    bool same(int x, int y){
        return root(x) == root(y);
    }
};

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

    int q; cin >> q;

    rep(i,q){
        int c; cin >> c;
        int x,y; cin >> x >> y;
        if(c == 0){
            u.unite(x,y);
        }else{
            cout << u.same(x,y) << endl;
        }
    }
}



Measured memory_bytes: 3232
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace B
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var s = Console.ReadLine();
            var t = Console.ReadLine();
            var answer = 0;
            for (var i = 0; i < s.Length; i++)
            {
                if (s[i] != t[i]) answer++;
            }
            Console.WriteLine(answer);
        }
    }
}


Measured memory_bytes: 27428
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Apolloliu
 */
 
#include <iostream>
#include <fstream>
 
#include <bits/stdc++.h>
 
using namespace std;
 
#define MEM(a,b)    memset(a, b, sizeof(a))
#define UN(a)       sort(all(a)), a.erase(unique(all(a)), a.end())
#define REV(a)      reverse(all(a))
#define MP(a, b)    make_pair(a, b)
#define PAIR(a, b)  pair<int, int>(a, b)
 
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, int> pii;
 
const int MOD = 1e9 + 7;
const int maxn = 123456;
const double EPS = 1e-8;
const ll inf = 1e18;
 
ll a[maxn], b[maxn];
class DFlippingSigns {
public:
    void solve(std::istream& in, std::ostream& out) {
        int N;
        in>>N;
        ll res = -inf, sum = 0;
        for(int i = 0; i < N; ++i)in>>a[i], sum += a[i], b[i] = a[i];
        res = max(res, sum);
        sort(a, a+N);
        for(int i = 1; i < N; i += 2){
            if(sum - 2*a[i] - a[i-1]*2 >= sum){
               //a[i] = -a[i];
               //a[i-1] = -a[i-1];
                sum -= (2*a[i] + 2*a[i-1]);
            }
            res = max(res, sum); 
        }
        out<<res<<endl;
    }
};
 
 
int main() {
    // freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    DFlippingSigns solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}

Measured memory_bytes: 1792
unittest
{
	assert( [ "20 2 5" ].parse.expand.solve == 84 );
	assert( [ "10 1 2" ].parse.expand.solve == 13 );
	assert( [ "100 4 16" ].parse.expand.solve == 4554 );
}



import std.conv;
import std.functional;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nab = input.front.split.to!( long[] );
	return tuple( nab[ 0 ], nab[ 1 ], nab[ 2 ] );
}

auto solve( long n, long a, long b )
{
	auto t = 0L;
	
	foreach( i; 1 .. n + 1 )
	{
		auto s = memoize!sumDigits( i );
		if( a <= s && s <= b )
		{
			t += i;
		}
	}
	
	return t;
}

long sumDigits( long i )
{
	if( i < 10 ) return i;
	else         return i % 10 + memoize!sumDigits( i / 10 );
}


Measured memory_bytes: 1148
import math
N = int(input())
S = input()
r = 0
g = 0
b = 0
T = list()
for i in range(N):
    if(S[i] == "R"):
        r += 1
        T.append(1)
    elif(S[i] == "G"):
        g += 1
        T.append(2)
    elif(S[i] == "B"):
        b += 1
        T.append(3)
total = r*g*b
for j in range(1, N-1):
    for n in range(1, min(N-1-j,j)+1):
        if (T[j]*T[j-n]*T[j+n] == 6):
            total -= 1
print(total)

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


int main() {
    LL P, Q, R;
    cin >> P >> Q >> R;

    cout << P + Q + R - max(P, max(Q, R)) << endl;
	
    return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

#if 1
int main()
{
	std::string s;
	std::string t;

	cin >> s;
	cin >> t;

	bool yes = false;
	
	for (int i = 0; i < s.size(); i++)
	{
		if (s == t)
		{
			yes = true;
			break;
		}

		char f = s.back();
		s.erase(s.size() - 1);
		s = f + s;
	}

	if (yes)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}
#endif


Measured memory_bytes: 888
import java.util.AbstractMap;
import java.util.Scanner;

public class Main {

     static Scanner scanner;

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

         int N=gi();
         int[] a=new int[N+1];
         int[] b=new int[N+1];

         for(int i=1; i<=N;i++) {
        	 a[i]=gi();
         }


         for (int i=N; i>0; i--) {
        	 int t=0;
        	 for(int j=2*i; j<=N;j+=i) {
        		 t+=b[j];
        	 }
        	 if(t%2==a[i]) {
        		 b[i]=0;
        	 } else {
        		 b[i]=1;
        	 }
         }
         int m=0;
         StringBuilder sb=new StringBuilder();
         for(int i=1; i<=N;i++) {
        	 if(b[i]==1) {
        		 if(m!=0)sb.append(" ");
        		 m++;
        		 sb.append(i);
        	 }
         }

         System.out.println(m);
         System.out.println(sb);
     }

     public static class Pair<K, V> extends AbstractMap.SimpleEntry<K, V> implements Comparable<Pair<K, V>> {
    		/** serialVersionUID. */
    	    private static final long serialVersionUID = 6411527075103472113L;

    	    public Pair(final K key, final V value) {
    	        super(key, value);
    	    }

    		@Override
    		public int compareTo(Pair<K, V> o) {

    			Comparable key = (Comparable)this.getKey();
    			Comparable key2 = (Comparable)o.getKey();

    			return key.compareTo(key2);
    		}

    	}

     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

Measured memory_bytes: 62632
#include <stdio.h>

int main(void) {
    long long int h, w;
    scanf("%lld %lld", &h, &w);

    long long int num;
    if (h == 1 || w == 1) {
        num = 1;
    } else if (!(h % 2)) {
        num = w * (h / 2);
    } else {
        if (w % 2) {
            num = w * (h / 2) + w / 2 + 1;
        } else {
            num = w * (h / 2) + w / 2;
        }
    }
    printf("%lld\n", num);
    return 0;
}

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

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

            int[] common = new int['z' - 'a' + 1];
            Arrays.fill(common, (int) 1e9);
            int[] counts = new int['z' - 'a' + 1];
            for (int i = 0; i < n; i++) {
                Arrays.fill(counts, 0);
                for (int j = 0; j < S[i].length(); j++) {
                    counts[S[i].charAt(j) - 'a']++;
                }

                for (int j = 0; j < common.length; j++) {
                    common[j] = Math.min(common[j], counts[j]);
                }
            }

            StringBuilder res = new StringBuilder();
            for (int i = 0; i < counts.length; i++) {
                for (int j = 0; j < common[i]; j++) {
                    res.append((char) (i + 'a'));
                }
            }

            System.out.println(res.toString());
        }
    }
}


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

int main()
{
    long int n,a=0,b=0,c=0,d=0;
    cin>>n;
    for(long int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        if(s=="AC")
        a++;
        else if(s=="WA")
        b++;
        else if(s=="TLE")
        c++;
        else
        d++;
    }
    cout<<"AC x "<<a<<endl;
    cout<<"WA x "<<b<<endl;
    cout<<"TLE x "<<c<<endl;
    cout<<"RE x "<<d<<endl;
	return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <string.h>
#include <math.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        int a,b,c;
        cin >> a >> b >> c;
        if(a*a+b*b==c*c||a*a==b*b+c*c||a*a+c*c==b*b)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
    return 0;
}

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

using namespace std;

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

const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1000000000000000000L;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int ddx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ddy[] = {0, 1, 1, 1, 0, -1, -1, -1};

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

int extgcd(int a, int b, int& x, int&y) {
    int d = a;
    if(b != 0) {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }else {
        x = 1;
        y = 0;
    }
    return d;
}

int inv(int a) {
    int x, y;
    extgcd(a, MOD, x, y);
    return (x + MOD) % MOD;
}

int main() {
    int n;
    cin >> n;
    cout << n * n * n << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  if(n%10==3)
    cout<<"bon";
  else if(n%10==0 || n%10==1 || n%10==6 || n%10==8)
    cout<<"pon";
  else
    cout<<"hon";
}

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

int main(){
  int N;

  while(cin>>N&&N!=0){
    int n[200],d[200];
    int x[200],y[200];
    int w=1,h=1;
    int minx=0,miny=0,maxx=0,maxy=0;

    x[0]=0;y[0]=0;
    for(int i=1;i<N;i++){
      cin>>n[i]>>d[i];
      if(d[i]==0){
        x[i]=x[n[i]]-1;
        y[i]=y[n[i]];
        if(minx>x[i]) minx=x[i];
      }else if(d[i]==2){
        x[i]=x[n[i]]+1;
        y[i]=y[n[i]];
        if(maxx<x[i]) maxx=x[i];
      }else if(d[i]==1){
        x[i]=x[n[i]];
        y[i]=y[n[i]]-1;
        if(miny>y[i]) miny=y[i];
      }else if(d[i]==3){
        x[i]=x[n[i]];
        y[i]=y[n[i]]+1;
        if(maxy<y[i]) maxy=y[i];
      }
    }
    w = w + maxx - minx;
    h = h + maxy - miny;
    cout << w << " " << h << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
def gcd(x, y):
  if y == 0:
    return x
  else:
    return gcd(y, x % y) 

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def isPrime(n):
  if n <= 2:
    return True
  m = int((n**0.5)//1 + 1)
  for p in range(2, m):
      if n % p == 0:
        return False
  return True
    
a,b = map(int,input().split())
gcd = gcd(a,b)
yks = make_divisors(gcd)
ans = 0
for i in yks:
  if isPrime(i):
    ans +=1
print(ans)

Measured memory_bytes: 3272
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using namespace std;
using dou = double;
const ll INF = 1LL << 60;
const ll mod = 1000000007;
typedef pair<ll,ll> P;
using graph = vector<vector<ll>>;
template<class T> inline bool chmax(T& a, T b){if(a < b){a = b; return true;}return false;}
template<class T> inline bool chmin(T& a, T b){if(a > b){a = b; return true;}return false;}
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}
//printf("%.10f\n", N);
/*
ll fibo(ll n){
    if(memo[n] != 0)return memo[n];
    if(n <= 1)return n;
    else return memo[n] = fibo(n - 1)+ fibo(n - 2);
}*/
/*  vector<ll> vec = {1,2,5,6,8,9,10};
    cout << binary_search(all(vec),5) << endl; -> true*/
/*
    vector<ll> vec = {1,2,5,6,8,9,10};
    auto n = upper_bound(all(vec),4);
    cout << *n << endl; -> 5*/
/*
    cout << fixed << setprecision(15);
    */
int main(){
    ll N,M;
    cin >> N >> M;
    bool ans = true;
    if(2 * N > M || 4 * N < M || M % 2 == 1)cout << "No" << endl;
    else cout << "Yes" << endl;
}

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

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int moto = sc.nextInt();
        int[] cake = new int[N];
        int ans = 0;
        
        
       for (int i = 0; i < N; i++) {
		cake[i] = sc.nextInt();
		if(moto >= cake[i]) {
		moto -= cake[i];
		ans++;
		}
		}
       
       sc.close();
       Arrays.sort(cake);
       
       while(moto >= cake[0]) {
    	   moto -= cake[0];
    	   ans++;
       }
       System.out.println(ans);
    }
}

Measured memory_bytes: 21844
# 初期入力
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
B.append(0)
count =0
residue_attack_possible =[0]*(N+2)
residue_monster =0
for i in range(N+1):
    if A[i] <= B[i] +residue_attack_possible[i]:
        count +=A[i]
        residue_attack_possible[i+1] = B[i] -max(0,A[i] -residue_attack_possible[i])
    else:
        count +=B[i] +residue_attack_possible[i]
        #residue_attack_possible[i+1] = 0

print(count)


Measured memory_bytes: 19228
#include<bits/stdc++.h>
using ll = long long;
using namespace std;
const ll INF = 1000000000000000000;
const ll mod = 998244353;
//printf("%.10f\n", n);
char maze[101][101];
signed main() {
    ll n, m, a = 1, b = 1; cin >> n >> m;
    cout << 100 << ' ' << 100 << endl;
    if (n < m) {
        while (true) {
            if (n == 1) { break; }
            maze[a][b] = '.'; maze[a + 1][b + 1] = '#';
            maze[a + 1][b] = '#'; maze[a][b + 1] = '#';
            b += 2;
            if (b > 100) { b = 1; a += 2; }
            n--;
        }
        for (int h = 1; h <= 20; h++) {
            for (int i = 1; i <= 100; i++) {
                if (maze[h][i] != '.') { maze[h][i] = '#'; }
            }
        }
        for (int i = 1; i <= 100; i++) { maze[21][i] = '.'; }
        a = 22; b = 1; m--;
        while (true) {
            if (m == 0) { break; }
            maze[a][b] = '#'; maze[a + 1][b + 1] = '.';
            maze[a + 1][b] = '.'; maze[a][b + 1] = '.';
            b += 2;
            if (b > 100) { b = 1; a += 2; }
            m--;
        }
        for (int h = 1; h <= 100; h++) {
            for (int i = 1; i <= 100; i++) {
                if (maze[h][i] != '#') { maze[h][i] = '.'; }
            }
        }
        for (int h = 1; h <= 100; h++) {
            for (int i = 1; i <= 100; i++) {
                cout << maze[h][i];
            }
            cout << endl;
        }
    }
    else {
        swap(n, m);
        while (true) {
            if (n == 1) { break; }
            maze[a][b] = '#'; maze[a + 1][b + 1] = '.';
            maze[a + 1][b] = '.'; maze[a][b + 1] = '.';
            b += 2;
            if (b > 100) { b = 1; a += 2; }
            n--;
        }
        for (int h = 1; h <= 20; h++) {
            for (int i = 1; i <= 100; i++) {
                if (maze[h][i] != '#') { maze[h][i] = '.'; }
            }
        }
        for (int i = 1; i <= 100; i++) { maze[21][i] = '#'; }
        a = 22; b = 1; m--;
        while (true) {
            if (m == 0) { break; }
            maze[a][b] = '.'; maze[a + 1][b + 1] = '#';
            maze[a + 1][b] = '#'; maze[a][b + 1] = '#';
            b += 2;
            if (b > 100) { b = 1; a += 2; }
            m--;
        }
        for (int h = 1; h <= 100; h++) {
            for (int i = 1; i <= 100; i++) {
                if (maze[h][i] != '.') { maze[h][i] = '#'; }
            }
        }
        for (int h = 1; h <= 100; h++) {
            for (int i = 1; i <= 100; i++) {
                cout << maze[h][i];
            }
            cout << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3688
import sys

n = int(input().strip())
al = list(map(int, input().strip().split(" ")))

bl = [0] * n
diff = 1 if n % 2 == 0 else -1
mid = int(n / 2)
bl[mid] = al[0]

deps = 1
a_index = 1
while a_index < n:
    if 0 > mid - deps * diff:
        break
    bl[mid - deps * diff] = al[a_index]
    a_index += 1
    if a_index >= n:
        break

    if mid + deps * diff >= n:
        break
    bl[mid + deps * diff] = al[a_index]
    a_index += 1
    deps += 1

for b in bl:
    sys.stdout.write(str(b) + " ")

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

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

    if(b <= a){
        cout << "delicious" << endl;
    }else if(x + a >= b){
        cout << "safe" << endl;
    }else{
        cout << "dangerous" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
typedef long long ll;

const int MAXN = 1000*1000 + 7;
const int SS = 1<<20;
const int MOD = 998244353;

int drz[2*SS + 7];
pair<int, int> przed[17];
int n, k;

void Insert(int i, int w)
{
	i += SS;
	drz[i] = (drz[i] + w) % MOD;
	i /= 2;
	while(i > 0)
	{
		drz[i] = (drz[2*i] + drz[2*i + 1]) % MOD;
		i /= 2;
	}
}

int Query(int p, int k)
{
	p += SS-1, k += SS+1;
	int sum = 0;
	while( p/2 != k/2 )
	{
		if( p%2 == 0 )
			sum = (sum + drz[p+1]) % MOD;
		if( k%2 == 1 )
			sum = (sum + drz[k-1]) % MOD;
		p /= 2, k /= 2;
	}
	return sum;
}

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

	int T;
	//cin >> T;
	T = 1;
	while(T--)
	{
		cin >> n >> k;
		for(int i=1; i<=k; i++)
			cin >> przed[i].fi >> przed[i].se;

		Insert(1, 1);
		for(int i=2; i<=n; i++)
		{
			int sum = 0;
			for(int j=1; j<=k; j++)
				sum = (sum + Query(i - przed[j].se, i - przed[j].fi)) % MOD;
			Insert(i, sum);
		}
		cout << Query(n, n) << '\n';
	}
	return 0;
}


Measured memory_bytes: 5232
#include <bits/stdc++.h>
using namespace std;
int main(void) {
    map<string,int> map;
    int n,a,c;
    string b;
    cin >> n;
    for (int i=0;i<n;i++) {
        cin >> a;
        if ( a==0 ) {
            cin >> b >> c;
            if ( map.find(b)!=map.end() ) {
                map.erase(b);
                map.emplace(b,c);
            } else {
                map.emplace(b,c);
            }
        } else if ( a==1 ) {
            cin >> b;
            cout << map.at(b) << endl;
        }
    }
}



Measured memory_bytes: 27804
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 100000+5;
const int dx[] = {-1,1,0,0,-1,-1,1,1};
const int dy[] = {0,0,-1,1,-1,1,-1,1};
using namespace std;
vector<int> G[N];
int vis[N];
int main() {
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n-1;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        G[x].push_back(y);
        G[y].push_back(x);
    }
 
    queue<int> Q;
    Q.push(1);
    Q.push(n);
    vis[1]=1;
    vis[n]=2;
 
    int fennec=0,snuke=0;
    while(!Q.empty()){
        int x=Q.front();
        Q.pop();
        for(int i=0;i<G[x].size();i++){
            int y=G[x][i];
            if(vis[y]==0){
                Q.push(y);
                vis[y]=vis[x];
                if(vis[y]==1)
                    fennec++;
                else if(vis[y]==2)
                    snuke++;
            }
        }
    }
    if(fennec>snuke)
        printf("Fennec\n");
    else
        printf("Snuke\n");
    return 0;
}

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


int main(){
  int n, a, b;
  cin >> n >> a >> b;
  int sum = 0;

  for(int i=1;i<=n;i++){
    int sum_in = 0;
    int n = i;
    while (n > 0){
      sum_in = sum_in + n % 10;
      n = n / 10;
    }

    if((a <= sum_in) && (sum_in <= b)){
      sum = sum + i;
      // if (i == 100){                                               
      //   cout << sum_in << endl;                                    
      // }                                                            
    }
  }
  cout << sum << endl;
  return 0;
}


Measured memory_bytes: 256
/*

	80桁までの整数を2つ入力し、その和を表示せよ。
	入力が80桁を超える場合はoverflowと出力せよ。
	
	

*/

#include <stdio.h>
#include <string.h>


void allNull(char str[], int n);

void plus(char first[], char second[], char result[]);

void reverse(char str[], int n);
void toNumber(char str[], int n);
void toString(char str[], int n);

void display(char data[], int n){
	
	int i;
	
	printf("数：%d\n", n);
	
	for(i=0; i<n; i++){
		
		printf("%d ", data[i]);
		
	}
	
	printf("\n\n\n");
}

int main(void){
	
	
	//データセット数
	int n;
	
	
	
	//80桁までの整数を格納する文字配列
	char first[801];
	char second[801];
	
	//和を格納する配列
	char result[801];
	
	
	//データセット数を入力
	fgets(result, sizeof(result), stdin);
	sscanf(result, "%d", &n);
	
	
	//繰り返し
	while(n--){
		
		//初期化
		allNull(result, sizeof(result));
		allNull(first, sizeof(first));
		allNull(second, sizeof(second));
		
		
		//80桁までの整数を入力, \nを消す
		fgets(first, sizeof(first), stdin);
		first[strlen(first)-1] = '\0';
		
		fgets(second, sizeof(second), stdin);
		second[strlen(second)-1] = '\0';
		
		
		//どちらかが80桁を超えていたらスキップ
		if(strlen(first) > 80 || strlen(second) > 80){
			
			printf("overflow\n");
			continue;
			
		}
		
		//和を求める
		plus(first, second, result);
		
		
		//80桁を超えていたらoverflow
		if(strlen(result) > 80){
			
			printf("overflow\n");
			
		}
		else{
			
			printf("%s\n", result);
			
		}
		
	}
	
	
}



void allNull(char str[], int n){
	
	int i;
	
	for(i=0; i<n; i++){
		
		str[i] = 0;
		
	}
	
}



void plus(char first[], char second[], char result[]){
	
	int firstSize = strlen(first);
	int secondSize = strlen(second);
	
	int idx = 0;
	
	int kuriagari;
	
	//逆順にする
	reverse(first, firstSize);
	reverse(second, secondSize);
	
	
	//和を求める
	while(!(first[idx] == 0 && second[idx] == 0)){
		
		kuriagari = 0;
		
		if(first[idx] == 0){
			
			//printf("second[%d]の%dをそのまま足す\n", idx, second[idx]-'0');
			
			result[idx] += (second[idx]-'0');
			
		}
		else if(second[idx] == 0){
			
			//printf("first[%d]の%dをそのまま足す\n", idx, first[idx]-'0');
			
			result[idx] += (first[idx]-'0');
			
		}
		else{
			
			//printf("%dと%dを足す\n",first[idx]-'0', second[idx]-'0');
			
			result[idx] += ((first[idx]-'0') + (second[idx]-'0'));
			
		}
		
		if(result[idx] >= 10){
			
			result[idx] -= 10;
			result[idx+1]+=1;
			
			kuriagari = 1;
			
		}
		
		idx++;
		/*
		if(kuriagari){
			
			//printf("kuriagari!\n");
			display(result, idx+1);
			
		}
		else{
			
			display(result, idx);
			
		}
		*/
		
	}
	
	
	//最後が繰り上がって終わっていたなら、idx++
	if(kuriagari){
		
		idx++;
		
	}
	
	//display(result, idx);
	
	//文字にする
	toString(result, idx);
	
	
	
	//並びを元に戻す
	reverse(result, idx);
	
	
}


void reverse(char str[], int n){
	
	int i, temp;
	
	for(i=0; i<n-i-1; i++){
		
		temp = str[i];
		str[i] = str[n-i-1];
		str[n-i-1] = temp;
		
	}
	
}



void toNumber(char str[], int n){
	
	int i;
	
	for(i=0; i<n; i++){
		
		str[i] -= '0';
		
	}
	
}



void toString(char str[], int n){
	
	int i;
	
	for(i=0; i<n; i++){
		
		str[i] += '0';
		
	}
	
}

Measured memory_bytes: 592
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

A,B = map(int,input().split())
if A%3==0 or B%3==0 or (A+B)%3==0:
    print("Possible")
else:
    print("Impossible")

    


Measured memory_bytes: 6732
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <regex>
using namespace std;
using pii  = pair<int,int>;
using ll=long long;
using ld=long double;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define rep(i,n) for(ll i=0;i<(n);++i)
#define Rep(i,a,b) for(ll i=(a);i<(b);++i)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rRep(i,a,b) for(int i=a;i>=b;i--)
#define crep(i) for(char i='a';i<='z';++i)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define ALL(x) (x).begin(),(x).end()
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define endl '\n'
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
ll gcd(ll a,ll b){return (b == 0 ? a : gcd(b, a%b));}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll MOD=1000000007;
constexpr ll INF=1000000011;
constexpr ll MOD2=998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS=10e-8;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T> istream& operator>>(istream& is,vector<T>& v){for(auto&& x:v)is >> x;return is;}
template<typename T,typename U> istream& operator>>(istream& is, pair<T,U>& p){ is >> p.first; is >> p.second; return is;}
template<typename T,typename U> ostream& operator>>(ostream& os, const pair<T,U>& p){ os << p.first << ' ' << p.second; return os;}
template<class T> ostream& operator<<(ostream& os, vector<T>& v){
  for(auto i=begin(v); i != end(v); ++i){
    if(i !=begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

int main(){
  ll A,B,C,D,E,F,G,H;
  string S;
  cin  >> S;
  cout << S.substr(0,S.size()-8) << endl;
}

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

using namespace std;

#define debug(x) cout << #x << "::" << x << endl;
#define debug2(x, y) cout << #x << "::" << x << " " << #y << "::" << y << endl;
#define debug3(x, y, z) cout << #x << "::" << x << " " << #y << "::" << y <<" "<< #z << "::" << z << endl;

#define For(i, a, b) for (int i = a; i < b; i++)

typedef long long ll;
const ll mod = 1e9 + 7;
const int MAX = 5 * 1e3 + 5;
typedef pair<int, int> pii;

void add(ll &a, ll b)
{
    a = (a + b) % mod;
    if (a < 0) a += mod;
}

int main() {

    int n;
    cin>>n;

    vector<vector<int>> v(n+1,vector<int>(3));
    for(int i=1;i<=n;i++){
        for(int j=0;j<3;j++)
            cin>>v[i][j];
    }
    
    vector<vector<int>> dp(n+1,vector<int>(3));

    For(j,0,3) dp[1][j] = v[1][j];

    For(i,2,n+1){
        For(j,0,3) {
            if(j == 0) {
                dp[i][j] = v[i][j] + max(dp[i-1][1],dp[i-1][2]);
            }else if(j == 1) {
                dp[i][j] = v[i][j] + max(dp[i-1][0],dp[i-1][2]);
            }else {
                dp[i][j] = v[i][j] + max(dp[i-1][0],dp[i-1][1]);
            }
        }
    }

    int ans = 0;
    For(j,0,3) ans = max(ans,dp[n][j]);

    cout<<ans<<endl;

    return 0;

}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
#define scan int n;cin>>n;for(int i=0;i<n;i++)
#define ll long long
#define vl vector<long long>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    cout << n*n << endl;
}



Measured memory_bytes: 256
import sys
while 1:  
  try:
    h1,m1,s1,h2,m2,s2=map(int,input().split())
  except EOFError: break
  '''
  m1=input()
  s1=input()
  h2=input()
  m2=input()
  s2=input()
  '''

  s1=s2+60-s1  
  s2=s1%60
  s1=s1/60

  m1=m2+60-1-m1+s1
  m2=m1%60
  m1=m1/60

  h2=h2-h1-1+m1

#print("d d d"%(h,m,s))
  print('%d'%h2,'%d'%m2,'%d'%s2)


Measured memory_bytes: 7564