akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include <set>
#include <cassert>
#include<cmath>
#include<climits>
#include<iomanip>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
const long long INF = 1LL << 60;


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

class UnionFind {
	vector<int> data;
public:
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int find(vector<long long> &arr, long long obj) {
	if (arr[arr.size() - 1] < obj)return arr.size()-1;
	if (arr[0] > obj)return -1;

	int min = 0; int max = arr.size() - 1;
	for (int i = 0; i < arr.size(); i++) {
		if (arr[min+(max-min) / 2] > obj) {
			max = min + (max - min) / 2;
		}
		else {
			min = min + (max - min) / 2;
		}
		if (max - min == 1) {
			return min;
		}
	}


}

//約数求める //約数
void divisor(ll n,vector<ll> &ret) {
	for (ll i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			ret.push_back(i);
			if (i * i != n) ret.push_back(n / i);
		}
	}
	sort(ret.begin(), ret.end());
	
}
//階乗
long long factorial(long long n, long long mod) {
	long long ret = 1;
	for (long long i = 1; i <= n; i++) {
		ret = (ret * i) % mod;
	}
	return ret;
}
//モジュラ逆数
long long inv_mod(long long n, long long mod) {
	long long a = n % mod, b = mod - 2, ret = 1;
	while (b > 0) {
		if (b & 1) ret = (ret * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return ret;
}

long long nPr(long long n, long long r, long long mod) {
	long long ret = 1;
	for (long long i = n; i >= n - r + 1; i--) {
		ret = ret * (i % mod) % mod;
	}
	return ret;
}

long long nCr(long long n, long long r, long long mod) {
	return nPr(n, r, mod) * inv_mod(factorial(r, mod), mod) % mod;
}

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

bool compare_by_a(pair<ll, ll> a, pair<ll, ll> b) {//降順first
	if (a.first != b.first) {
		return a.first > b.first;
	}
	else {
		return a.second > b.second;
	}
}

ll gcd(ll m, ll n){
	if (n == 0)return m;
	return gcd(n, m%n);
}//gcd


int main() {
	ll n, m;
	cin >> n >> m;
	if (n == m) {
		cout << n * 2;
	}else if (n > m) {
		cout << n * 2 - 1;
	}
	else {
		cout << m * 2 - 1;
	}
	return 0;
}


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

int main(){
 long long int n,sum=0,ave;cin>>n;long long int a[n],b[n],f[3];f[0]=f[1]=f[2]=0;
  for(long long int i=0;i<n;i++){
    cin>>b[i]; a[i]=b[i]-i-1;sum+=a[i];//cout<<a[i]<<endl;;
  }
  sort(a,a+n);
  ave=a[n/2];//cout<<ave;
  
   for(long long int i=0;i<n;i++){
     f[0]+=abs(a[i]-ave);
       
   //  cout<<f[0]<<endl;
   }
  ave+=1;
    for(long long int i=0;i<n;i++){
     f[1]+=abs(a[i]-ave);
   }
  ave+=-2;
    for(long long int i=0;i<n;i++){
     f[2]+=abs(a[i]-ave);
   }
  
  cout<<min(min(f[0],f[1]),f[2])<<endl;
  
  //cout<<ave<<endl<<f[0]<<endl<<f[1]<<endl<<f[2];
  
  
  
 }


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#include <iostream>
#include <math.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n),b(n),c(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i) >> b.at(i);
    c.at(i) = b.at(i);
  }
  sort(b.begin(),b.end());
  int ans;
  for(int i=0;i<n;i++){
    if(b.at(0) == c.at(i)){
      ans = a.at(i);
      break;
    }
  }
  cout << ans + b.at(0)  << endl;
  
  return 0;
}

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

const int N = 2005, mod = 924844033;
typedef long long LL;

void reduce(int &x) { x += x >> 31 & mod; }

int n, k, dp[N][N], max, f[N];
void calc(int n) {
	dp[0][0] = 1;
	dp[1][1] = 1;
	dp[2][0] = 1;
	dp[2][1] = 2;
	dp[2][2] = 1;
	
	for (int i = 3; i <= n; ++i) {
		for (int j = 0; j <= i; ++j) {
			int &ret = dp[i][j] = dp[i - 1][j];
			if (j) reduce(ret += dp[i - 1][j - 1] - mod);
			if (i > 1) reduce(ret += dp[i - 2][j] - mod);
			if (i > 1 && j) reduce(ret += dp[i - 2][j - 1] - mod);
			if (i > 2) reduce(ret -= dp[i - 3][j]);
		}
	}
}
void update(int *A) {
	static int B[N];
	for (int i = 0; i <= n; ++i) B[i] = 0;
	for (int i = 0; i <= max; ++i)
		for (int j = 0; j <= n - i; ++j)
			B[i + j] = (B[i + j] + (LL) A[i] * f[j]) % mod;
	for (int i = 0; i <= n; ++i) f[i] = B[i];
}
int main() {
	std::ios::sync_with_stdio(0), std::cin.tie(0);
	std::cin >> n >> k, calc(max = (n + k - 1) / k);
	int t = (n - 1) % k + 1;
	f[0] = 1;
	for (int i = 0; i < t; ++i) update(dp[max]);
	for (int i = t; i < k; ++i) update(dp[max - 1]);
	int factor = 1, ans = 0;
	for (int i = 0; i <= n; ++i) {
		if (n - i & 1)
			reduce(ans -= (LL) f[i] * factor % mod);
		else
			ans = (ans + (LL) f[i] * factor) % mod;
		factor = (LL) factor * (i + 1) % mod;
	}
	std::cout << ans << '\n';
	return 0;
}

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

int main() {
  long long n, m, k;
  cin >> n >> m >> k;
  //int a[n], b[m];
  vector<long long> a(n), b(m);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (i) a[i] += a[i-1];
  }
  for (int i = 0; i < m; ++i) {
    cin >> b[i];
    if (i) b[i] += b[i-1];
  }
  long long ans(0);
  for (int i = 0; i < n; ++i) {
    long long f = k - a[i];
    if (f < 0) break;
    auto it = upper_bound(b.begin(), b.end(), f);
    long long x = distance(b.begin(), it);
    ans = max(i + 1 + x, ans);
  }
  for (int i = 0; i < m; ++i) {
    long long f = k - b[i];
    if (f < 0) break;
    auto it = upper_bound(a.begin(), a.end(), f);
    long long x = distance(a.begin(), it);
    ans = max(i + 1 + x, ans);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 6360
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
const ll inf = LLONG_MAX;
long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

bool is_ok(ll n) {
  string s = to_string(n);
  ll m = s.size();
  for (ll i = 1; i < m; i++) {
    if (abs(s[i] - s[i - 1]) > 1) return false;
  }
  return true;
}

int main() {
  ll k;
  cin >> k;

  vector<string> dp(k);
  dp[0] = "1";
  for (ll i = 1; i < k; i++) {
    if (is_ok(stoll(dp[i - 1]) + 1)) dp[i] = to_string(stoll(dp[i - 1]) + 1);
    else {
      string s = dp[i - 1];
      ll n = s.size();
      for (ll j = 0; j < n - 1; j++) {
        if (s[n - 1 - j] <= s[n - 2 - j] && s[n - 1 - j] != '9') {
          s[n - 1 - j]++;
          for (ll l = n - 1 - j + 1; l < n; l++) {
            s[l] = max('0', (char)(s[l - 1] - 1));
            if (s[l] == '0') break;
          }
          break;
        }
        else {
          s[n - 1 - j] = '0';
          if (j == n - 2) {
            if (s[0] == '9') {
              s[0] = '1';
              for (ll x = 1; x < n; x++) s[x] = '0';
              s.push_back('0');
            }
            else {
              s[0]++;
              for (ll x = 1; x < n; x++) {
                s[x] = max('0', (char)(s[x - 1] - 1));
                if (s[x] == '0') break;
              }
            }
          }
        }
      }
      dp[i] = s;
    }
    //cout << dp[i] << endl;
  }
  cout << dp[k - 1] << endl;
}

Measured memory_bytes: 5760
"use strict";
function Main(input) {
    let lines = input.split("\n");
    let nw = lines.shift().split(/\s/).map((v) => v - 0);
    let N = nw[0] - 0, W = nw[1] - 0, V = 100000;
    let weight = new Array(N), value = new Array(N);
    for (let n = 0; n < N; n++) {
        let wv = lines.shift().split(/\s/).map((v) => v - 0);
        weight[n] = wv[0];
        value[n] = wv[1];
    }
    let dp = new Array(N + 1).fill(0).map(() => new Array(V + 1).fill(Number.MAX_SAFE_INTEGER));
    dp[0][0] = 0;
    for (let n = 0; n < N; n++) {
        for (let sum_v = 0; sum_v <= V; ++sum_v) {
            if (sum_v - value[n] >= 0) {
                dp[n + 1][sum_v] = Math.min(dp[n + 1][sum_v], dp[n][sum_v - value[n]] + weight[n]);
            }
            dp[n + 1][sum_v] = Math.min(dp[n + 1][sum_v], dp[n][sum_v]);
        }
    }
    let ans = 0;
    for (let sum_v = 0; sum_v <= V; ++sum_v) {
        if (dp[N][sum_v] <= W) ans = sum_v;
    }
    console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 122112
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int X = sc.nextInt();
        
//        500, 100, 50
        int pattern = 0;
        for (int i = 0; i <= A; i++) {
            for (int j = 0; j <= B; j++) {
                for (int k= 0; k <= C; k++) {
                    if(X == 500*i + 100*j + 50*k) {
                        pattern++;
                    }
                }
            }
        }
        System.out.println(pattern);
    }
}


Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;

int main() {

	int n, x, y; cin >> n >> x >> y;
    x--;
    y--;

    // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(n);
    for (int i = 0; i <= n - 2; ++i) {
        int a, b;
        a = i;
        b = i + 1;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    G[x].push_back(y);
    G[y].push_back(x);

    vector<int> ans(n, 0);
    vector<vector<int>> dist_c(n, vector<int>(n, 0));

    for (int start = 0; start < n; start++) {

        // BFS のためのデータ構造
        vector<int> dist(n, -1); // 全頂点を「未訪問」に初期化
        queue<int> que;

        // 初期条件 (頂点 0 を初期ノードとする)
        dist[start] = 0;
        que.push(start); // 0 を橙色頂点にする

        // BFS 開始 (キューが空になるまで探索を行う)
        while (!que.empty()) {
            int v = que.front(); // キューから先頭頂点を取り出す
            que.pop();

            // v から辿れる頂点をすべて調べる
            for (int new_v : G[v]) {
                if (dist[new_v] != -1) continue; // すでに発見済みの頂点は探索しない

                // 新たな白色頂点 new_v について距離情報を更新してキューに追加する
                dist[new_v] = dist[v] + 1;
                que.push(new_v);

                dist_c[start][new_v] = dist[new_v];
            }
        }

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

Measured memory_bytes: 19436
#include<bits/stdc++.h>
#define pb push_back
#define mod 1000000007
#define mkp make_pair
#define fi first
#define se second
#define ll long long
#define scan(n) ll a[n]; for(ll i = 0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define fast ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define rep(i,x,y) for(ll i=x;i<y;i++)
//#define int long long
using namespace std;
//typedef vector<int>vi ;
typedef vector<ll>vi ;
typedef vector<vector<ll> >vvl ; 
typedef pair<ll,ll> pll ;
typedef vector<pair<ll,ll> > vpll;
/*vi adj[200005];
ll vis[200005];
ll parent[200005];
ll level[200005];
ll arr[200005];
ll size[200005];*/
//endl mut bhool!!
int main()
{
	fast;
	ll test=1;
	//cin>>test;
	while(test--)
	{
		ll a,b,c,k;
		cin>>a>>b>>c>>k;
		if(k<=a)
		{
			cout<<k;
			continue;
		}
		if(k>a && k<=a+b)
		{
			cout<<a;
			continue;
		}
		if(k>a+b && k<=a+b+c)
		{
			cout<<2*a-k+b;
		}
		else
		{
			cout<<a-c;
		}

	}
	return 0;
}
/*
cout<<"YES"<<endl;
cout<<"NO"<<endl;
*/

Measured memory_bytes: 3640
#include <bits/stdc++.h>
typedef long long ll;
#define fi first
#define se second
#define mem(a,b) memset(a,b,sizeof(a))
#define pb push_back
using namespace std;
const int maxn = 100005;
int cnt1, cnt2, cnt4;
int a[maxn];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(a[i] % 4 == 0){
            cnt4++;
            continue;
        }
        if(a[i] %2 == 0){
            cnt2++;
            continue;
        }
        else cnt1++;
    }
    if(cnt4 >= cnt1) 
        {
            cout << "Yes\n";
            return 0;
        }
    if(cnt4 == cnt1 - 1){
        if(cnt2 == 0)
            {cout << "Yes\n";return 0;}
    }
    cout << "No\n";
    return 0;
}

Measured memory_bytes: 640
# ABC110d
import sys
from collections import Counter
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = map(int, input().split())
MOD = 10**9+7


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


dp = dict()


def combinations_count(n, r):
    if dp.get(n) != None and dp.get(n).get(r) != None:
        return dp[n][r]
    if dp.get(n) == None:
        dp[n] = dict()
    dp[n].update({r: math.factorial(
        n) // (math.factorial(n - r) * math.factorial(r))})
    return dp[n][r]


def combinations_with_replacement_count(n, r):
    return combinations_count(n + r - 1, r)


ans = 1
pr = Counter(prime_factorize(m))
for i in pr.values():
    # print(i)
    t = combinations_count(n + i - 1, i)
    # print(t)
    ans = ans*t % MOD
# print(pr)
# print(len(pr))
print(ans)

Measured memory_bytes: 83164
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=1e18;


int main() {
  ll n;
  cin>>n;
  ll ans=0;
  for(int i=1;i<=n;i++){
    ll y=n/i;
    ll s=y*(1+y)*i/2;
    ans+=s;
  }

cout<<ans;
}


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

const ll mod = 2019;
int main(){
    string S; cin >> S;
    ll N = S.size();

    ll val = 0;
    ll pm = 1;
    vector<int> m(2030,0);
    m[0]++;
    ll res = 0;
    for(int i=N-1;i>=0;i--){
        val = val + pm * (S[i]-'0');
        val %= mod;
        pm = (pm * 10) % mod;
        res += m[val];
        m[val]++;
    }

    cout << res << endl;
}

Measured memory_bytes: 3736
package main

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func maxInt64(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumInt64(a []int64) int64 {
	var ret int64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcdInt64(m, n int64) int64 {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcmInt64(m, n int64) int64 {
	return m / gcdInt64(m, n) * n
}

// sort ------------------------------------------------------------

type int64Array []int64

func (s int64Array) Len() int           { return len(s) }
func (s int64Array) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s int64Array) Less(i, j int) bool { return s[i] < s[j] }

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

func main() {
	n := readInt()
	maxh := 0
	ans := 0
	for i := 0; i < n; i++ {
		h := readInt()
		if h >= maxh {
			ans++
		}
		maxh = max(maxh, h)
	}
	fmt.Println(ans)
}


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

int main(){
    int H, W;
    cin >> H >> W;
    int a[H][W];
    string tmp;
    rep(i, H){
        cin >> tmp;
        rep(j, W){
            if(tmp[j]=='#'){
                a[i][j] = 0;
            }else{
                a[i][j] = 1;
            }
        }
    }

    int h[H][W];
    int v[H][W];

    rep(i, H){
        rep(j, W){
            if(a[i][j]==0){
                h[i][j] = 0;
            }else{
                if(j==0){
                    h[i][j] = 1;
                }else if(a[i][j-1]==0){
                    h[i][j] = 1;
                }else{
                    h[i][j] = h[i][j-1] + 1;
                }
            }
        }
    }

    rep(i, H){
        rep(j, W){
            if(a[i][j]==0){
                v[i][j] = 0;
            }else{
                if(i==0){
                    v[i][j] = 1;
                }else if(a[i-1][j]==0){
                    v[i][j] = 1;
                }else{
                    v[i][j] = v[i-1][j] + 1;
                }
            }
        }
    }

    rep(i, H){
        for(int j=W-1;j>=0;j--){
            if(j<W-1 && a[i][j]==1 && a[i][j+1]==1){
                h[i][j] = h[i][j+1];
            }
        }
    }

    rep(j, W){
        for(int i=H-1;i>=0;i--){
            if(i<H-1 && a[i][j]==1 && a[i+1][j]==1){
                v[i][j] = v[i+1][j];
            }
        }
    }

    int MAX = 0;
    rep(i, H){
        rep(j, W){
            int ans = h[i][j] + v[i][j] -1;
            MAX = max(MAX, ans);
        }
    }

    // rep(i, H){
    //     rep(j, W){
    //             cout << v[i][j];
    //     }
    //     cout << endl;
    // }

    cout << MAX << endl;
    return 0;
}

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

using namespace std;


int MinCostTopDownDP(int source, int destination, int * height, vector<int> &Memo);



int main() {
  int n;
  cin >> n;
  int height[n];
  for (int i = 0; i < n; i++) {
    cin >> height[i];
  }
  vector<int> Memo(n, -1);
  cout << MinCostTopDownDP(0, n - 1, height, Memo) << endl;

}

int MinCostTopDownDP(int source, int destination, int * height, vector<int> &Memo) { // Memoized
  if (source < destination) {

    if (Memo[source] == -1) {
      
      if (source == destination - 1)
        Memo[source] = abs(height[source] - height[destination]);
      int min_cost = INFINITY;
      for (int i = 1; i <= 2; i++) {
        int this_route_min = MinCostTopDownDP(source + i, destination, height, Memo) + abs(height[source] - height[source + i]);
        min_cost = min(min_cost, this_route_min);
      }
      Memo[source] = min_cost;
    }
    return Memo[source];    
  }
  return 0;
}


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

typedef long long ll;
typedef double ld;
typedef pair <ll, ll> pll;

#define pb push_back
#define mp make_pair
#define all(_c) _c.begin(), _c.end()

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

    string s;
    cin >> s;
    cout << (s <= "2019/04/30" ? "Heisei" : "TBD") << '\n';
    return 0;
}


Measured memory_bytes: 256
import math
 
a,b,x=list(map(int,input().split()))
if a*a*b <= 2*x:
  y=2*(b-(x/(a**2)))
  print(math.degrees(math.atan(y/a)))
else:
  y=2*x/(a*b)
  print(math.degrees(math.atan(b/y)))

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

#define N 8
#define FREE -1
#define NOT_FREE 1

int row[N],col[N],dpos[2*N-1],dneg[2*N-1];

bool X[N][N];

void initialize()
{
  for(int i=0;i<N;i++) { row[i]=FREE,col[i]=FREE; }
  for(int i=0;i<2*N-1;i++) {dpos[i]=FREE;dneg[i]=FREE;}
}

void printboard()
{
  for(int i=0;i<N;i++)
    {
      for(int j=0;j<N;j++)
	{
	  if(X[i][j])
	    {
	      if(row[i]!=j) return ;
	    }
	}
    }
  for(int i=0;i<N;i++)
    {
      for(int j=0;j<N;j++)
	{
	  cout<<((row[i]==j)?"Q":".");
	}
      cout<<endl;
    }
}

void recursive(int i)
{
  if(i==N)
    {
      printboard(); return;
    }

  for(int j=0;j<N;j++)
    {
      if(NOT_FREE==col[j]  ||
	 NOT_FREE==dpos[i+j]  ||
	 NOT_FREE==dneg[i-j+N-1]) continue;
      row[i]=j; col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE;
      recursive(i+1);
      row[i]=col[j]=dpos[i+j]=dneg[i-j+N-1]=FREE;
    }
}

int main()
{
  initialize();

  for(int i=0;i<N;i++)
    for(int j=0;j<N;j++) X[i][j]=false;

  int k; cin >> k;
  for(int i=0;i<k;i++)
    {
      int r,c; cin >> r >> c;
      X[r][c]=true;
    }

  recursive(0);

  return 0;
}



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

using namespace std;

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

  int max_num = max(a, max(b, c));
  // あわないので1つ上のであわせる
  if ((max_num * 3 - (a + b + c)) % 2 == 1) max_num++;

  cout << (max_num * 3 - (a + b + c)) / 2 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int a[3][3];
  rep(i,3)rep(j,3) cin >> a[i][j];
  int n;
  cin >> n;
  set<int> s;
  rep(i,n){
    int b;
    cin >> b;
    s.insert(b);
  }
  auto f = [&](int i1, int j1, int i2, int j2, int i3, int j3){
    return s.count(a[i1][j1]) != 0
        && s.count(a[i2][j2]) != 0
        && s.count(a[i3][j3]) != 0;
  };
  bool ans = f(0,0,0,1,0,2)
          || f(1,0,1,1,1,2)
          || f(2,0,2,1,2,2)
          || f(0,0,1,0,2,0)
          || f(0,1,1,1,2,1)
          || f(0,2,1,2,2,2)
          || f(0,0,1,1,2,2)
          || f(2,0,1,1,0,2)
  ;
  cout << (ans?"Yes":"No") << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include<set>
#include<vector>
using namespace std;

int main(void) {
    int n;
    cin >> n;
    int tmp=n;
    int sum=0;
    while(n>0) {
        sum += n%10;
        n /= 10;
    }
    if(tmp%sum==0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
const int INF = 1e10;
const long double PI = (acos(-1));


signed main() {
	int A, B;
	cin >> A >> B;
	for (int i = 1; i <= 2000; i++) {
		int a = i * 8 / 100;
		int b = i / 10;
		if (a == A && b == B) {
			cout << i;
			return 0;
		}
	}
	cout << -1;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vint;
typedef vector<vint> vvint;

static int n, x, t;

int main()
{
	while(cin >> n >> x >> t){
		cout << int(ceil(n/double(x))) * t << "\n";
	}
	
	return 0;
}


Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int main(){
	long int i;
	int h,m,s;
	cin >> i;
	h = i/3600;
	m = (i%3600)/60;
	s = i - (3600*h) - (60*m);
	cout<<h<<":"<<m<<":"<<s<<endl;
}

Measured memory_bytes: 1168
#include <iostream>
using namespace std;
int main(void){
    int x,y;
    while(1){
        cin>>x>>y;
        if(x==0 && y==0) break;
        
        if(x<y){
            cout<<x<<" "<<y<<endl;
        }
        else{
            cout<<y<<" "<<x<<endl;
        }
    }
    
    return 0;
}



Measured memory_bytes: 3036
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
int a[11];
int main(){
	int sum=0,i,k=0;
	string s;
	cin>>s;
	for(i=0;i<s.size();i++){
		a[i]=s[i]-'0';
	}
	for(i=0;i<s.size();i++){
		sum=sum*10+a[i];
		k+=a[i];
	}
	if(sum%k==0){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define forr(i,a,n) for (int i = (a); i < (n); ++i)
#define rforr(i,a,n) for (int i = (a); i > (n); --i)
#define ALL(x) (x.begin(),x.end())
#define LEN(X) ((int)(X).size())
#define CASET int _T; cin >> _T; forr(caset,0,_T)
 
int main() {
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
 
    ll n, m;
    cin >> n >> m;
    ll N = min(n,m), M = max(n,m);

    if (N==1 && M==1) {
        cout << 1;
    } else if (N==1) {
        cout << M-2 << '\n';
    } else {
        cout << (N-2)*(M-2)<<'\n';
    }


    return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if(a == c) cout << 0 << "\n";
  else cout << 1 << "\n";
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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 ll INF=1e18;

int main()
{
    ll n,k;
    cin >> n >> k;
    vector<ll> h(n);
    rep(i,n){
        cin >> h[i];
    }
    sort(h.begin(),h.end());
    ll ans=INF;
    rep(i,n-k+1){
        ans=min(ans,abs(h[i]-h[i+k-1]));
    }
    cout << ans << endl;
    return 0;
} 

Measured memory_bytes: 1024
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <functional>
#include <map>



using namespace std;

int main(void) {

	int a, b, c, k;
	cin >> a >> b >> c >> k;

	if (a - k >= 0) {
		cout << k << endl;
		return 0;
	}
	else if (a + b - k >= 0) {
		cout << a << endl; return 0;
	}
	else {
		k = k - (a + b);
		cout << a - k << endl;
		return 0;
	}

	return 0;
}



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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
using std::bitset;

#define rep(i,n)    for(int i=0; i<(int)n; i++)
#define reps(i,s,e) for(int i=s; i<(int)e; i++)
#define coutd(i) cout << std::fixed << std::setprecision(i)
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;

template<class T>
using Set = std::set<T>;
template<class T, class U>
using Map = std::map<T, U>;

template<class T>
using Graph = vector<vector<T>>;

const int INT_BIG = 1<<28;

int main() {
    int L, R, d;
    cin >> L >> R >> d;
    int count = 0;
    reps(i, L, R+1) {
        if (i % d == 0) {
            count++;
        }
    }
    cout << count << endl;
}

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

typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e5 + 100, M = 3, inF = 1e9 + 100;

int n, m, s, t, dis[N][M];
vector<int> nei[N];
queue<pii> q;

void bfs(pii p) {
	int v = p.first, t = p.second;
	for (int u: nei[v]) {
		int nxt_v = u, nxt_t = (t + 1) % 3;
		if(dis[nxt_v][nxt_t] == inF) {
			dis[nxt_v][nxt_t] = dis[v][t] + 1;
			q.push(pii(nxt_v, nxt_t));
		}
	}
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	for (int i = 0; i < N; i++)
		fill(dis[i], dis[i] + M, inF);
	cin >> n >> m;
	while(m--) {
		int u, v;
		cin >> u >> v;
		nei[--u].push_back(--v);
	}
	cin >> s >> t;
	s--;
	t--;
	dis[s][0] = 0;
	q.push(pii(s, 0));
	while(q.size()) {
		bfs(q.front());
		q.pop();
	}
	cout << (dis[t][0] == inF? -1: dis[t][0] / 3);
	return 0;
}

Measured memory_bytes: 6912
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<int> x(n+1);
    vector<int> y(m+1);
    cin >> x[0] >> y[0];
    REP(i,n) cin >> x[i+1];
    REP(i,m) cin >> y[i+1];
    sort(ALL(x));
    sort(ALL(y));
    if ( x.back()>=y[0] ) cout << "War" << '\n';
    else cout << "No War" << '\n';
    return 0;
}

Measured memory_bytes: 256
N = int(input())
import collections

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

    # divisors.sort()
    return divisors

div = make_divisors(N)

# print(collections.Counter(div))
# print(div)
print(sum(div)-len(div))

Measured memory_bytes: 38768
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
inline ll gcd(ll x,ll y)
{
    if(y==0)return x;
    return gcd(y,x%y);
}
ll n,m;
string S;
string T;
ll lcms;
ll nn,mm;
int main()
{
    scanf("%lld%lld",&n,&m);
    cin>>S>>T;
    if(S[0]!=T[0])
    {
        printf("-1\n");
        return 0;
    }
    lcms=n*m/gcd(n,m);
    nn=lcms/m;mm=lcms/n;
    for(int i=0,j=0;i<n&&j<m;i+=nn,j+=mm)
        if(S[i]!=T[j])
        {
            printf("-1\n");
            return 0;
        }
    
    printf("%lld\n",lcms);
    return 0;
}

Measured memory_bytes: 512
#include <iostream>

using namespace std;

int main(void)
{
  char S[20];
  int win = 0;
  int i;
  cin >> S;
  for(i = 0; (S[i] != '\n') && (S[i] != '\0'); i++)
    if(S[i] == 'o')
      win++;
  if((win + (15 - i)) >= 8)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    char w[101];
    int al[26]={0};
    int i;
    scanf("%s",w);
    for(i=0;w[i]!='\0';i++){
        al[w[i]-97]++;
    }
    for(i=0;i<26;i++){
        if(al[i]%2!=0){
            printf("No\n");
            break;
        }
    }
    if(i==26) printf("Yes\n");
}


Measured memory_bytes: 128
// ayy
// ' lamo
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld; //CARE
typedef complex<ld> pt;
#define fi first
#define se second
#define pb push_back
const ld eps=1e-8;
const int inf=1e9+99;
const ll linf=1e18+99;
const int P=1e9+7;






const int N=4096;
int a[N][N];
int v[N][N],e[N][N];
int Q(int a[N][N],int x,int y) {
	if(x<0 || y<0) return 0;
	return a[x][y];
}
int Q(int a[N][N],int xL,int yL,int xR,int yR) {
	--xL,--yL;
	return Q(a,xR,yR)-Q(a,xL,yR)-Q(a,xR,yL)+Q(a,xL,yL);
}

int32_t main() {
	int n,m,q; scanf("%d%d%d",&n,&m,&q);
	for(int i=0;i<n;i++) {
		char buf[N]; scanf("%s",buf);
		for(int j=0;j<m;j++) v[i+i][j+j]=a[i][j]=buf[j]-'0';
	}
	for(int i=0;i<n;i++) for(int j=0;j<m;j++) {
		if(a[i][j] && a[i+1][j]) e[i+i+1][j+j]=1;
		if(a[i][j] && a[i][j+1]) e[i+i][j+j+1]=1;
	}
	n*=2,m*=2; ++n,++m;
	for(int i=0;i<n;i++) partial_sum(v[i],v[i]+m,v[i]);
	for(int i=0;i<n;i++) for(int j=0;j<m;j++) v[i+1][j]+=v[i][j];
	for(int i=0;i<n;i++) partial_sum(e[i],e[i]+m,e[i]);
	for(int i=0;i<n;i++) for(int j=0;j<m;j++) e[i+1][j]+=e[i][j];
	for(;q--;) {
		int xL,yL,xR,yR; scanf("%d%d%d%d",&xL,&yL,&xR,&yR);
		--xL,--yL,--xR,--yR;
		xL+=xL;
		yL+=yL;
		xR+=xR;
		yR+=yR;
		int c=Q(v,xL,yL,xR,yR) - Q(e,xL,yL,xR,yR);
		// cerr<<"v: "<<Q(v,xL,yL,xR,yR)<<" e: "<<Q(e,xL,yL,xR,yR)<<endl;
		printf("%d\n",c);
	}
}









Measured memory_bytes: 165632
S=input()
abc=[chr(i) for i in range(97,97+26)]
f=True

if S[0]=='A':
    S=S[1:]
else:
    f=False

if 'C' in S[1:-1]:
    S=S.replace('C','',1)
else:
    f=False

for c in S:
    if c not in abc:
        f=False
        break

print('AC' if f else 'WA')

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

int main() {
    int n,m,k;
    cin >> n >> m >> k;
    vector<vector<int>> x(n+1,vector<int>(n+1)),c(n+1,vector<int>(n+1));
    for (int i=0;i<n+1;i++) {
        for (int j=0;j<n+1;j++) {
            x[i][j]=0;
            c[i][j]=0;
        }
    }
    int l,r;
    for (int i=0;i<m;i++) {
        cin >> l >> r;
        x[l][r]++;
    }
    for (int i=1;i<=n;i++) {
        for (int j=1;j<=n;j++) {
            for (int h=1;h<=j;h++) {
                c[i][j]+=x[i][h];
            }
        }
    }
    vector<int> p(k),q(k);
    for (int i=0;i<k;i++) cin >> p[i] >> q[i];
    for (int i=0;i<k;i++) {
        int ans=0;
        for (int j=p[i];j<=q[i];j++) ans+=c[j][q[i]]-c[j][p[i]-1];
        cout << ans << endl;
    }
}

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

int num_dig(int64_t x) {
	int dig = 0;
	while (x > 0) { x /= 10; dig++; }
	return dig;
}

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

	int ans = 11;
	int64_t limit = sqrt(n);
	for (int64_t i = 1; i <= limit; i++) {
		if (n % i == 0) {
			int tmp = max(num_dig(n / i), num_dig(i));
			if (ans > tmp) ans = tmp;
		}
	}

	cout << ans << endl;
}


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

#define rep(i,b) for(long long i = 0; i < (b); i++)
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
using ll = long long;
string s;

ll lcm(ll a,ll b){
	
	return (a*b)/(__gcd(a,b));
}

void solve() 
{ 
int n;
cin>>n;
ll ans=0;
for(int i=1;i<=n;i++){
	ll y=n/i;
	ans=ans+((y*(y+1))/2)*i;
	
}
cout<<ans;
return ;

}



int main(){

		solve();
		cout<<endl;


				
}
		

	

		

 



Measured memory_bytes: 3592
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String []args) throws IOException {
    	FastScanner in  = new FastScanner(System.in);
    	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
    	solve(in, out);
    	in.close();
    	out.close();
    }
    static long gcd(long a, long b){ return (b==0) ? a : gcd(b, a%b); }
    static int gcd(int a, int b){ return (b==0) ? a : gcd(b, a%b); }
    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}
	String next(){while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}
    }
    
    /********* SOLUTION STARTS HERE ************/
    
    private static void solve(FastScanner in, PrintWriter out){
        String s = in.next().trim();
        int ans=0;
        if(s.equals("SAT")) ans=1;
        else if(s.equals("FRI")) ans=2;
        else if(s.equals("THU")) ans=3;
        else if(s.equals("WED")) ans=4;
        else if(s.equals("TUE")) ans=5;
        else if(s.equals("MON")) ans=6;
        else ans=7;
        out.println(ans);
    }
    /************* SOLUTION ENDS HERE **********/
}

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

int main(){
    int N;cin>>N;
    int a[N];
    for(int i=0;i<N;i++)cin>>a[i];
    int count4=0,count2=0;
    for(int i=0;i<N;i++){
        if(a[i]%4==0)count4++;
        else if(a[i]%2==0)count2++;
    }
    int count1=N-count2-count4;
    if(count2){
        if(count1<=count4)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    else{
        if(count1<=count4+1)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 640
from math import atan2, degrees

A, B, X = map(int, input().split())
if A ** 2 * B > X * 2:
    width = X * 2 / (A * B)
    print(degrees(atan2(B, width)))
else:
    height = (A ** 2 * B - X) * 2 / (A ** 2)
    print(degrees(atan2(height, A)))


Measured memory_bytes: 9364
from sys import stdin
N, K = [int(i) for i in stdin.readline().rstrip().split()]
S = stdin.readline().rstrip()
S = list(S)
if S[K - 1] == "A":
    S[K - 1] = "a"
elif S[K - 1] == "B":
    S[K - 1] = "b"
elif S[K - 1] == "C":
    S[K - 1] = "c"
print("".join(S))

Measured memory_bytes: 3060
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

int keta(ll x){
    int ret = 0;
    while(x>0){
        x /= 10;
        ret++;
    }
    return ret;
}

int main(){
    ll N;
    ll ans = 1;
    cin>>N;
    for(int i=1; i<=sqrt(N); ++i) if(N%i==0) ans = N/i;
    if(ans==1){
        cout << keta(N) << endl;
    }
    else{
        cout << keta(ans) << endl;
    }
}

Measured memory_bytes: 256
def dist(i,j,x,y):
    a = abs(i-j)
    b = abs(x-i) + abs(y-j) + 1
    c = abs(x-j) + abs(y-i) + 1
    return min(a,b,c)

def main():
    N,X,Y = list(map(int,input().split()))

    X -= 1
    Y -= 1
    K = [0 for i in range(N+1)]

    for i in range(N):
        for j in range(N):
            index = dist(i,j,X,Y)
            K[index] += 1

    for i in range(1,N):
        print(int(K[i] / 2))
    

if __name__ == "__main__":
    main()
    


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

using namespace std;

int main()

{
    int n;

    cin>>n;

    //if(n%2==0)
   // {
        int r=ceil((n)/1.08);
        //cout<<r<<endl;
        if(((r)*1.08)<n+1)// if((r*1.08)<=n)
            cout<<r<<endl;
        else
             cout<<":(\n";
   // }
   /* else
        {
             int r=(int)((n+1)/1.08);
              if((int)((r+1)*1.08)<=n)
            cout<<(r)<<endl;
        else
             cout<<":(\n";
        }
*/

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
typedef long long    ll;
#define pb                push_back
#define mp                make_pair
#define all(a)            (a).begin(), (a).end()
#define clr(a,h)          memset(a, (h), sizeof(a))
#define mem(a,h)          memset(a, (h), sizeof(a))
#define F first
#define S second
#define f first
#define s second
#define fore(i, b, e)    for (ll i = (ll)b; i < (ll)e; i++)
#define forr(i, b, e)    for (ll i = (ll)b; i < (ll)e; i++)
ll faster_in(){ll r=0,c;for(c=getchar();c<=32;c=getchar());if(c=='-') return -faster_in();for(;c>32;r=(r<<1)+(r<<3)+c-'0',c=getchar());return r;}

using namespace std;
//using namespace __gnu_pbds;
typedef double lldb;
typedef pair<ll, ll>  ii;
typedef vector<ll>     vi;
typedef vector<vi>     vvi;
typedef vector<ii>      vii;
typedef vector<ll>      vll;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
const ll INF = ll(1e9 + 7);
const lldb PI = acos(-1);
#define tam 320000
const ll MOD=1e9+7;

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

}
// PLUS ULTRA!

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

using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define out(ans) cout << ans << endl;
const long long mod = 1e9 + 7;

int main(){

  string s;cin>>s;
  vector<bool>v(26,false);
  rep(i,0,s.size()){
    if(v[s[i]-'a']==false)v[s[i]-'a']=true;
    else {out("no");return 0;}
  }
  out("yes");


  return 0;
}


Measured memory_bytes: 256
import math

def main():
    a, b, x = list(map(int,input().split()))
    tmp = 2 / a * (b - x / (a * a))

    ans = math.atan(tmp) * 180 / math.pi
    if a * a * b / 2.0 > x:
        ans = math.atan(1 / (2 * x / (a * b * b))) * 180 / math.pi

    print(ans)

if __name__=="__main__":
    main()

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

int main() {
	int a,b,c;
	cin>>a>>b>>c;
	int d=0;
	for(int i=a;i<=b;i++)
	{
	    if(i%c==0) d++ ;
	    
	}
	cout<<d<<endl;
	return 0;
}

Measured memory_bytes: 3644
n = int(input())
a = [0,0,0,0]
for i in range(n):
    s = input()
    if s=='AC':
        a[0] += 1
    elif s =='WA':
        a[1] += 1
    elif s =='TLE':
        a[2] += 1
    else:
        a[3] +=1
print('AC x',a[0])
print('WA x',a[1])
print('TLE x',a[2])
print('RE x',a[3])

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

const int INF = INT_MAX;
const int MAXN = 5000;
const int B = 700;
const int BNUM = MAXN / B;

int n, m;
pair<int, int> ps[MAXN];
int x[MAXN], y[MAXN];
vector<int> bucket[BNUM];

int main() {
  while(scanf("%d%d", &n, &m) != EOF) {
    for(int i = 0; i < n; ++i) {
      scanf("%d%d", &ps[i].first, &ps[i].second);
    }
    sort(ps, ps+n);
    fill(bucket, bucket + BNUM, vector<int>());
    for(int i = 0; i < n; ++i) {
      x[i] = ps[i].first;
      y[i] = ps[i].second;
      bucket[i/B].push_back(y[i]);
    }
    for(int b = 0; b < BNUM; ++b) {
      sort(bucket[b].begin(), bucket[b].end());
    }
    while(m--) {
      int s, t, u, v; 
      scanf("%d%d%d%d", &s, &t, &u, &v);
      int l = lower_bound(x, x+n, s) - x;
      int r = upper_bound(x, x+n, u) - x;
      int res = 0;
      while(l < r && l % B != 0) {
        res += (t <= y[l] && y[l] <= v);
        ++l;
      }
      while(l < r && r % B != 0) {
        --r;
        res += (t <= y[r] && y[r] <= v);
      }
      while(l < r) {
        int b = l / B;
        res += upper_bound(bucket[b].begin(), bucket[b].end(), v)
          - lower_bound(bucket[b].begin(), bucket[b].end(), t);
        l += B;
      }
      printf("%d\n", res);
    }
  }
  return 0;
}

Measured memory_bytes: 1320
from functools import reduce
from operator import mul
N = int(input())
A = [int(c) for c in input().split()]
ans = 1
if 0 in A:
  print(0)
  import sys
  sys.exit()
for c in A:
  ans *= c
  if ans>10**18:
    print(-1)
    break
else:
  print(ans)

Measured memory_bytes: 81996
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> P;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

void YN(bool flg){if(flg) cout << "YES" << endl; else cout << "NO" << endl;}
void Yn(bool flg){if(flg) cout << "Yes" << endl; else cout << "No" << endl;}
void yn(bool flg){if(flg) cout << "yes" << endl; else cout << "no" << endl;}

int main() {
    int n;
    cin >> n;
    deque<int> deq;
    rep(i, n) {
        int a;
        cin >> a;
        if(i % 2 == 0) deq.push_front(a);
        else deq.push_back(a);
    }

    if(n % 2 != 0) {
        for(int i = 0; i < n; i++) cout << deq[i] << " ";
    } else {
        for(int i = n - 1; i >= 0; i--) cout << deq[i] << " ";
    }
    
    return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n, m;
	cin >> n >> m;
	if(n%m==0)
	{
		cout<<0<<endl;
		return 0;
	}
	if(n%m!=0||n<m)
	{
		cout<<1<<endl;
		return 0;
	}
 } 


Measured memory_bytes: 256
using System;
class ProgramA
    {
        static void Main(string[] args)
        {
            
            string[] input = Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);

            int K = A+B;

            if(K % 2 == 0)
                Console.WriteLine(K/2);
            else
                Console.WriteLine("IMPOSSIBLE");
    
        }
    }

Measured memory_bytes: 11092
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int (i)=(n); (i)>=(0); (i)--)
#define SIZE(x) ((int)(x).size())
#define GCD(a, b) int gcd(int a,int b){return b?gcd(b,a%b):a;}
#define QP(a, b) int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define all(v) (v).begin(),(v).end()


template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
template<typename A, size_t N, typename T>
void FILL(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef vector<int, int> vint;
typedef pair<int,int> pint;
typedef vector<pint>vpint;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> cnt(300000);
    for(int x=1; x<=100; x++){
        for(int y=1; y<=100; y++){
            for(int z=1; z<=100; z++){
                cnt[x*x + y*y + z*z + x*y + y*z + z*x]++;
            }
        }
    }
    int N;
    cin >> N;
    for(int i=1; i<=N; i++) cout << cnt[i] << endl;
    return 0;
}

Measured memory_bytes: 4384