akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS

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

typedef unsigned int uint;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef map<int, int> mii;
typedef pair<int, ii> edge;


#define sc(x)  scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mem(arr,val) memset(arr,val,sizeof arr)
#define sz(v) (int)v.size()
#define rsz(v) v.resize
#define clr(v) v.clear()
#define rev(v) reverse(all(v))
#define lop(i,end) for(int i=0; i<end; i++)
#define rlop(i,start) for(int i=start-1; i>=0; i--)
#define loop(i,start,end) for(int i=start; i<end; i++)
#define rloop(i,start,end) for(int i=start-1; i>=end; i--)
#define PB push_back
#define pb pop_back
#define mP make_pair
#define f first
#define s second

const ll OO = (ll)(4e18) + 9;
const int MOD = (int)(1e9) + 7;
const int oo = 2147483647;
const double EPS = 1e-8;
const double PI = acos(-1.0);

//enum dir { D, R, U, L , dr, ur, dl, ul };
int dx[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dy[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

string abc = "abcdefghijklmnopqrstuvwxyz";
string vowels = "aeiouy"; //and sometimes "aeiouy"

template<typename X, typename Y> bool ckmin(X& a, Y b) { return a > b ? a = b, true : false; }
template<typename X, typename Y> bool ckmax(X& a, Y b) { return a < b ? a = b, true : false; }
bool cklex(string &a, string b) {
	if (b == "") return false;
	if (a == "") return a = b, true;
	if (sz(a) < sz(b)) return false;
	if (sz(b) < sz(a)) return a = b, true;
	if (a < b) return false;
	return a = b, true;
}

int dcmp(ld d1, ld d2) { return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1; } //Compare Double Numbers
ll gcd(ll x, ll y) { return !y ? x : gcd(y, x%y); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
int conv_2_1(int r, int c, int nCol) { return (nCol*r) + c + 1; } //convert index from 2D array to 1D array. (Zero-indexed)
ii conv_1_2(int n, int nCol) { return{ n / nCol, n % nCol }; } //convert index from 1D array to 2D array (row, col). (Zero-indexed)
template<typename T> void inter(T X) { cout << X << endl; fflush(stdout); }



int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(false); cin.tie(NULL);

	int t = 1;
	//cin >> t;
	while (t--) {
		int h, w, k, ans = 0;
		cin >> h >> w >> k;
		vs mat(h);
		lop(i, h) cin >> mat[i];
		for (int nr = 0; nr < 1 << h; nr++) {
			for (int nc = 0; nc < 1 << w; nc++) {
				int cnt = 0;
				lop(i, h) lop(j, w) {
					if ((1 << i)&nr or (1 << j)&nc) continue;
					cnt += mat[i][j] == '#';
				}
				ans += cnt == k;
			}
		}
		cout << ans << endl;
	}


	return 0;
}


Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int h = sc.nextInt();
            int w = sc.nextInt();
            String line[] = new String[h];
            for(int i=0;i<h;i++){
              line[i] = sc.next();
            }

            int x[] = {0,0,1,-1};
            int y[] = {1,-1,0,0};

            
            for(int i=0;i<h;i++){
              for(int j=0;j<w;j++){
                if(line[i].charAt(j)=='#'){
                boolean check = false;
                for(int k=0;k<4;k++){
                  int dx = i+x[k];
                  int dy = j+y[k];
                  if(dx<0||dx>=h||dy<0||dy>=w) continue;
                  if(line[dx].charAt(dy)=='#') check = true;
                }
                if(!check){
                  System.out.println("No");
                  System.exit(0);
                 }
                }
              }
            }
          System.out.println("Yes");
          }
        }

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

int main(){
	int A, B, len;
	scanf("%d %d", &A, &B);
	char S[100];
	scanf("%s", &S);
	len = strlen(S);
	if(len != A+B+1){
		printf("No\n");
		return 0;
	}
	if(S[A] == '-'){
		for(int i=0; i<len; i++){
			if(i != A){
				if(S[i] < 48 || S[i] > 57){
					printf("No\n");
					return 0;
				}
			}
		}
		printf("Yes\n");
		return 0;
	}else{
		printf("No\n");
		return 0;
	}
	return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define VI vector<int>
#define VVI vector<vector<int>>
#define REP(i,n) for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 1e9
#define All(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;

int main(){
    ll H,W;
    ll n=2;
    cin>>H>>W;
    if(H==1||W==1){
        cout<<1<<endl;
        return 0;
    }
    ll ans=(H*W+1)/n;
    printf("%lld\n",ans);
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int card = Integer.parseInt(br.readLine());
		int turn = card;
		int win = 3;
		int drow = 1;
		int taropoint = 0;
		int hanakopoint = 0;

		for (int i = 0; i < turn; i++) {
			String str = null;
			str = br.readLine();
			String[] s = str.split(" ");
			String taro = (s[0]);
			String hanako = (s[1]);

			if(taro.compareTo(hanako) == 0){
				taropoint += drow;
				hanakopoint += drow;
			}else if(taro.compareTo(hanako) < 0){
				hanakopoint += win;
			}else{
				taropoint += win;
			}
		}
		System.out.println(taropoint + " " + hanakopoint);
	}
}

Measured memory_bytes: 25096
//
// Created by Tzyark on 2018/9/29.
//
#include <iostream>
using namespace std;
typedef long long ll;
ll a, b, x;
inline ll f(ll n) {
    if (-1 == n) {
        return 0;
    } else {
        return n/x + 1;
    }
}
int main() {
    cin >> a >> b >> x;
    cout << f(b) - f(a-1);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>

using namespace std;
typedef long long ll;
typedef pair<int,int> Pi;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) x.begin(), x.end()

int n, a, b;

struct point{
	point(){}
	point(ll x, ll y):x(x),y(y){}
	ll x, y; int c;
};
point p[100010], q[2][100010];
int vis[100010];
auto f1 = [](const point &a, const point &b)->bool{
	return a.x+a.y != b.x+b.y ? a.x+a.y < b.x+b.y : a.x < b.x;
};
auto f2 = [](const point &a, const point &b)->bool{
	return a.x-a.y != b.x-b.y ? a.x-a.y < b.x-b.y : a.x < b.x;
};

set <point, decltype(f1)> S1(f1);
set <point, decltype(f2)> S2(f2);

ll L;
ll ans;
int C[200020];

void dfs(int a){
	vis[a] = 1;
	S1.erase(p[a]); S2.erase(p[a]);
	while(1){
		auto e = S1.lower_bound(point(p[a].x, p[a].y+L));
		point y = point(p[a].x+L, p[a].y);
		if(e == S1.end() || f1(y, *e))break;
		dfs(e->c);
	}
	while(1){
		auto e = S1.lower_bound(point(p[a].x-L, p[a].y));
		point y = point(p[a].x, p[a].y-L);
		if(e == S1.end() || f1(y, *e))break;
		dfs(e->c);
	}
	while(1){
		auto e = S2.lower_bound(point(p[a].x-L, p[a].y));
		point y = point(p[a].x, p[a].y+L);
		if(e == S2.end() || f2(y, *e))break;
		dfs(e->c);
	}
	while(1){
		auto e = S2.lower_bound(point(p[a].x, p[a].y-L));
		point y = point(p[a].x+L, p[a].y);
		if(e == S2.end() || f2(y, *e))break;
		dfs(e->c);
	}
}

int get(int a){
	auto t1 = lower_bound(q[0]+1, q[0]+1+n, point(p[a].x, p[a].y+L), f1);
	auto t2 = lower_bound(q[0]+1, q[0]+1+n, point(p[a].x+L, p[a].y), f1);
	auto t3 = upper_bound(q[0]+1, q[0]+1+n, point(p[a].x-L, p[a].y), f1);
	auto t4 = upper_bound(q[0]+1, q[0]+1+n, point(p[a].x, p[a].y-L), f1);
	auto t5 = lower_bound(q[1]+1, q[1]+1+n, point(p[a].x-L, p[a].y), f2);
	auto t6 = lower_bound(q[1]+1, q[1]+1+n, point(p[a].x, p[a].y+L), f2);
	auto t7 = upper_bound(q[1]+1, q[1]+1+n, point(p[a].x, p[a].y-L), f2);
	auto t8 = upper_bound(q[1]+1, q[1]+1+n, point(p[a].x+L, p[a].y), f2);
	return (int)(t2-t1 + t4-t3 + t6-t5 + t8-t7);
}

void solve(){
	scanf("%d%d%d", &n, &a, &b);
	rep(i, n)scanf("%lld%lld", &p[i+1].x, &p[i+1].y), p[i+1].c = i + 1;
	for(int i=1;i<=n;i++)q[0][i] = q[1][i] = p[i], S1.insert(p[i]), S2.insert(p[i]);
	L = abs(p[a].x - p[b].x) + abs(p[a].y - p[b].y);
	sort(q[0]+1, q[0]+1+n, f1);
	sort(q[1]+1, q[1]+1+n, f2);
	dfs(a);
	ll ans = 0;
	for(int i=1;i<=n;i++)if(vis[i])ans += get(i);
	printf("%lld", ans/2);
}

int main(){
	int Tc = 1; //scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		solve();
	}
	return 0;
}

Measured memory_bytes: 26368
n = int(input())
dp = [[-1]*3 for _ in range(n+1)]

for i in range(3):
    dp[0][i] = 0

for i in range(n):
    a, b, c = map(int, input().split())
    dp[i+1][0] = max(dp[i][1]+a, dp[i][2]+a)
    dp[i+1][1] = max(dp[i][0]+b, dp[i][2]+b)
    dp[i+1][2] = max(dp[i][0]+c, dp[i][1]+c)

print(max(dp[n]))


Measured memory_bytes: 28680
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
ll A, B, C, K;

int main() {
  cin >> A >> B >> C >> K;

  if (K <= A) {
    cout << K;
    return 0;
  } else if (K <= A + B) {
    cout << A;
    return 0;
  } else {
    cout << A - (K - A - B);
  }
}


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

int main(){
    string a;
    cin>>a;
    cout<<a;
    int b=a.size();
    if(a.at(b-1)=='s'){
        cout<<"es";
    }else{
        cout<<"s";
    }
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define ROOP(i, N) for(int i=0; i++; i<N)
#define RVROOP(i, N) for(int i=N; i--; i>=0)
#define ALL(v) v.begin(), v.end()
const int INF = 1e9;
const int MAX = 510000;
const int MOD = 1000000007;
using namespace std;
typedef long long ll;

/*DP使ったほうがよくない？？WOWWOW*/

int main(){
  ll N, i=0, ans=0; cin>>N;
  for(int i=0; i<N; i++){
    if((i+1)%3!=0 && (i+1)%5!=0){
      ans+=(i+1);
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <cstdio>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;



#define INF 2000000000
#define MAX_V 10
const int MAX_N =10000000;


bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) x*=i;
    return x;
}

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

ll func(ll a,ll b,ll& ans_x,ll& ans_y){
    if(b == 0){
        ans_x = 1;
        ans_y = 0;
        return a;
    }else{
        ll ret = func(b,(a%b),ans_y,ans_x);
        ans_y -= (a/b)*ans_x;
        return ret;
    }
}

ll par[MAX_N],ranking[MAX_N];

void init(ll n){
    rep(i,n){
        par[i]=i;
        ranking[i]=0;
    }
}

ll find(ll x){
    if(par[x]==x) return x;
    else return par[x]=find(par[x]);
}

void unite(ll x,ll y){
    x=find(x);
    y=find(y);
    if(x==y) return;
    
    if(ranking[x]<ranking[y]) par[x]=y;
    else{
        par[y]=x;
        if(ranking[x]==ranking[y]) ranking[x]++;
    }
}

bool same(ll x,ll y){
    return find(x)==find(y);
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;
    cin>>n;
    vector<ll> ans(n+1,0);
        for(ll a=1;a<=n/6;a++){
            for(ll b=a;b<=n/6;b++){
                for(ll c=b;c<=n/6;c++){
                    if(a*a+b*b+c*c+a*b+b*c+a*c<=n){
                        if(a==b && b==c) ans[a*a+b*b+c*c+a*b+b*c+a*c]++;
                        else if(a!=b && b!=c && a!=c) ans[a*a+b*b+c*c+a*b+b*c+a*c]+=6;
                        else ans[a*a+b*b+c*c+a*b+b*c+a*c]+=3;
                    }
                }
            }
        }
        rrep(i,n) cout<<ans[i]<<endl;
    
    return 0;
}


Measured memory_bytes: 3668
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text.RegularExpressions;
using System.Threading;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long l = N % 10;
            if (l == 2 || l == 4 || l == 5 || l == 7 || l == 9)
            {
                Console.WriteLine("hon");
            }
            else if (l == 0 ||l==1||l==6||l==8)
            {
                Console.WriteLine("pon");
            }
            else if(l==3)
            {
                Console.WriteLine("bon");
            }


        }
    }
}

//文字列の入力
//string s = Console.ReadLine();
//整数の入力
//long n = long.Parse(Console.ReadLine());
//文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');
//整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

//Console.WriteLine();
//Console.ReadKey();


Measured memory_bytes: 27540
#include<iostream>

using namespace std;

int main(){
	int K,A,B;
  	cin>>K;
  	cin>>A>>B;

  	if(K==1 || K==A || K==B){
      cout<<"OK"<<endl;
      return 0;
    }

  	int rem = A%K;
    if(rem ==0)
      K=0;
  	if((A+K-rem)<=B)
      cout<<"OK"<<endl;
  	else
      cout<<"NG"<<endl;
}


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

using namespace std;

string v[] = {"Sunny", "Cloudy", "Rainy"};

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

    int p = 0;
    while(v[p] != x) p++;

    cout << v[(p + 1) % 3] << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
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>
vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts>
auto make_v(size_t a, Ts... ts)
{
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    ll N;
    cin >> N;
    N--;
    ll p = 1;
    int keta = 1;
    while (26*p <= N)
    {
        
        p *= 26;
        keta++;
        N-=p;
    }
    deque<char> ans(keta,'a');
    
    int i=0;
    do
    {
        int c = N % 26;
        ans[i] += c;
        N /= 26;
        i++;
    }while (N > 0);
    reverse(all(ans));
    for (auto &&i : ans)
    {
        cout << i;
    }

    return 0;
}

Measured memory_bytes: 3612
nm = input().split()
n = float(nm[0])
m = float(nm[1])
ans = 0
for i in range(10000):
    ans += ((1 - 0.5**m)**i) * (0.5**m) * ((1900 * m + 100 * (n - m)) * (i + 1))
print(round(ans))

Measured memory_bytes: 3188
#include "bits/stdc++.h"
using namespace std;

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
const int inf = 1000000001;
const ll INF = 1e18 * 4;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

#define N 300010
const int DAT_SIZE = (1 << 18) - 1;
vl dat(DAT_SIZE), datb(DAT_SIZE);

void add(int a, int b, ll x, int v, int l, int r) {
	if (a <= l && r <= b) {
		dat[v] += x;
	}
	else if (l < b && a < r) {
		datb[v] += (min(b, r) - max(a, l))*x;
		add(a, b, x, v * 2 + 1, l, (l + r) / 2);
		add(a, b, x, v * 2 + 2, (l + r) / 2, r);
	}
}

ll sum(int a, int b, int v, int l, int r) {
	if (r <= a || b <= l) {
		return 0;
	}
	else if (a <= l && r <= b) {
		return dat[v] * (r - l) + datb[v];
	}
	else {
		ll res = (min(b, r) - max(a, l)) * dat[v];
		res += sum(a, b, v * 2 + 1, l, (l + r) / 2);
		res += sum(a, b, v * 2 + 2, (l + r) / 2, r);
		return res;
	}
}


int main() {
	int n, m, i, j;
	scanf("%d%d", &n, &m);
	vi l(n), r(n);
	vii d(m + 3, vi());
	for (i = 0; i < n; i++) {
		scanf("%d%d", &l[i], &r[i]);
		d[r[i] - l[i] + 2].push_back(i);
	}
	int safe = n;
	for (int k = 1; k <= m; k++) {
		int res = 0;
		safe -= d[k].size();
		res += safe;
		for (i = 0; i < d[k].size(); i++) {
			add(l[d[k][i]], r[d[k][i]] + 1, 1, 0, 0, m + 1);
		}
		for (i = 1; k*i <= m; i++) {
			res = res + sum(k*i, k*i + 1, 0, 0, m + 1);
		}
		printf("%d\n", res);
			
	}
}

Measured memory_bytes: 12800
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair

#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
 
const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename A,typename B> istream& operator>>(istream&,pair<A,B>&);
template<typename A> istream& operator>>(istream&,vector<A>&);
void add(int&,int);
int mul(int,int);
int powz(int,int);
template<typename A> ostream& operator<<(ostream&,vector<A>&);
 
const int N=1000006;

int a[27],b[27];

void solve(){
	string s,t;
	cin>>s>>t;
	int flag=0;
	for(int i=0;i<t.length();i++){
		if(a[s[i]-'a'+1]==0&&b[t[i]-'a'+1]==0){
			a[s[i]-'a'+1]=t[i]-'a'+1;
			b[t[i]-'a'+1]=s[i]-'a'+1;
		}
		else if(a[s[i]-'a'+1]!=(t[i]-'a'+1)||(b[t[i]-'a'+1]!=s[i]-'a'+1)){
			flag++;
		}
	}
	if(flag)cout<<"No\n";
	else cout<<"Yes\n";	
}
	
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int tc=1;
	//~ cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}
 
int mul(int a,int b)
{
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
	if(a<0)a+=mod;
}
 
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)res=mul(res,a);
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
	    output<<i<<' ';
	return output;	
}


Measured memory_bytes: 916
#include<bits/stdc++.h>
using namespace std;
int main(void){

  string s, t;  cin >> s >> t;
  int count = 0;
  for(int i = 0 ; i < s.length() ; i++)
    if(s[i] == t[i])  count++;
  
  cout << s.length() - count << endl;
  return 0;
}

Measured memory_bytes: 3872
n, x, y = map(int, input().split())
ans = [0]*n
for i in range(1, n):
    for j in range(i+1, n+1):
        distance_ij = min(abs(j-i), abs(x-i)+1+abs(j-y), abs(y-i)+1+abs(j-x))
        ans[distance_ij-1] += 1

for i in range(n-1):
    print(ans[i])

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

namespace Main
{
    public static class Program
    {

        static void Main(string[] arg)
        {
            var answer = 0;
            List<char> chlist = new List<char>();
            var ch = Console.ReadLine().ToCharArray();
            chlist.AddRange(ch);
            int zero = chlist.Count(value => value == '0');
            int one = chlist.Count(value => value == '1');
            answer = chlist.Count() - Math.Abs(zero - one);


            Console.WriteLine(answer);
            Console.ReadLine();

        
        }
        #region libraries
        private static int[] GetIntList(string line)
        {
            return line.Split(' ').Select(x => int.Parse(x)).ToArray();

        }
        private static double[] GetDoubleList(string line)
        {
            return line.Split(' ').Select(x => double.Parse(x)).ToArray();

        }
        private static int SearchNearest(this IEnumerable<int> list, int target)
        {
            var min = list.Min(c => Math.Abs(c - target));
            return list.First(c => Math.Abs(c - target) == min);
        }
        public static int Gcd(int a,int b)
        {
            if(a < b)
            {
                Gcd(b, a);
            }
            while (b != 0)
            {
                var rm = a % b;
                a = b;
                b = rm;
            }
            return a;
        }
        #endregion
    }
}


Measured memory_bytes: 14048
import java.util.Scanner;

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

	String o = scan.next();
	String e = scan.next();

	String ans = "";
	for(int i = 0; i < e.length()*2; i++){
	    if(i % 2 == 0){
		ans += o.charAt(i/2);
	    }else{
		ans += e.charAt(i/2);
	    }
	}

	if(o.length() > e.length()){
	    ans += o.charAt(o.length()-1);
	}

	System.out.println(ans);
    }
}

	


Measured memory_bytes: 21716
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val k = sc.nextInt()
    var cur = 1
    repeat(n) {
        if (cur * 2 >= cur + k) {
            cur += k
        } else {
            cur *= 2
        }
    }
    println(cur)
}

Measured memory_bytes: 31264
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

def solve():
    n = II()

    ans = 0
    for i in range(n+1):
        if i % 2 == 0: continue
        cnt = 1
        for j in range(2, i+1):
            if i % j: continue
            cnt += 1
        if cnt == 8:
            ans += 1
        # print(i, cnt)
    print(ans)



if __name__ == '__main__':
    solve()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
typedef pair<pll, pll> P;
const ll INF = 1ll<<30;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int N;
int A[1000][1000];
bool done[1000][1000];
int pos[1000], icnt[1000];
bool used[1000];

int main() {
	cin >> N;
	REP(i, N) REP(j, N - 1) scanf("%d", &A[i][j]), A[i][j]--;
	
	vector<int> v;
	REP(i, N) v.push_back(i);
	
	int ans = 0, totalcnt = 0;;
	while (!v.empty()) {
		bool ok = false;
		
		REP(i, v.size()) if (!used[v[i]]) {
			int u = A[v[i]][pos[v[i]]];
			if (A[u][pos[u]] == v[i]) {
				used[v[i]] = used[u] = true;
			}
		}
		
		vector<int> nextv;
		REP(i, v.size()) {
			if (used[v[i]]) {
				int u = A[v[i]][pos[v[i]]];
				
				pos[v[i]]++;
				if (pos[v[i]] == N - 1) totalcnt++;
				else nextv.push_back(v[i]);
				ok = true;
				
				pos[u]++;
				if (pos[u] == N - 1) totalcnt++;
				else nextv.push_back(u);
				
				
				used[v[i]] = used[u] = false;
			}
		}
		if (!ok) break;
		v = nextv;
		ans++;
	}
	if (totalcnt < N) ans = -1;
	cout << ans << endl;
	
	return 0;
}


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

int h,w;
int n;
vector<int> a(100001);
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
vector<vector<int> > c(100,vector<int>(100,0));

int main(){

    cin >> h >> w;

    cin >> n;

    rep(i,n){
        cin >> a[i];
    }
    int cid=0;
    int d=0;
    int nx=0,ny=0;
    for(int i=0;i<h*w;i++){
        if(a[cid]==0){
            cid++;
        }
        c[ny][nx]=cid+1;
        a[cid]--;
        if(nx+dx[d]>=w||ny+dy[d]>=h||nx+dx[d]<0){
            d++;
        }else if(ny+dy[d]<0){
            d=0;
        }
        if(c[ny+dy[d]][nx+dx[d]]!=0){
            d++;
            d%=4;
        }
        nx+=dx[d];
        ny+=dy[d];
    }

    rep(i,h){
        rep(j,w){
            cout << c[i][j] << " ";
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 768
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[m];
        for(int i = 0 ; i < m ; i++ ){
            a[i] = sc.nextInt();
            n -= a[i];
        }
        if(n < 0){
            System.out.println(-1);
        }else{
            System.out.println(n);
        }
        sc.close();
    }
}

Measured memory_bytes: 46204
import java.util.Scanner;

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

        int l = Integer.MAX_VALUE / 2, r = -1;
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
            l = Math.min(l, x[i]);
            r = Math.max(r, x[i]);
        }
        long min = Integer.MAX_VALUE / 2;
        for (int i = l; i <= r; i++) {
            long d = 0;
            for (int j = 0; j < n; j++) {
                d += Math.pow(i - x[j], 2);
            }
            min = Math.min(min, d);
        }
        System.out.println(min);
    }
}

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

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define len(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "YES" << endl
#define pyes cout << "Yes" << endl
#define POK cout << "OK" << endl
#define PNO cout << "NO" << endl
#define pno cout << "No" << endl
#define PNG cout << "NG" << endl
#define ret return 0

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>

signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  map<ll, ll> a;
  for (int x = 1; x < 105; x++) {
    for (int y = 1; y < 105; y++) {
      for (int z = 1; z < 105; z++) {
        int v = (x + y + z) * (x + y + z) + x * x + y * y + z * z;
        v /= 2;
        a[v]++;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a.count(i) > 0)
      cout << a[i] << endl;
    else
      cout << 0 << endl;
  }
  ret;
}


Measured memory_bytes: 6224
#include <iostream>
#include <string>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

int N, Q;
std::string S;
int T[100010];

int main()
{
  std::cin >> N >> Q >> S;

  rep( i, N )
  {
    if( i > 0 && S[i-1] == 'A' && S[i] == 'C' )
      T[i+1] = T[i]+1;
    else
      T[i+1] = T[i];
  }

  rep( i, Q )
  {
    int l, r;
    scanf( "%d%d", &l, &r );
    
    printf( "%d\n", T[r]-T[l] );
  }

  return 0;
}

Measured memory_bytes: 1408
#include <stdio.h>
#include <string.h>
int main(void) {
    char w[11];
    scanf("%s\n", w);

    int count = 0;
    char t[1001];
    while(scanf("%s\n", t) && strcmp(t, "END_OF_TEXT") != 0) {
        count += (strcasecmp(w, t) == 0);
    };
    printf("%d\n", count);
}


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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

using ll = long long;
#define INF 1e9

int N, M;
vector<int> A, B;

int main(){
  cin >> N >> M;
  A.resize(N), B.resize(N);
  vector<vector<int>> p(100001);
  priority_queue<pair<int, int>> que;
  REP(i, N){
    cin >> A[i] >> B[i];
    if(A[i] <= M){
      p[A[i]].push_back(B[i]);
    }
  }
  FOR(i, 1, M+1){
    sort(p[i].begin(), p[i].end());
  }
  ll ans = 0;
  FOR(i, 1, M+1){
    if(p[i].size()){
      que.push(make_pair(p[i].back(), i));
      p[i].pop_back();
    }
    if(!que.empty()){
      //cout << que.top().first << " " << que.top().second << endl;
      ans += que.top().first;
      int idx = que.top().second;
      que.pop();
      if(p[idx].size()){
        que.push(make_pair(p[idx].back(), idx));
        p[idx].pop_back();
      }
    }
  }

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


Measured memory_bytes: 6400
import fractions
nx=input().split()
N=int(nx[0]);X=int(nx[1])
xs=input().split()
xs=[int(x) for x in xs]
xs.append(X)
xs.sort()
n=xs[0]
xs.remove(n)
t=[]
for i in xs:
    t.append(i-n)
    n=i
count=t[0]
t.remove(count)
for j in t:
    count=fractions.gcd(count,j)
print(str(count))


Measured memory_bytes: 16280
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
        int N = S.length();

        int h = 2019;
        int[] dp = new int[h];
        long ans = 0;

        for (int i = 1; i <= N; i++) {
            int[] nextDp = new int[h];
            int now = S.charAt(i-1);
            now -= 48;

            nextDp[now] += 1;
            for (int k = 0; k < h; k++) {
                int n = (k * 10 + now) % h;
                nextDp[n] += dp[k];
            }
            ans += nextDp[0];
            dp = nextDp;
        }
        
		// 出力
        System.out.println(ans);
	}
}


Measured memory_bytes: 46992
N,K = (int(x) for x in input().split())
S = list(input())
size = [1]
memo = S[0]
for i in range(1,N):
    if S[i] == memo:
        size[-1] += 1
    else:
        memo = S[i]
        size += [1]

if S[0] == '0':
    size = [0] + size
if S[-1] == '0':
    size += [0]

if int((len(size)-1)/2) <= K:
    print(N)
else:
    ans = sum(size[0:K*2+1])
    a = ans
    for i in range(2,len(size)-(K*2))[::2]:
        a = a - (size[i-2] + size[i-1]) + (size[i+K*2-1] + size[i+K*2])
        if ans < a:
            ans = a
    print(ans)


Measured memory_bytes: 5560
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
int main(){
    long long n, m, ans=0, i;
    map<long long, long long> mp;
    cin >> n >> m;
    dsu d(n);
    for(i=0;i<m;i++){
        long long a, b;
        cin >> a >> b;
        a--;b--;
        d.merge(a, b);
    }
    for(i=0;i<n;i++){
        mp[d.leader(i)]++;
    }
    for(auto x : mp){
        ans++;
    }
    cout << ans-1 <<endl;
    return 0;
}

Measured memory_bytes: 8860
#include <stdio.h>

int main(){
  int A[1000],i,v,j,N,f;

  scanf("%d\n",&N);
 
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }

  for(i=0;i<N-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d\n",A[N-1]);
  
  for(i=1;i<=N-1;i++){
    v = A[i];
    j = i - 1;

    while(j >=0 && A[j]>v){
      A[j+1] = A[j];
      j = j - 1;
      A[j+1]=v;
    }
    for(f=0;f<N-1;f++){
      printf("%d ",A[f]);
    }
    printf("%d\n",A[N-1]);
  }
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int MOD = 1000000007;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
  ll a, b;
  cin >> a >> b;
  if(b%a==0){
    print(a + b);
  }
  else{
    print(b - a);
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
 
int main(){
  int cnt=0;
 
  string s,t;
  cin >> s;
  cin >> t;
    
  if(s[0]==t[0]) ++cnt;
  if(s[1]==t[1]) ++cnt;
  if(s[2]==t[2]) ++cnt;
 
  cout << cnt << endl;
}

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

int main() {
	int N, Y;
	cin >> N >> Y;
	int res10000 = -1, res5000 = -1, res1000 = -1;
	for (int x = 0; x <= N; ++x) {
		for (int y = 0; y + x <= N; ++y) {
			int z = N - x - y;
			int sum = 10000 * x + 5000 * y + 1000 * z;
			if (sum == Y) {
				res10000 = x;
				res5000 = y;
				res1000 = z;
			}
		}
	}

	cout << res10000 << " " << res5000 << " " << res1000 << endl;

}

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

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

  int n; cin >> n;
  vector<int> a(n + 2);
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  int s = 0;
  for (int i = 0; i < n + 1; i++) {
    s += abs(a[i+1] - a[i]);
  }
  for (int i = 1; i < n + 1; i++) {
    int res;
    if (a[i-1] <= a[i] && a[i] <= a[i+1]) res = s;
    else if (a[i-1] >= a[i] && a[i] >= a[i+1]) res = s;
    else res = s - 2 * min(abs(a[i] - a[i-1]), abs(a[i+1] - a[i]));
    cout << res << '\n';
  }
  return 0;
}

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

using namespace std;

int main(void) {
	int N;
	cin >> N;
	vector<string> rc, blue;

	string s;
	int i;
	for (i = 0; i < N; i++) {
		cin >> s;
		rc.push_back(s);
		blue.push_back(s);
	}

	sort(rc.begin(), rc.end());
	rc.erase(unique(rc.begin(), rc.end()), rc.end());

	int M;
	cin >> M;
	vector<string> red;
	for (i = 0; i < M; i++) {
		cin >> s;
		red.push_back(s);
	}

	int prof_max = 0;
	string st;
	for (string s : rc) {
		int prof = 0;
		for (string st : blue) {
			if (s == st) {
				++prof;
			}
		}

		for (string st : red) {
			if (s == st) {
				--prof;
			}
		}

		if (prof_max < prof) {
			prof_max = prof;
		}
	}

	cout << prof_max << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define co(i) cout << i << endl;
#define co2(i,j) cout << i << " " << j << endl;
#define co3(i) cout << i << " ";
#define po(i) cout << i.first << " " << i.second << endl;
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod, digitDP, treeDP//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv, doubling//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal, RMQ, LCA//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007, INF = 1LL << 60, ans = 0, z = 0, o = 1;
vl flag, D; vll path;
//***********//
int main() {
	cin >> N;
	vl Ans(N);
	for (i = 1; i <= 110; i++) {
		for (j = 1; j <= 110; j++) {
			for (k = 1; k <= 110; k++) {
				ll pre = (i + j) * (i + j) + (j + k) * (j + k) + (k + i) * (k + i);
				if (pre % 2 == 0 && pre<=2*N) {
					Ans[pre / 2 - 1]++;
				}
			}
		}
	}
	for (i = 0; i < N; i++) {
		co(Ans[i]);
	}
}

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

using namespace std;

#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void ZZ(const char* name, Arg1&& arg1){std::cerr << name << " = " << arg1 << endl;}
template <typename Arg1, typename... Args>void ZZ(const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}

#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define endl '\n'

int n, t;

int main()
{
	IOS;
	cin >> n >> t;
	int m = 1e9;
	for (int i = 0; i < n; i++) {
		int c, d;
		cin >> c >> d;
		if (d <= t && c < m)
			m = c;
	}
	(m == 1e9) ? cout << "TLE\n" : cout << m << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;


//      DEEP

using namespace std;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define all(v) v.begin(),v.end()
#define pb push_back
#define endl '\n'
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pi;
typedef pair<long long,long long> pll;
typedef set<int> si;


/*
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
*/
/*
typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_set;
*/

const ll mod = 1e9 + 7;
const ll modl=998244353;
const double pie=3.1415926535;
                                                    //power
ull power(ull x,ull y){
   if(y==0) return 1;
   else{
     if(y%2==0) return power(x*x,y/2);
     else return x*power(x*x,(y-1)/2);
   }
}

                        //                    Modular Exponentiation

ll mod_power(ll x, ll y, ll m)
{
    ll r = 1;     // Initialize result

    x = x % m; // Update x if it is more than or equal to m

    if (x == 0) return 0; // In case x is divisible by m;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            r = (r*x) % m;

        // y must be even now
        y = y/2;
        x = (x*x) % m;
    }
    return r;
}

                                                      //GCD
ll gcd(ll x,ll y){
   if(y==0)return x;
   return gcd(y,x%y);
}
                                              // SIEVE

/*
bool isPrime[100001];
void sieve(int N) {

        for(int i = 0; i <= N;++i) {
            isPrime[i]=true;
        }
        isPrime[0]=false;
        isPrime[1]=false;

        for(int i = 2; i * i <= N; ++i) {
             if(isPrime[i] == true) {
                 for(int j = i * i; j <= N ;j += i)
                     isPrime[j] = false;
            }
        }
    }
*/
/*
vector<set<int> >adj;
//vector<set<int> >indegree;
vector<int>ans;
vector<int>visited;
int n,m;
int dfs(int x){
  visited[x]=1;
  if(x==4){
      ans[x]=1;
      //visited[x]=2;
  }else{
    for(int i : adj[x]){
      if(visited[i]==-1){
        dfs(i);
      }
       ans[x]+=ans[i];
       ans[x]%=mod;
    }
  }
 // visited[x]=2;
  return ans[x];
}
*/

int main(){
    boost;
    int TESTS=1;
   // cin>>TESTS;
    while(TESTS--){
        ll r,d,x;
        cin>>r>>d>>x;
        for(int i=1;i<=10;i++){
          cout<<r*x-d<<endl;
          x=r*x-d;
        }
    }
}











Measured memory_bytes: 3620
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <queue>
#include <vector>
#include <cstdlib>
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
const int DMAX=100000+5;
const int MOD=1000000000+7;
template<class T> inline void read(T &x){
	x=0;
	T f=1;
	char ch=getchar();
	while(ch<'0' || ch>'9'){
		if(ch=='-'){
			f=-1;
		}
		ch=getchar();
	}
	while(ch<='9' && ch>='0'){
		x=x*10+(ch-'0');
		ch=getchar();
	}
	x*=f;
}

ll n,m;
int main(){
	read(n),read(m);
	if(n==0 || n==m){
		cout<<0<<endl;
		return 0;
	}
	cout<<min(n%m,m-(n%m))<<endl;
	return 0;
}

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

using namespace std;

using ll = long long;

template<typename T> using V = std::vector<T>;
using Vi = V<int>;
using VVi = V<V<int>>;
using Vl = V<ll>;
using VVl = V<V<ll>>;
using Vs = V<string>;

template<typename T1, typename T2> using P = std::pair<T1, T2>;
using Pii = P<int, int>;
using Pll = P<ll, ll>;
using Pdd = P<double, double>;

template<typename T1, typename T2> using M = std::map<T1, T2>;
using Mii = M<int, int>;
using Msi = M<string, int>;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define REP2(i,s,e) for(int i=(int)(s);i<(int)(e);++i)
#define RREP(i,s,e) for(int i=(int)(s);i>=(int)(e);--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin(),ie=(c).end();i!=ie;++i)
#define ALL(c) (c).begin(), (c).end()

const double PI = acos(-1);
const ll MOD = 1e9+7;

ll n, k;
// string s;

int main() {
    cin >> n >> k;
    Vl a(n);
    REP(i, n) cin >> a[i];

    Vl cnt(40, 0);
    REP(i, n) {
        bitset<40> A(a[i]);
        REP(j, 40) if (A[j]) cnt[j]++;
    }

    bitset<40> K(k+1);
    ll maxi = 0, buf = 0;
    RREP(i, 39, 0) {
        if (!K[i]) {
            buf += cnt[i] * (1LL << i);
            continue;
        }
        ll sum = buf;
        sum += cnt[i] * (1LL << i);
        RREP(j, i-1, 0) {
            sum += max(cnt[j], n - cnt[j]) * (1LL << j);
        }
        maxi = max(maxi, sum);

        buf += (n - cnt[i]) * (1LL << i);
    }
    cout << maxi << '\n';

    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>
#include<ext/pb_ds/priority_queue.hpp>
using namespace std;

const int maxn = 1E5 + 10;

int N,L,T,d,A[maxn];

int pre(int x) {return x == 1 ? N : x - 1;}
int nex(int x) {return x == N ? 1 : x + 1;}

int main()
{
	#ifdef DMC
		freopen("DMC.txt","r",stdin);
	#endif
	
	cin >> N >> L >> T;
	for (int i = 1; i <= N; i++)
	{
		int x,w; scanf("%d%d",&x,&w);
		if (w == 1)
		{
			int dt = T;
			if (L - x <= dt)
				dt -= (L - x),++d,x = 0;
			x += dt; d += dt / L; x %= L;
		}
		else
		{
			int dt = T;
			if (x + 1 <= dt)
				dt -= (x + 1),--d,x = L - 1;
			x -= dt; d -= dt / L; x %= L;
			if (x < 0) x += L;
		}
		A[i] = x; d %= N;
	}
	int pos = 1; d %= N;
	while (d < 0) pos = pre(pos),++d;
	while (d > 0) pos = nex(pos),--d;
	sort(A + 1,A + N + 1);
	for (int i = pos; i <= N; i++) printf("%d\n",A[i]);
	for (int i = 1; i < pos; i++) printf("%d\n",A[i]);
	return 0;
}

Measured memory_bytes: 1536
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include <string>
#include <numeric>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
map<int, int> mp;
map<int, int>mm;
#define ll long long
#define ld long double
#define PI 3.14159265358979l

unsigned gcd(unsigned a, unsigned b) {
	if (a < b) gcd(b, a);
	unsigned r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}
	


int main() {
	string s[10000];
	int n;
	cin >> n;
	rep(i, n) {
		cin >> s[i];
	}
	int ac = 0;
	int ans = 0;
	int bc = 0;
	int cc = 0;
	rep(i, n) {
		int size = s[i].size();
		if (s[i][0] == 'B')bc++;
		if (s[i][size - 1] == 'A')ac++;
		if (s[i][0] == 'B'&&s[i][size - 1] == 'A')cc++;
		rep(j, size - 2) {
			if (s[i][j] == 'A'&&s[i][j + 1] == 'B') {
				ans++;
			}
		}
	}
	if (ac > cc&&cc > 0) {
		ac--;
		ans++;
	}
	if (bc > cc&&cc > 0) {
		bc--;
		ans++;
	}
	if (cc > 0) {
		ans += (cc - 1);
	}
	ac -= cc;
	bc -= cc;
	ans += min(ac, bc);
	cout << ans << endl;
	cin >> n;
}

Measured memory_bytes: 768