akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount
#define CLEAR(arr, val) memset(arr, val, sizeof(arr))

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

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

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

const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };



const double EPS = 1e-8;

struct Rect
{
	double x, y, len;
	int c;
	Rect(double x, double y, double len, int c)
		: x(x), y(y), len(len), c(c) { }
};
bool operator<(const Rect& a, const Rect& b)
{
	return a.c < b.c;
};


int n;
double px[333], py[333];

bool contain(double x, double y, double radius, double xa, double ya)
{
	double dx = x - xa, dy = y - ya;
	return dx*dx + dy*dy < radius*radius + EPS;
}
int count_p(double cx, double cy, double radius)
{
	int res = 0;
	for (int i = 0; i < n; ++i)
		if (contain(cx, cy, radius, px[i], py[i]))
			++res;
	return res;
}

int main()
{
	while (scanf("%d", &n), n)
	{
		rep (i, n)
			scanf("%lf%lf", px + i, py + i);

		int res = 0;
		priority_queue<Rect> q;
		q.push(Rect(0, 0, 10, n));
		while (!q.empty())
		{
			Rect t = q.top(); q.pop();
			if (t.c <= res)
				break;

			double len = t.len / 2;
			double rela_x[] = { 0, len, 0, len };
			double rela_y[] = { 0, 0, len, len };
			rep (i, 4)
			{
				double tx = t.x + rela_x[i], ty = t.y + rela_y[i];
				double cx = tx + len / 2, cy = ty + len / 2;

				max_swap(res, count_p(cx, cy, 1));

				int c = count_p(cx, cy, len * sqrt(2.0) + 1);
				if (c > res)
					q.push(Rect(tx, ty, len, c));
			}
		}
		printf("%d\n", res);
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
struct edge{
	int k,next;
}e[1000005];
int n,a[1005],x[1005],m,home[1005],cnt=-1,flag[1005],y[1005];
bool vis[10000005];
void add(int x,int y){
	cnt++;
	e[cnt].k=y;
	e[cnt].next=home[x];
	home[x]=cnt;
}
int prime[10000005],cc=-1;
bool isprime[10000005];
void init(){
	isprime[1]=1;
	for(int i=2;i<=10000002;i++){
		if(!isprime[i]){
			prime[++cc]=i;
		}
		for(int p=1;p<=cc&&prime[p]*i<=10000002;p++){
			isprime[prime[p]*i]=1;
			if(i%prime[p]==0) break;
		}
	}
}
int Abs(int a){return a<0?-a:a;}
bool used[2005];
bool dfs(int k){
	for(int i=home[k];~i;i=e[i].next) if(!used[e[i].k]){
		used[e[i].k]=1;
		if(!flag[e[i].k]||dfs(flag[e[i].k])){
			flag[e[i].k]=k;
			return 1;
		}
	}
	return 0;
}
int main(){
	init();
	memset(home,-1,sizeof(home));
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]),vis[a[i]]=1;
	int o=a[n]+1;n=0;
	for(int i=1;i<=o;i++) if(vis[i]!=vis[i-1]){
		if(i&1) x[++n]=i;
		else y[++m]=i;
	}
	for(int i=1;i<=n;i++){
		for(int p=1;p<=m;p++) if(!isprime[Abs(x[i]-y[p])]) add(i,p);
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		memset(used,0,sizeof(used));
		if(dfs(i)) ans++;
	}
	ans+=(n-ans)/2*2+(m-ans)/2*2;
	n=(n-ans)%2;m=(m-ans)%2;
	if(n&&m) ans+=3;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 26880
#include <stdio.h>
int main()
 {

	unsigned long long n,a,b,sum1,sum2=0,i,vagfol,rem;;
	scanf("%llu%llu%llu",&n,&a,&b);
	for(i=a;i<=n;i++)
        {
            vagfol=i;
            sum1=0;
    while(vagfol!=0)
    {
           rem=vagfol%10;
        vagfol=vagfol/10;
        sum1+=rem;
    }
    if(sum1<=b&&sum1>=a){sum2+=i;}
	}
	printf("%llu",sum2);

}


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

//repetition
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

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

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};




int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  VI l(n),r(n);
  int ll = 0;
  int rr = 1e9;
  int mm = 0;

  rep(i,n){
    cin >> l[i] >> r[i];
    ll = max(l[i],ll);
    rr = min(r[i],rr);
    mm = max(r[i] - l[i] + 1, mm );
  }
  int ans = mm + max(rr-ll+1,0);

  // serch lmax rmin same
  vector<PII> rv;
  vector<PII> lv;

  rep(i,n) {
    rv.push_back(PII(r[i]-ll + 1, l[i]));
    lv.push_back(PII(rr-l[i] + 1, -r[i]));
  }

  sort(all(rv));
  sort(all(lv));
  int minR = 1e9;
  rep(i,n-1){
    minR = min(minR ,-lv[i].second);
    ans = max(lv[i+1].first + (minR - ll + 1), ans);
  }

  int maxL = 0;
  rep(i,n-1){
    maxL = max(maxL ,rv[i].second);
    ans = max(rv[i+1].first + (rr - maxL + 1), ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 2804
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


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

void YN(bool ans){
    if(ans)cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
    return;
}

int main(){
    ll X;
    cin>>X;
    YN(X>=30);
    return 0;
}

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

struct Point{
    Point(double _x=0,double _y=0):x(_x),y(_y){}
    
    Point operator + (Point p) const {return Point(x+p.x,y+p.y);}
    Point operator - (Point p) const {return Point(x-p.x,y-p.y);}
    //Point operator * (double d) const {return Point(x*d,y*d);}
    
    double Length() const{
        return sqrt(x*x+y*y);
    }
    
    double SqrLength() const{
        return x*x+y*y;
    }
    
    void Read(){
        scanf("%lf%lf",&x,&y);
    }
    
    void Write(){
        //printf("%.10f %.10f\n",x,y);
    }
    
    double x,y;  

    friend double Dot(Point p1,Point p2){
        return p1.x*p2.x+p1.y*p2.y;
    }
    
    friend double Cross(Point p1,Point p2){
        return p1.x*p2.y-p1.y*p2.x;
    }
};

struct Line{
    Line(){}
    Point s,t;
    
    /*friend Point Project(Point p,Line l){
        Point dir=l.t-l.s;
        return l.s+dir*(Dot(dir,p-l.s)/dir.SqrLength());
    }
    
    friend Point Reflect(Point p,Line l){
        Point q=Project(p,l);
        Point ret=q*2-p;
        return ret;
    }*/
};

int main(){
    Point p0,p1;
    p0.Read(); p1.Read();
    int n; scanf("%d",&n);
    while(n--){
        Point p2;
        p2.Read();
        int a=Cross(p1-p0,p2-p0);
        if (Cross(p1-p0,p2-p0)>0) puts("COUNTER_CLOCKWISE");
        else if (Cross(p1-p0,p2-p0)<0) puts("CLOCKWISE");
        //else if (Cross(p1-p0,p2-p0)==0){
        else if (Dot(p1-p0,p2-p0)<0) puts("ONLINE_BACK");
        else if ((p1-p0).Length()-(p2-p0).Length()<0) puts("ONLINE_FRONT");
        else puts("ON_SEGMENT");
                    
    }
    return 0;
}


Measured memory_bytes: 3248
# 2019-11-24 20:59:47(JST)
import sys

def main():
    n = int(sys.stdin.readline().rstrip())
    m = map(int, sys.stdin.read().split())
    ab = list(zip(m, m)) # 2回以上使えるようにlist化

    graph = [[] for _ in range(n + 1)]
    for a, b in ab:
        graph[a].append(b)
        graph[b].append(a)

    root = 1
    parent = [None] * (n + 1)
    # treeなのでループがないため、parentが定義できる
    checked = []
    to_check = [root]
    # dfs: depth first search では stack
    # bfs: breadth first search では queueを使う
    # 今回は stack

    while to_check:
        x = to_check.pop()
        # stackから要素を取り除き、xにset
        for y in graph[x]: # xから直接つながっているverticesについて
            if y == parent[x]: 
                continue
            # yがxの親でなければ
            parent[y] = x # xを親にして
            to_check.append(y) # 子であるyをto_checkにstackしていく
        checked.append(x) # 探索が終わったらvertexを記録

    color = [-1] * (n + 1) # 初期は0でもいいが、あえてngであることがわかりやすいように-1にしている
    for x in checked: # checkされた順になっている
        ng = color[x] # 最初は-1, colorは1からなので最初はngにはならない
        c = 1
        for y in graph[x]:
            if y == parent[x]:
                continue
            if c == ng:
                c += 1
            color[y] = c
            c += 1

    res = []
    for a, b in ab:
        if a == parent[b]:
            res.append(color[b])
        else: # 木なので parent[a] == b
            res.append(color[a])

    print(max(res))
    print('\n'.join(map(str, res)))


if __name__ == '__main__':
    main()


Measured memory_bytes: 38204
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String[] week = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
		int index = 0;
		for(int i=0; i<week.length; i++)
			if(S.equals(week[i]))
				index = i;
		System.out.println(7-index);
		
		sc.close();
	}
}


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

ans = [0] * 8
free = 0

for i in range(n):
    if 1 <= a[i] <= 399:
        ans[0] += 1
    elif 400 <= a[i] <= 799:
        ans[1] += 1
    elif 800 <= a[i] <= 1199:
        ans[2] += 1
    elif 1200 <= a[i] <= 1599:
        ans[3] += 1
    elif 1600 <= a[i] <= 1999:
        ans[4] += 1
    elif 2000 <= a[i] <= 2399:
        ans[5] += 1
    elif 2400 <= a[i] <= 2799:
        ans[6] += 1
    elif 2800 <= a[i] <= 3199:
        ans[7] += 1
    elif 3200 <= a[i]:
        free += 1

num = len(ans) - ans.count(0)
print(str(max(num, 1)) + ' ' + str(num + free))

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) v.erase(unique(v.begin(), v.end()), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

#define MAX_V 1000000

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

  int r, D, x2000;
  cin >> r >> D >> x2000;

  int rsl[11];
  rsl[0] = x2000;
  rep(i, 0, 11) rsl[i + 1] = r * rsl[i] - D;
  rep(i, 1, 11) cout << rsl[i] << endl;
}


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

public class CF
{


    public static int[] ReadArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt32(m));
    }

    public static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    public static string ReadStr()
    {
        return Console.ReadLine();
    }

    public static long ReadLong()
    {
        return Convert.ToInt64(Console.ReadLine());
    }

    public static long[] ReadLongArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt64(m));

    }


    public static void Main()
    {
        var s1 = ReadStr();
        var s2 = ReadStr();

        if (s1 == s2.Substring(0, s2.Length - 1))
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");


    }

}


Measured memory_bytes: 17388
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn read_touple<T: std::str::FromStr + Copy>() -> (T, T) {
  let v: Vec<T> = read_vec();
  assert_eq!(v.len(), 2);
  (v[0], v[1])
}

fn main() {
  let n: usize = read();
  let s: Vec<char> = read::<String>().chars().collect();
  let mut ans = 0;
  for i in 0..n-2 {
    if s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C' {
       ans += 1;
    }
  }
  println!("{}", ans);
}


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

int main() {
  int N = 0, K = 0, x = 0, l = 0;
  
  cin >> N >> K;
  
  for (int i = 0; i < N; i++) {
    cin >> x;
    
    if (x < (K - x)) {
      l += (x * 2);
    }
    else {
      l += ((K - x) * 2);
    }
  }
  
  cout << l << endl;
}


Measured memory_bytes: 256
D, N = map(int, input().split())

if D == 0:
    if N==100:
        print("101")
    else:
        print(N)
if D == 1:
    if N==100:
        print("10100")
    else:
        print(pow(100,D) *N)
if D == 2:
    if N==100:
        print("1010000")
    else:
        print(pow(100,D) *N)

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

const int INF = 1e9;

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

  if (e-a>k) {
    cout << ":("<<endl;
  } else {
    cout <<"Yay!"<<endl;
  }

}

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

using namespace std;

string solve(const string &S, const string &T)
{
	const int n = S.size();

	map<char, char> m1, m2;
	for (int i = 0; i < n; ++i) {
		if (m1.count(S[i]) && m2.count(T[i])) {
			if (m1[S[i] != T[i]] || m2[T[i]] != S[i]) {
				return "No";
			}
		}
		else if (m1.count(S[i]) == 0 && m2.count(T[i]) == 0) {
			m1[S[i]] = T[i];
			m2[T[i]] = S[i];
		}
		else {
			return "No";
		}
	}
	return "Yes";
}

int main()
{
	string S, T;
	cin >> S >> T;
	cout << solve(S, T) << endl;
}


Measured memory_bytes: 776
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<unistd.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define ST first
#define ND second
#define ll long long
#define ld long double
using namespace std;
using namespace __gnu_pbds;
 
// replace ll with pair if multiset needed
typedef tree<pair<int,int>, null_type, greater<pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ordered_set secik;
 
const ll INF = 1e9 + 9;
const ll MOD = 1e9 + 7;
const long long LINF = (ll)1e18 + 3;
const int SIZE = 2e5 + 6;
 
// secik.insert({x, t++});
// secik.erase(secik.lower_bound({x,-1}));
// *secik.find_by_order(x)).first << "\n";
// secik.order_of_key(x)
 
//random_device device;
//mt19937 gener(device());
//uniform_int_distribution<int> gen(0,n-1);

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

	int n,w; cin >> n >> w;

	vector<ll> dp(w+1);

	for(int i = 0; i < n; i++){
		ll x,y; cin >> x >> y;
		for(int j = w - x; j >= 0; j--){
			dp[j + x] = max(dp[j+x],dp[j] + y);
		}
	}

	long long res = 0;
	for(int i = 0; i <= w; i++) res = max(res,dp[i]);

	cout << res;










}

Measured memory_bytes: 1024
#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 <utility>
#include <numeric>

using namespace std;

const uint64_t MOD = 1000000000 + 7;

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

	int64_t bx = b / x + 1;
	int64_t ax = ((a - 1) / x) + 1;
	if (a == 0)
	{
		ax = 0;
	}
	cout << bx - ax << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>


using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define CLEAR(arr, val) memset(arr, val, sizeof(arr))

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

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

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

const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };
bool valid_pos(int x, int y, int w, int h) { return 0 <= x && x < w && 0 <= y && y < h; }



const int mod = 100000007;
const int MAX = 100000;
void dpru(int* dp, int period)
{
	static int aperi_dp[MAX + 10];
	fill(aperi_dp, aperi_dp + (MAX + 10), 0);
	// aperi_dp[i] = sum[j = i-period .. i-1](aperi_dp[i - j])
	aperi_dp[0] = 1;
	for (int i = 0; i < MAX; ++i)
		for (int j = 1; j <= period; ++j)
			(aperi_dp[i + j] += aperi_dp[i]) %= mod;

	fill(dp, dp + (MAX + 10), 0);
	// dp[i] = aperi_dp[i] + dp[i - period]
	// dp[0] = 0
	for (int i = 1; i <= MAX; ++i)
	{
		(dp[i] += aperi_dp[i]) %= mod;
		(dp[i + period] += dp[i]) %= mod;
	}
}
int main()
{
	ios::sync_with_stdio(false);

	static int dp3[MAX + 100], dp5[MAX + 100];
	dpru(dp3, 3);
	dpru(dp5, 5);

	for (string s; cin >> s, s[0] != '#'; )
	{
		s += '@';
		ll res = 1;
		for (int i = 0, c = 0; s[i] != '@'; ++i)
		{
			++c;
			if (s[i] != s[i + 1])
			{
				int* dp;
				if (s[i] == '8' || s[i] == '0')
					dp = dp3;
				else
					dp = dp5;

				(res *= dp[c]) %= mod;
				c = 0;
			}
		}

		cout << res << endl;
	}
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)

int X;

ll solve() {
    ll ans = 0;
    ans += X/500 * 1000;
    X %= 500;
    ans += X/5 * 5;
    return ans;
}

int main() {
    cin >> X;
    cout << solve() << endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){

    int a, b;

    cin >> a;
    cin >> b;

    if(a < b) cout << "a < b" << endl;
    else if(a > b) cout << "a > b" << endl;
    else cout << "a == b" << endl;

    return 0;

}


Measured memory_bytes: 3080
import java.io.PrintWriter
val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val hours = listOfInt()
    val start = hours[0] + hours[1]

    if (start >= 24) {
        println(start-24)
    } else {
        println(start)
    }
}

fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { it.toInt() }

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 36012
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>
#include <limits>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
//エイリアス
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

//定数
const int intmax = numeric_limits<int>::max();
const ll llmax = numeric_limits<ll>::max();
const ll mod = 1e9 + 7;
const double pi = M_PI;



ll x, y;
ll cand[1000000 + 1];

void init() {
  cand[0] = 1;
  cand[1] = 1;
  for(ll i = 2; i < 1000000 + 1; i++) {
    cand[i] = i * cand[i - 1];
    cand[i] %= mod;
  }
}
template <typename number>
pair<number, number> extended_euclid(number a, number b)
{
  number r0, r1, a0, a1, b0, b1;
  r0 = a; r1 = b;
  a0 = 1; a1 = 0;
  b0 = 0; b1 = 1;
  while (r1>0) {
    number q1 = r0 / r1;
    number r2 = r0 % r1;
    number a2 = a0 - q1 * a1;
    number b2 = b0 - q1 * b1;
    r0 = r1 ; r1 = r2;
    a0 = a1 ; a1 = a2;
    b0 = b1 ; b1 = b2;
  }
  number c = r0;
  a = a0; //x
  b = b0; //y
  return  {a, c};
}

template  <typename number>
number inverse_N(number a, number N)
{
  pair<number, number> result = extended_euclid(a, N);
  if(result.first < 0)
  {
    result.first = result.first + N;
  }
  return result.first;
}


ll calc_cands(ll fixed) {
  ll restx_twice = x - fixed;
  ll resty = y - fixed * 2;
  if (restx_twice % 2 != 0) return 0;
  ll restx = restx_twice / 2;
  if (restx < 0) return 0;
  if (resty < 0) return 0;
  if (restx != resty) return 0;
  if (restx + fixed >= max(x, y) + 1) return 0;
  ll total = restx + fixed;
  ll bunbo = cand[total - fixed] * cand[fixed];
  bunbo %= mod;
  ll bunbo_inv = inverse_N(bunbo, mod);
  ll result = cand[total] * bunbo_inv;
  result %= mod;
  return result;
}

int main()
{
  cin >> x >> y;
  init();
  ll result = 0;
  rep(i, max(x, y) + 1) {
    result += calc_cands(i);
    result %= mod;
  }
  cout << result << endl;
}


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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

template<class NUMBER>
struct Point {
    NUMBER x, y;
    Point (NUMBER x, NUMBER y) : x(x), y(y) {}
    Point () = default;

    Point operator + (const Point & point) const {
        return Point(x + point.x, y + point.y);
    }
    Point operator - (const Point & point) const {
        return Point(x - point.x, y, - point.y);
    }
    Point operator * (const NUMBER d) const {
        return Point(x * d, y * d);
    }
    Point operator / (const NUMBER d) const {
        return Point(x / d, y / d);
    }
    Point& operator += (const Point & point) {
        x += point.x;
        y += point.y;
        return *this;
    }
    Point& operator -= (const Point & point) {
        x -= point.x;
        y -= point.y;
        return *this;
    }
    Point& operator *= (const NUMBER d) {
        x *= d;
        y *= d;
        return *this;
    }
    Point& operator /= (const NUMBER d) {
        x /= d;
        y /= d;
        return *this;
    }
    bool operator < (const Point& point) const {
        return x < point.x;
    }
};

signed main(){
    int H, W, K;
    cin >> H >> W >> K;
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    vector<vector<char>> grids(H+1, vector<char>(W+1));
    rep(i,1,H+1) rep(j,1,W+1) cin >> grids[i][j];
    vector<vector<int>> distances(H+1, vector<int>(W+1, INT_MAX));
    priority_queue<pair<int, Point<int>>, vector<pair<int, Point<int>>>, greater<>> que;
    if (grids[x1][y1] != '@') {
        distances[x1][y1] = 0;
        que.push({0, {x1, y1}});
    }
    const auto isValid = [H, W](const Point<int>& point) -> bool { return point.x >= 1 && point.y >= 1 && point.x <= H && point.y <= W;};
    while (!que.empty()) {
        auto distance = que.top().first;
        auto base = que.top().second;
        que.pop();
        vector<Point<int>> directions = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
        for (const auto& direction : directions) {
            auto current = base;
            rep(i,0,K) {
                current += direction;
                if (!isValid(current) || grids[current.x][current.y] == '@') break;
                if (distances[current.x][current.y] <= distance) break;
                if (distances[current.x][current.y] > distance+1) {
                    distances[current.x][current.y] = distance+1;
                    que.push({distance+1, current});
                }
            }
        }
    }
    int answer = distances[x2][y2];
    cout << (answer == INT_MAX ? -1 : answer) << endl;
    return 0;
}


Measured memory_bytes: 16980
#include <iostream>
#include <vector>
#include <algorithm>

int main(void){
    int A, B, M, ans=200001;
    std::cin >> A >> B >> M;
    std::vector<int> a(A);
    std::vector<int> b(B);
    for (int i=0; i<A; ++i){
        std::cin >> a.at(i);
    }
    for (int i=0; i<B; ++i){
        std::cin >> b.at(i);
    }

    for (int i=0; i<M; ++i){
        int x, y, c, tmp;
        std::cin >> x >> y >> c;
        tmp = a.at(x - 1) + b.at(y - 1) - c;
        if (ans > tmp) ans = tmp;
    }

    std::sort(a.begin(), a.end());
    std::sort(b.begin(), b.end());
    if (ans > a.at(0) + b.at(0)){
        ans = a.at(0) + b.at(0);
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 4032
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  string s;
  cin >> s;
  string t;
  cin >> t;
  int cnt = 0;
  for (int i = 0; i < 3; i++) {
    cnt += (s[i] == t[i]);
  }
  cout << cnt << endl;
}

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

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

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

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


    ll l[n + 1], r[n + 1];
    l[0] = 0;
    for(int i = 1; i < n + 1; i++){
        l[i] = gcd(l[i - 1], a[i - 1]);
    }
    r[n] = 0;
    for(int i = n - 1; i >= 0; i--){
        r[i] = gcd(r[i + 1], a[i]);
    }

    ll ans = 0;
    for(int i = 0; i < n; i++){
        ll m = gcd(l[i], r[i + 1]);
        if(ans < m){
            ans = m;
        }
    }

    cout << ans << endl;
}

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

#define N 200123
#define mod 1000000007

int main(){
 ios::sync_with_stdio(false);
 cin.tie(0);
 if(fopen("input.in", "r")){
        freopen("input.in", "r", stdin);
        freopen("output.out", "w", stdout);
    }
    int a, b; cin >> a >> b;
    int i=1;
    int c =a;
    a--; b--;
    // while(a < b){
    // 	a += (c -1);
    // 	i++;
    // }
    cout << (a+b-1)/a <<"\n";
 return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <time.h>
#include <algorithm>
#include <math.h>
using namespace std;
#define INF 2147483647

int main() {
	ios_base::sync_with_stdio(false);
  
	int n; cin >> n;
	vector<int> a(n);

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

	int sum = 0; 
	for (int i = 0; i < n; i++) {
		for (int j = i+1; j < n; j++) {
			sum += (a[i] * a[j]);
		}
	}

	cout << sum << "\n";

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  
  	long long a,b,c=0;
  	cin >> a >> b;
  	for (int i=0; i<a; i++){
      long long d;
      cin >> d;
      if (d>=b){c++;}}
    cout << c;}

Measured memory_bytes: 3656
N, T = map(int,raw_input().split())
t = map(int,raw_input().split())
result = 0

for i, v in enumerate(t):
    if i == 0: continue
    diff = v - t[i - 1]
    if diff > T:
        result += T
    else:
        result += diff
result += T


print result

Measured memory_bytes: 20060
#include <bits/stdc++.h>
#define M 10000005
using namespace std;
int d[700005],t,m,e[M],n,cnt,vis[205],w[205],g[205],u[40005],v[40005],nex[40005],a[205],b[205],A,B;
int find(int x){
	for (int i=g[x];i;i=nex[i])
	if (!vis[v[i]]){
		vis[v[i]]=1;
		if (!w[v[i]]||find(w[v[i]])){
			w[v[i]]=x; return 1;
		}
	}
	return 0;
}
int main(){
	for (int i=2;i<M;++i){
		if (!e[i]) d[++t]=i;
		for (int j=1;j<=t;++j){
			n=i*d[j]; if (n>=M) break;
			e[n]=1;	if (i%d[j]==0) break;
		}
	}
	scanf("%d",&n); t=0; e[0]=e[1]=e[2]=1;
	for (int i=1;i<=n;++i) scanf("%d",&a[i]);
	for (int i=1,j;i<=n;i=j+1){
		for (j=i;a[j+1]==a[j]+1;++j);
		b[++t]=a[i]; b[++t]=a[j]+1;
	}
	n=t;
	for (int i=1;i<=n;++i)
	if (b[i]&1)
	for (int j=1;j<=n;++j)
	if (!e[abs(b[j]-b[i])])
		u[++m]=i,v[m]=j,nex[m]=g[i],g[i]=m;
	for (int i=1;i<=n;++i)
	if (b[i]&1){
		for (int j=1;j<=n;++j) vis[j]=0;
		if (find(i)) ++cnt; ++A;
	}
	B=n-A-cnt; A-=cnt;
	cnt+=A/2*2+B/2*2;
	if (A&1) cnt+=3;
	printf("%d\n",cnt);
	return 0;
}

Measured memory_bytes: 42112
// Remeber Choose Compiler: GCC9
#include <bits/stdc++.h>

using namespace std;

// Debug Output Utility
#ifdef LOCAL
#define dbg(args...)             \
    do {                         \
        cout << #args << " -> "; \
        err(args);               \
    } while (0)
void err() { std::cout << std::endl; }
template <typename T, typename... Args>
void err(T a, Args... args) {
    std::cout << a << ' ';
    err(args...);
}
template <template <typename...> class T, typename t, typename... A>
void err(const T<t> &arg, const A &... args) {
    for (auto &v : arg)
        std::cout << v << ' ';
    err(args...);
}
#else
#define dbg(...)
#endif

// Macro Definitions:
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

// Type Alias:
using int64 = long long;
using PII   = pair<int, int>;

// Global Const Variable
const int64 INF = 0x3f3f3f3f3f3f3f3f;
const int MOD   = 1000000007;
const int MAXN  = 200005;

int64 a[MAXN];

void run() {
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1, j = k + 1; j <= n; j++, i++) {
        if (a[j] > a[i])
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
}

// Debug Input Redirection
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
#endif
    run();
}


Measured memory_bytes: 5208
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
const long long MOD=1e09+7;



#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define pb push_back


vector<vi> to;
map<int,int> ope;
vi answers;

void dfs(int node, int p){
  for (int next:to.at(node)){
    if (next!=p){
      if (ope.count(next)){
        answers.at(next)=answers.at(node)+ope[next];
      }
      else {
        answers.at(next)=answers.at(node);
      }
      dfs(next,node);
    }
  }
}


      






int main(){

  int n,q;
  cin>>n>>q;

  to.resize(n+1);
  
  rep(i,n-1){
    int a,b;
    cin>>a>>b;
    to.at(a).pb(b);
    to.at(b).pb(a);
  }
  
  
  rep(i,n){
    ope[i]=0;
  }

  rep(i,q){
    int p,x;
    cin>>p>>x;
    ope[p]+=x;
  }
  
  answers.resize(n+1);
  answers.at(1)=0;
  if (ope.count(1)){
    answers.at(1)=ope.at(1);
  }
  
  
  dfs(1,-1);
  
  for (int i=1;i<=n;i++){
    cout<<answers.at(i)<<" ";
  }
  cout<<endl;
  

}












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

int main() {
  int counter = 0;
  string s;
  cin >> s;

  for(int i = 0; i < s.size(); i++) {
    if(s.at(i) == 'o') counter++;
  }

  cout << 700 + counter * 100 << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
#include <numeric>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265359;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };



signed main() {
	double n, k;
	double sum = 0;

	cin >> n >> k;

	int cnt2 = 0, cnt3 = 0, maxn = 0;

	for (int i = 1; (double)i <= n; i++) {
		
		double num = i, cnt = 0;
		bool flag = false;

		while (num<k)
		{
			num *= 2;
			cnt++;
			//cnt3 += (cnt2+1);
			flag = true;
		}

	/*	if (i == 1) {
			maxn = cnt;
		}*/

		if (flag == true) {
			cnt2++;
			//cnt3 += cnt;
			//sum += (1.0 / (double)pow(2, cnt));
			sum += (pow( 0.5, cnt));
		}
	}



	//double dd = (1.0 / (double)n) * (double)(n - cnt2) + (1.0 / (double)n) * (double)cnt2 * sum;
	double dd = (1.0 / (double)n) * (double)(n - cnt2) + (1.0 / (double)n) *  sum;
	cout << fixed << setprecision(20)<< dd << endl;


	return 0;
}

Measured memory_bytes: 384
using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        int[] nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        Console.WriteLine(
            nums.Count(x => x == 5) == 2 &&
            nums.Count(x => x == 7) == 1 ? 
            "YES" : "NO");
    }
}


Measured memory_bytes: 13396
#include <iostream>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <queue>
#include <bits/stdc++.h>
#include <stack>
#include <vector>
#include <list>

using namespace std;

int main(){
  string s[100];
  string ans;

  int N,L;
  cin >> N >> L;
  for(int i = 0; i < N; i++)
    cin >> s[i];

  for(int i = 0; i < N; i++){
    for(int j = 0; j < N; j++){
      if(strcmp(s[i].c_str(),s[j].c_str())<0)
        swap(s[i],s[j]);
    }
  }
  for(int i = 0; i < N; i++)
    ans += s[i];
  cout << ans << endl;



  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

#define fread           freopen("input.txt","r",stdin)
#define fwrite          freopen("output.txt","w",stdout)
#define eb              emplace_back
#define em              emplace
#define pb              push_back
#define Mp              make_pair
#define ff              first
#define ss              second
#define all(a)          a.begin(),a.end()
#define Unique(a)       sort(all(a)),a.erase(unique(all(a)),a.end())
#define FastRead        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define memo(ara,val)   memset(ara,val,sizeof(ara))
#define II              ( { int a ; read(a) ; a; } )
#define LL              ( { ll a ; read(a) ; a; } )
#define DD              ({double a; scanf("%lf", &a); a;})
#define rep(i,n)        for(int i=0;i<n;i++)
#define rep1(i,n)       for(int i=1;i<=n;i++)
#define rrep(i,a,n)     for(int i=a;i<=n;i++)
#define per(i,n,a)      for(int i=n;i>=a;i--)
#define pf(n)           printf("%lld",n)
#define pfi(n)          printf("%d",n)
#define sp              printf(" ")
#define ln              printf("\n")
#define sc(x)           scanf("%lld",&x)
#define scw(x)          scanf("%I64d",&x)
#define sci(x)          scanf("%d",&x)
#define sc2(x,y)        scanf("%lld %lld",&x,&y)
#define sc3(x,y,z)      scanf("%lld %lld %lld",&x,&y,&z)
#define Found(a, b)     a.find(b) != a.end()
// bool operator< (const node& sx) const { return sx.val < val; }
//set<ll,greater<ll> >st;
//priority_queue<ll , vector<ll> , greater<ll> >
template<class T>inline bool read(T &x){ int c=getchar();int sgn=1;
  while(~c&&c<'0'|c>'9'){if(c=='-')sgn=-1;c=getchar();}
  for(x=0; ~c&&'0'<=c&&c<='9'; c=getchar())x=x*10+c-'0';x*=sgn;return ~c;
}
const ll N = 300005;
const ll MOD = 1e9+7;
ll cost[N];
ll dp[N];
int main(){
   //fread;
    ll n = LL;
    rep1(i,n) cost[i] = LL;
    rep1(i,n) dp[i] = 1e18;
    dp[1] = 0;
    for(ll i = 1; i<n; ++i){
        for(ll j = i+1, k = 1; j<=n && k<=2; ++j, ++k){
             dp[j] = min( dp[j] , dp[i] + abs(cost[i]-cost[j]) );
        }
    } pf(dp[n]),ln;
}











Measured memory_bytes: 3072
#include<bits/stdc++.h>
using namespace std;
long long cnt[200001],flg[200001];
int main(void){
	long long n,k,a,i,s,sum;
	cin>>n>>k;
	for(i=0;i<=n;i++) cnt[i]=0,flg[i]=1;
	s=0;
	for(i=0;i<n;i++){
		cin>>a;
		cnt[a]++;
		if(flg[a]==1){
			s++;
			flg[a]=0;
		}
	}
	sort(cnt,cnt+n+1);
//	for(i=0;i<=n;i++) cout<<cnt[i]<<' '<<flg[i]<<endl;
	sum=0;
	for(i=0;i<=n;i++){
		if(s<=k) break;
		if(cnt[i]!=0){
			sum+=cnt[i];
			s--;
		}
//		cout<<s<<endl;
	}
	cout<<sum<<endl;
	return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 1e9+7;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}


void solve()
{
  int k;
    cin >> k;
    
    int res = 0;
    
    f(i,k) f(j,k) f(l,k)
    {
        int v = __gcd(i+1,j+1);
        v = __gcd(v,l+1);
        res+=v;
    }
    
    cout << res;
    
    
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}

Measured memory_bytes: 3648
#include<iostream>

using namespace std;
int n, s, ans;

void solve(int cnt, int num, int sum){
    if(n==cnt&&s==sum){
        ans++;
        return;
    }else if(cnt>n||num>9){
        return;
    }

    solve(cnt+1, num+1, sum+num);
    solve(cnt, num+1, sum);
}

int main(){

    while(1){
        cin>> n>> s;
        if(n==0&&s==0) break;

        ans=0;
        solve(0, 0, 0);

        cout<< ans<< endl;
    }
    return 0;
}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define SORT(v, n) sort(v, v+n)
#define VREV(v,n) reverse(v,v+n)
#define REV(v,n) reverse(v,v+n)
#define vi vector<int>
#define pf push_front
#define pb push_back
#define P pair<int,int>
#define Pll pair<ll,ll>

template<class T, size_t N> size_t countof(const T (&array)[N]) { return N; }
template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<"\n";}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}

void mprint(auto *matrix,auto N){
	REP(i,N) cout<<matrix[i]<<(i!=N-1?' ':'\n');
	return;
}

const double EPS =1e-9;
const int INF =2e+9;
const ll INFL =9e+18;
const long MOD =1e+9+7;
#define PI 3.14159265258979

#define iP pair<int,P>
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

inline int in(){int x; cin>>x; return x;}

const int N_max=100000;

int main(void){
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	
	ll N,x,A[100000],B[100000],result=INFL;
	cin>>N>>x;
	REP(i,N){
		cin>>A[i]; B[i]=INFL;
	}

	REP(k,N){
		ll tem=x*k;
		REP(i,N){
			chmin(B[i],A[(i+N-k)%N]); tem+=B[i];
		}
		chmin(result,tem);
	}
	print(result);
		
	return 0;
}






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

int main()
{
    string N;
    int d = 0;
    cin >> N;

    for (int i = 0; i < N.size(); ++i)
    {
        if (N[i] == '-')
            continue;
        d += N[i] - '0';
    }

    if (d % 9 == 0)
        cout << "Yes" << endl;
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


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


namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            MainStream();
        }
        static void MainStream()
        {
            Scan sc = new Scan();
            write wr = new write();

            int n = sc.intarr[0];

            int[] xs = sc.intarr;

            int[] copy_array = new int[xs.Length];

            Array.Copy(xs, copy_array, xs.Length);

            Array.Sort(copy_array);

            int centor_before = copy_array[(n - 1) / 2];
            int centor_after = copy_array[(n + 1) / 2];

            if (centor_before == centor_after)
            {
                for (int i = 0; i < n; i++)
                {
                    wr.wri(centor_before);
                }
            }
            else
            {
                for (int i = 0; i < n; i++)
                {
                    if (xs[i] <= centor_before)
                    {
                        wr.wri(centor_after);
                    }
                    else
                    {
                        wr.wri(centor_before);
                    }
                }
            }

        }
    }

    class Scan
    {
        public string str => Console.ReadLine();

        public string[] strarr => str.Split(' ');

        public long[] longarr => strarr.Select(long.Parse).ToArray();
        public int[] intarr => strarr.Select(int.Parse).ToArray();
        public char[] chararr => str.ToArray();


    }



    class write
    {
        public void wri<Type>(Type x)
        {
            Console.WriteLine(x);
        }
    }

    class Method
    {
        static public int max(params int[] nums)
        {

            int maxx = nums[0];
            for (int i = 1; i < nums.Length; i++)
            {
                maxx = Math.Max(maxx, nums[i]);
            }
            return maxx;
        }
    }
}


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


int main(){
	long long n,k,x;
	cin >> n >> k;
	vector<long long> v(n);
	for(int i=0;i<n;i++){
		cin >> v[i];
	}
	vector<long long> v2 = v;
	reverse(v2.begin(),v2.end());
	
	long long cnt=0,cnt2=0;
	for(int i=1;i<n;i++){
		if(v[i-1]+v[i]>k){
			x=v[i-1]+v[i]-k;
			if(v[i]!=0){
				if(x==v[i]){
					cnt+=v[i];
					v[i]=0;
				}
				else if(x<v[i]){
					cnt+=x;
					v[i]-=x;
				}
				else{
					cnt+=x;
					v[i]=0;
				}
			}
			else{
				cnt+=x;
			}
		}
	}
	
	for(int i=1;i<n;i++){
		if(v2[i-1]+v2[i]>k){
			x=v2[i-1]+v2[i]-k;
			if(v2[i]!=0){
				if(x==v2[i]){
					cnt2+=v2[i];
					v2[i]=0;
				}
				else if(x<v2[i]){
					cnt2+=x;
					v2[i]-=x;
				}
				else{
					cnt2+=x;
					v2[i]=0;
				}
			}
			else{
				cnt2+=x;
			}
		}
	}
	
	cout << min(cnt,cnt2) << endl;
	return 0;
}

Measured memory_bytes: 1920
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <cassert>
#include <string>
#include <memory.h>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <set>
#include <map>
#include <cctype>
#include <iomanip>
#include <sstream>
#include <cctype>
#include <fstream>
#include <cmath>
using namespace std;

#define REP2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define REP(i, n) REP2(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
#define ITER(c) __typeof((c).begin())
#define PB(e) push_back(e)
#define FOREACH(i, c) for(ITER(c) i = (c).begin(); i != (c).end(); ++i)
#define MP(a, b) make_pair(a, b)
#define PARITY(n) ((n) & 1)

typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1000 * 1000 * 1000 + 7;
const double EPS = 1e-10;

int n;
bool inside(int i, int j, int h, int w){
  return 0 <= i && i < h && 0 <= j && j < w;
}

void fall(vector<string> &field){
  int h = field.size();
  int w = field[0].size();

  bool update = true;
  while(update){
    update = false;
    for(int i = h - 2; i >= 0; i--){
      REP(j, w){
        if(field[i][j] != '.' && field[i+1][j] == '.'){
          swap(field[i][j], field[i+1][j]);
          update = true;
        }
      }
    }
  }
}
bool erase(vector<string> field){
  fall(field);
    
  int h = field.size();
  int w = field[0].size();
  vector<vector<int> > elim(h, vector<int>(w, 0));
  
  REP(i, h){
    int l = 0, r = 0;
    while(l < w){
      if(field[i][l] == '.'){
        l++;
      }else{
        for(r = l; ++r < w && field[i][r] == field[i][l];);
        for(int j = l; j < r; j++) if(r - l >= n) elim[i][j] = true;
        l = r;
      }
    }
  }
  
  REP(i, w){
    int l = 0, r = 0;
    while(l < h){
      if(field[l][i] == '.'){
        l++;
      }else{
        for(r = l; ++r < h && field[r][i] == field[l][i];);
        for(int j = l; j < r; j++) if(r - l >= n) elim[j][i] = true;
        l = r;
      }
    }
  }
  
  int countr = 0;
  int counte = 0;
  REP(i, h)REP(j, w){
    if(elim[i][j]){
      counte++;
      field[i][j] = '.';
    }
    countr += field[i][j] != '.';
  }
  if(countr == 0) return true;
  if(counte == 0) return false;
  return erase(field);
}

int main(){
  int h, w;
  cin >> h >> w >> n;
  vector<string> field(h, string(w, ' '));
  REP(i, h)REP(j, w) cin >> field[i][j];
  
  bool ok = false;
  REP(i1, h)REP(j1, w){
    if(ok) break;
    for(int k = -1; k <= 1; k++)if(k != 0){
        int i2 = i1;
        int j2 = j1 + k;
        if(inside(i2, j2, h, w)){
          swap(field[i1][j1], field[i2][j2]);
          ok = erase(field);
          swap(field[i1][j1], field[i2][j2]);
        }
      }
  }
  
  cout << (ok ? "YES" : "NO") << endl;
  return 0;
}

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

int main() {
  int a,b,c,d,e,k;
  int s;
  cin >> a >> b >> c >> d >> e >> k;
  
 vector<int> t(5);
  t={a,b,c,d,e};
  sort(t.begin(),t.end());
  if(t.at(4)-t.at(0)<=k) cout << "Yay!" << endl;
  else cout << ":(" << endl;
  
  return 0;
}

Measured memory_bytes: 256