akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
int main(void){
    int w,h,x,y,r;
    scanf("%d %d %d %d %d",&w,&h,&x,&y,&r);
    if(0<=x-r && w>=x+r && 0<=y-r && h>=y+r){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 2112
// ===================================
//   author: M_sea
//   website: http://m-sea-blog.com/
// ===================================
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#define re register
using namespace std;
typedef long long ll;

inline int read() {
    int X=0,w=1; char c=getchar();
    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
    return X*w;
}

const int N=100000+10;

int n,a[N];

int main() {
    n=read();
    for (re int i=1;i<=n;++i) a[i]=read();
    ll ans=0;
    for (re int i=1;i<=n;++i) {
        ans+=a[i]>>1,a[i]&=1;
        if (i<n&&a[i]&&a[i+1]) --a[i],--a[i+1],++ans;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 768
s=list(input())
al=list('abcdefghijklmnopqrstuvwxyz')
d=[0]*26
for i in s:
    d[al.index(i)]+=1
n=len(s)
ans=n*(n-1)//2+1
for i in d:
    ans-=i*(i-1)//2
print(ans)

Measured memory_bytes: 4840
#include <stdio.h>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <vector>
#include <map>
#include <ctime>
#include <string.h>
#define inf 0x7fffffff
using namespace std;
//1232
int a,b,c,n,m,l[4],o[1140010],k,i,d,dx[10]={0,1,-1,0,0,-1,-1,1,1},dy[10]={0,0,0,-1,1,1,-1,1,-1};
long long x,y,z;
stack<int> s;
struct P
{
    int x,y;
    long long z;
    bool operator<(const P &a)const
    {
        return y>a.y;
    }
};
 //map<int, int> p;
queue<P> q;
string r[3];
vector<P> v[1000100];
//vector<long long> ;
bool sdf(P a,P b){return a.y<b.y;}


int main()
{
    scanf("%d %d",&a,&b);
    for(int t=1;t<=a;t++)
        scanf("%d",&o[t]);
    for(int t=1;t<a;t++)
        k+=min(b,o[t+1]-o[t]);
    printf("%d",k+b);
    return 0;
}

Measured memory_bytes: 24832
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
using ll=long long;
using P=pair<ll,ll>;
using PP=tuple<ll,ll,ll>;
using S=multiset<ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
void decimal(int x){cout<<fixed<<setprecision(x);}
ll modpow(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*modpow(a,b-1)%mod;ll k=modpow(a,b/2);return k*k%mod;}
vi calc(ll x){vi res;while(x>0){res.eb(x%10);x/=10;}reverse(all(res));return res;}

void solve() {
	ll n,k;
	cin>>n>>k;
	if(n==k) out(0);
	else if(n>k) out(min(n%k,k-n%k));
	else out(min(n,k-n));
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
}


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

int main() 
{
    // s[i]-'0'
    string s; ll k;
    cin >> s >> k;
    ll i;
    if (k<s.size())
        if (s[k-1] == '1') 
    {
        cout << 1;
        return 0;
    }
    for (i=0; i<s.size(); i++)
    {
        if (s[i] == '1')
            continue;
        else
        {
            cout << s[i];
            return 0;
        }
    }
    cout << 1;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String str = sc.next();
        int[] countl = new int[26];
        int[] countr = new int[26];
        int ans = 0;
        int max = 0;
        
        for(int i=1; i<str.length(); i++){
            for(int j=0; j<i; j++){
                if(countl[str.charAt(j)-97]==0){
                    countl[str.charAt(j)-97]++;
                    //System.out.println(i+"j"+j);
                }
            }
            for(int k=i; k<str.length(); k++){
                if(countr[str.charAt(k)-97]==0){
                    countr[str.charAt(k)-97]++;
                    //System.out.println(i+"k"+k);
                }
            }
            for(int l=0; l<26; l++){
                ans = ans + countl[l]*countr[l];
                //System.out.println(l+":"+countl[l]+":"+countr[l]);
                if(ans > max){
                    max = ans;
                    //System.out.println("max"+max);
                }
            }
            ans = 0;
            for(int j=0; j<i; j++){
                countl[str.charAt(j)-97]=0;
                //System.out.println(i+"j"+j);
            }
            for(int k=i; k<str.length(); k++){
                countr[str.charAt(k)-97]=0;
                //System.out.println(i+"k"+k);
            }
        }
        System.out.println(max);
    }
}

Measured memory_bytes: 35892
#include<bits/stdc++.h>
using namespace std;
long long m=1e9+7;
int n;
long long dp[3000000];
int compatible[25][25];
int is_compatible(int g, int b){
    if(compatible[g][b]==1)return 1;
    else return 0;
}
long long solve(long long b_mask){
   if(dp[b_mask]!=-1)return dp[b_mask];
   int g=0;
   for(int i=0;i<=n;i++)if(b_mask&(1<<(i)))g++;
   int boy;
     long long res=0;
   if(g==1){
       for(int i=0;i<n;i++){
           if (b_mask & (1 << (i))) {
               boy=i+1;break;
           }
       }
       if(is_compatible(g,boy))return dp[b_mask]=1;
       else return dp[b_mask]=0;
   }
   for(int i=0;i<n;i++){
       long long temp=b_mask;
       if((b_mask & (1 << (i)))&&is_compatible(g,i+1)){
           temp=temp ^ (1 << (i));
           res=(res+solve(temp));
           if(res>=m)res-=m;
       }
    }
   return dp[b_mask]=res;
}
int main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>compatible[i][j];
        }
    }
    vector<int>g;
    long long b=0;
    for(int i=1;i<=n;i++)b=b ^ (1 << (i-1));
    for(long long j=0;j<=pow(2,n);j++)dp[j]=-1;
    cout<<solve(b);
}

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

int main()
{
    int n, k, num = 1;
    cin >> n >> k;
    while (num < k && 0 < n)
    {
        num *= 2;
        n--;
    }
    for (int i = 0; i < n; i++)
    {
        num += k;
    }
    cout << num << endl;
}


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

ans = [[0 for i in range(W)] for j in range(H)]

cnt = 0
indexA = 0
for i in range(H*W):
    x = i // W 
    y = i % W
    if cnt == 0:
        cnt = A[indexA] - 1
        indexA += 1
    else:
        cnt -= 1
    if x % 2 == 0:
        ans[x][y] = indexA
    else:
        ans[x][-y-1] = indexA

for c in ans:
    print(*c)

Measured memory_bytes: 9516
lis1 = list(map(str, input().split()))
lis2 = list(map(str, input().split()))
lis3 = list(map(str, input().split()))
n = int(input())
lisn = [input() for i in range(n)]
for i in lisn:
    if i in lis1:
        lis1[lis1.index(i)] = 1000
    if i in lis2:
        lis2[lis2.index(i)] = 1000
    if i in lis3:
        lis3[lis3.index(i)] = 1000
if lis1.count(1000)==3 or lis2.count(1000)==3 or lis3.count(1000)==3 or (lis1[0]==1000 and lis2[0]==1000 and lis3[0]==1000) or (lis1[1]==1000 and lis2[1]==1000 and lis3[1]==1000) or (lis1[2]==1000 and lis2[2]==1000 and lis3[2]==1000) or (lis1[0]==1000 and lis2[1]==1000 and lis3[2]==1000) or (lis1[2]==1000 and lis2[1]==1000 and lis3[0]==1000):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<ll>;
using VV = vector<VI>;
using VS = vector<string>;

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; }

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<'\n'
#define p2(s, t) cout << (s) << " " << (t) << '\n'
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << '\n'
#define p_yes() p("YES")
#define p_no() p("NO")
#define SZ(x) ((int)(x).size())
#define SORT(A) sort(ALL(A))
#define RSORT(A) sort(ALL(A), greater<ll>())

const ll mod = 1e9 + 7;
const ll inf = 1e18;

ll N, A, B, C;
ll mi;
VI L;

ll sum(VI& V){
  ll a = 0;
  for(ll v : V){
    a += v;
  }
  return a;
}

void calc(VI& V){
  VI H = {A,B,C};

  VV G(4);
  rep(i, N){
    ll group = V[i];
    G[group].push_back(L[i]);
  }
  ll MP = 0;
  rep(i, 3){
    if(G[i].size()==0) return; // 竹は１本はないと増減できないため
    if(G[i].size()>1){
      ll len = G[i].size();
      MP += 10 * (len-1);
    }

    // 高さ調整
    ll h = sum(G[i]);
    MP += abs(H[i] - h);
  }
  chmin(mi, MP);
}

void dfs(VI V){
  if(SZ(V)==N){
    calc(V);
    return;
  }
  rep(i, 4){
    V.push_back(i);
    dfs(V);
    V.pop_back();
  }
}

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

    // input
    cin >> N >> A >> B >> C;
    L.resize(N);

    rep(i, N){
        cin >> L.at(i);
    }
    SORT(L);

    mi = inf;
    VI V;
    dfs(V);
    p(mi);
    
    return 0;
}

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

int main()
{
	string s;
	cin >> s;
	if (s[0] == 'Y'&&s[1] == 'A'&&s[2] == 'K'&&s[3] == 'I') {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;

int main() {
    int A, B, M;
    cin >> A >> B >> M;
    vector<int> a(A), b(B);
    int min_a = 1000000;
    int min_b = 1000000;
    rep(i, A) {
        cin >> a[i];
        min_a = min(min_a, a[i]);
    }
    rep(i, B) {
        cin >> b[i];
        min_b = min(min_b, b[i]);
    }
    int ans = min_a + min_b;
    rep(i, M) {
        int x, y, c;
        cin >> x >> y >> c;
        if (a[x - 1] + b[y - 1] - c < ans) ans = a[x - 1] + b[y - 1] - c;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

class Test
{

    public static void Main()
    {

        var tmp = int.Parse(Console.ReadLine());

        if (tmp >= 30)
            Console.Write("Yes");
        else
            Console.Write("No");

    }
}





Measured memory_bytes: 17588
def examA():
    S = SI()
    if S in alphabet:
        ans = "a"
    else:
        ans = "A"
    print(ans)
    return

def examB():
    N, K = LI()
    P = LI()
    P.sort()
    ans = sum(P[:K])
    print(ans)
    return

def examC():
    N = I()
    ans = ""
    while(N>0):
        N -= 1
        ans += alphabet[N%26]
        N //= 26
        if N==0:
            break
    print(ans[::-1])
    return

def examD():
    N = I()
    A = LI()
    D = defaultdict(int)
    for a in A:
        D[a] += 1
    S = sum(A)
    q = I()
    ans = [0]*q
    for i in range(q):
        a, b = LI()
        if not a in D:
            ans[i] = S
            continue
        S += (b-a)*D[a]
        D[b] += D[a]
        D[a] = 0
        ans[i] = S

    for v in ans:
        print(v)
    return

def examE():
    N = I()
    A = LI()
    S = 0
    for a in A:
        S ^= a
    #print(S)
    ans = [0]*N
    for i in range(N):
        ans[i] = S^A[i]
    print(" ".join(map(str,ans)))
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examE()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 118768
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

class Stream{
public:
    Stream(){

    }
    //配列以外の入力を受け取る
    void read(){

    }
    template<typename First, typename... Rest>
    void read(First& first, Rest&... rest){
        cin >> first;
        read(rest...);
    }
    template<typename T>
    vector<T> read_vec(size_t n){
        vector<T> tmp(n);
        for(size_t i = 0; i < n; i++){
            cin >> tmp[i];
        }
        return tmp;
    }
    //配列を区切って出力する
    template<typename T>
    void write_vec(vector<T>& v, char divider){
        for(size_t i = 0; i < v.size(); i++){
            cout << v[i] << divider;
        }
    }
};

int main(){
    Stream io;

    ll N;
    io.read(N);
    auto A = io.read_vec<ll>(N);
    map<ll, ll> mp;
    ll m = 0;
    for(int i = 0; i < N; i++){
        mp[A[i]]++;
        m = max(m, A[i]);
    }
    
    ll ans = 0;
    for(auto itr = mp.begin(); itr != mp.end(); itr++){
        if(itr->second > 0){
            if(itr->second == 1) ans++;
            for(ll k = 2 * itr->first; k <= m; k += itr->first){
                mp[k] = 0;
            }
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 66992
#include <iostream>

using namespace std;

int main()
{
    int A, B, X;
    cin >> A >> B >> X;
    if (A <= X && X <= A + B)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<iomanip>
using namespace std;

int main(void)
{
    int a,b,count = 0;
    cin >> a >> b;
    for(int i = a;i <= b;i++)
    {
        bool judge = true;
        string s = to_string(i);
        for(int j = 0;j < 2;j++)
        {
            if(s[j] != s[4 - j]){judge = false; break;}
        }
        if(judge){count++;}
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int MOD = 1000000007;
const int MAX = 2000;

long long mod(long long a) {
	a %= MOD;
	return a >= 0 ? a : a+MOD;
}

long long inverse[MAX+1];
long long factorial[MAX+1];
long long factorial_inverse[MAX+1];

void calc(int n) {
	inverse[1] = 1;
	factorial[0] = factorial[1] = 1;
	factorial_inverse[0] = factorial_inverse[1] = 1;
	for (int i = 2; i <= n; i++) {
		inverse[i] = MOD - inverse[MOD%i] * (MOD/i) % MOD;
		factorial[i] = i * factorial[i-1] % MOD;
		factorial_inverse[i] = inverse[i] * factorial_inverse[i-1] % MOD;
	}
}

long long comb(long long n, long long k) {
	return factorial[n] * (factorial_inverse[k] * factorial_inverse[n-k] % MOD) % MOD;
}

long long rep_comb(long long n, long long k) {
	return comb(n + k - 1, k);
}

int main() {
	long long n, k;
	cin >> n >> k;
	calc(n);
	for (int i = 1; i <= k; i++) {
		long long ans;
		ans = rep_comb(i, k-i);
		if (n-k-(i-1) < 0) ans = 0;
		else ans = mod(ans * rep_comb(i+1, n-k-(i-1)));
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 256
s = input()
x, y = map(int, input().split())
y = abs(y)

f = s.find('T')
if f >= 0:
    x = abs(x - f)
    s = s[f:]
else:
    if x == len(s) and y == 0:
        print('Yes')
    else:
        print('No')
    exit()

lx, ly = [], []
flag = True
n = 0
s += 'T'
for i in s:
    if i == 'F':
        n += 1
    else:
        if n > 0:
            if flag:
                lx.append(n)
            else:
                ly.append(n)
            n = 0
        flag = not flag

lx.sort()
ly.sort()
sx = sum(lx)
sy = sum(ly)

if sx < x or (sx - x) % 2 == 1 or sy < y or (sy - y) % 2 == 1:
    print('No')
    exit()


def main(x, sx, lx):
    if x == sx:
        return True

    goal = (sx - x) // 2
    # return (sum of some lx == goal)
    dp = [False] * (goal + 1)
    dp[0] = True
    for i in lx:
        if i > goal:
            return False
        for j in range(goal - i, -1, -1):
            if dp[j]:
                dp[j+i] = True
        if dp[goal]:
            return True
    return False


if main(x, sx, lx) and main(y, sy, ly):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9264
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        n: usize,
        m: usize,
        a: [Chars; n],
        b: [Chars; m],
    }

    for ax in 0..n - m + 1 {
        for ay in 0..n - m + 1 {
            'check: for bx in 0..m {
                for by in 0..m {
                    if a[ax + bx][ay + by] != b[bx][by] {
                        break 'check;
                    }
                }
                if bx == m - 1 {
                    println!("Yes");
                    return;
                }
            }
        }
    }
    println!("No");
}


Measured memory_bytes: 2188
def main():
    n, m, k = map(int, input().split())
    fb = [0]*(n+1)
    uf = UnionFind(n)
    for i in range(m):
        a, b = map(int, input().split())
        fb[a] += 1
        fb[b] += 1
        uf.unite(a, b)
    for i in range(k):
        c, d = map(int, input().split())
        # 友達の輪の中にいたら
        if uf.same(c, d):
            fb[c] += 1
            fb[d] += 1
    ans = [uf.size(i)-1-fb[i] for i in range(1, n+1)]
    print(" ".join(list(map(str, ans))))


class UnionFind:
    __slots__ = ["data"]
    
    def __init__(self, n=0):
        self.data = [-1]*(n+1)
    
    def root(self, x):
        if self.data[x] < 0:
            return x
        self.data[x] = self.root(self.data[x])
        return self.data[x]
    
    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            if self.data[x] < self.data[y]:
                self.data[x] += self.data[y]
                self.data[y] = x
            else:
                self.data[y] += self.data[x]
                self.data[x] = y
    
    def same(self, x, y):
        return self.root(x) == self.root(y)
    
    def size(self, x):
        return -self.data[self.root(x)]



if __name__ == "__main__":
    main()

Measured memory_bytes: 15624
n=int(input())

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

d=divisore(n)

ans=10**9
for i in d:
  a=i
  b=n//a
  t_ans=max(len(str(a)),len(str(b)))
  ans=min(ans,t_ans)

print(ans)

Measured memory_bytes: 3188
N,Y=map(int,input().split())
a=0
b=Y//10000
c=Y//5000
for i in range(0,b+2):
    for j in range(0,c+2):
        if i+j>N:
            continue
        else:
            if (i*10000)+(5000*j)+(1000*(N-i-j))==Y:
                print(i,j,N-(i+j))
                exit()

print(-1,-1,-1)

Measured memory_bytes: 9148
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define yes(n) cout << ((n) ? "yes" : "no") << endl

using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) {
    ll g = GCD(a, b);
    return a / g * b;
}

const int MAX_V = 50;
int n, m;
bool visited[MAX_V];
bool graph[MAX_V][MAX_V];
int a[MAX_V], b[MAX_V];

void dfs(int v) {
    visited[v] = true;
    for (int u=0;u<n;++u) {
        if (!graph[v][u]) continue;
        if (visited[u]) continue;
        dfs(u);
    }
}


int main(){
    cin >> n >> m;
    rep(i, m) {
        cin >> a[i] >> b[i];
        a[i]--; b[i]--;
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }

    int ans = 0;
    rep(i, m) {
        graph[a[i]][b[i]] = graph[b[i]][a[i]] = false;

        rep(i, n) visited[i] = false;
        dfs(0);
        bool bridge = false;
        rep(j, n) {
            if (!visited[j]) bridge = true;
        }
        if (bridge) ans++;

        graph[a[i]][b[i]] = graph[b[i]][a[i]] = true;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
int j,K,A,B,count=0;
scanf("%d %d %d",&K,&A,&B);
for(j=1;j<=1000;j++)
{
if(K*j>=A && K*j<=B)
 {
 printf("OK\n");
 count=count+1;
 break;
 }
}
if(count==0)
printf("NG\n");
return 0;
}

Measured memory_bytes: 1620
import java.util.*;

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

    String t2=t.substring(0,s.length());
    // System.out.println(t2);

    if(t.length()==s.length()+1&&t2.equals(s)){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 26972
/** author: __nishad__ **/

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


typedef long long ll ;
typedef vector<ll> vll ;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(v) (v).begin(),(v).end()
#define precision(k) cout<<setprecision(k)<<fixed;
#define loop(i,a) for(int i=0; i<a;i++)
#define loop2(i,a,b) for(int i=(a);i<=(b);++i)
#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define pb push_back
#define pi 3.14159265358979323
#define endl "\n"

int main()
{
    IOS;
    ll d, n;
    cin>>d>>n;

    if(n==100)
        n++;

    d = pow(100, d);

    cout<<d*n;


}



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

using namespace std;

long long invert(int r, long long k, vector<int>& a){
  long long left_small = 0;
  long long right_small = 0;
  int ar = a[r];
  
  for(int i = 0; i < r; i++){
    if(a[i] < ar){
      left_small++;
    }
  }
  for(int i = r + 1; i < a.size(); i++){
    if(a[i] < ar){
      right_small++;
    }
  }
  
  return ((right_small * k) % 1000000007 + (left_small + right_small) * ((k * (k - 1) / 2) % 1000000007)) % 1000000007;
}

int main(){
  long long n, k; cin >> n >> k;
  vector<int> a(n); for(int i = 0; i < n; i++) cin >> a[i];
  
  long long count = 0;
  for(int i = 0; i < n; i++){
    count += invert(i, k, a);
    count = count % 1000000007;
  }
  
  cout << count << endl;
  
  return 0;
}


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

using namespace std;

int n, q, x, y, i, j;
vector<int> val, res, vis;
vector<vector<int>> nex;

void dfs(int x, int v) {
  res[x] = v + val[x];
  vis[x] = 1;
  for (auto &nx : nex[x]) {
    if (!vis[nx]) {
      dfs(nx, v + val[x]);
    }
  }
}

void solve() {
  cin >> n >> q;
  val.resize(n + 1, 0);
  res.resize(n + 1, 0);
  nex.resize(n + 1);
  vis.resize(n + 1, 0);
  for (i = 0; i < n - 1; i++) {
    cin >> x >> y;
    nex[x].push_back(y);
    nex[y].push_back(x);
  }
  for (i = 0; i < q; i++) {
    cin >> x >> y;
    val[x] += y;
  }
  dfs(1, 0);

  for (i = 1; i <= n; i++) cout << res[i] << " ";
  cout << endl;
}

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


Measured memory_bytes: 25088
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e6 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

func main() {
	X := nextInt()
	for i := X; ; i++ {
		if isPrime(i) {
			fmt.Println(i)
			return
		}
	}
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func isPrime(n int) bool {
	if n == 2 {
		return true
	} else if n%2 == 0 || n < 2 {
		return false
	} else {
		for i := 3; i*i <= n; i += 2 {
			if n%i == 0 {
				return false
			}
		}
	}
	return true
}


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

int main() {
  string S;
  cin >> S;
  long w = 0;
  long b = 0;
  long ans = 0;
  for (long i = 0; i < S.size(); i++) {
    if (S.at(i) == 'W') {
      if (b) ans += i - w;
      w++;
    }
    if (S.at(i) == 'B') {
      b++;
    }
  }
  cout << ans << "\n";
}

Measured memory_bytes: 640
s = input()
a = [0]*(len(s)+1)

for i in range(len(s)):
    if s[i] == '<':
        a[i+1] = max(a[i+1], a[i]+1)

for i in range(len(s)-1, -1, -1):
    if s[i] == '>':
        a[i] = max(a[i], a[i+1]+1)

print(sum(a))


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

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

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

	set<pair<int, int> > is_obs;
	set<int> c_members[w+1];

	for (int i = 0; i < n; ++i) {
		int x, y;
		cin >> x >> y;
		is_obs.insert(make_pair(x, y));
		c_members[y].insert(x);
	}
	

	int visited[w+1];
	int x = 1, y = 1;
	while (true) {
		// Go up
		if (x == h || is_obs.find(make_pair(x+1, y)) != is_obs.end()) {
			visited[y] = x;
			break;
		} else {
			++x;
			//cout << x << " " << y << endl;
		}
		
		// Go right
		if (y != w && is_obs.find(make_pair(x, y+1)) == is_obs.end()) {
			visited[y] = x;
			++y;
			//cout << x << " " << y << endl;
		}
	}

	int res = x;

	/*
	if (y > w) {
		if (c_members[y-1].upper_bound(visited[y-1]) == c_members[y-1].end()) {
			res = h;
		}
		for (int i = 1; i < y-2; ++i) {
			if (c_members[i].upper_bound(visited[i]) == c_members[i].end()) {
				res = h;
			}
		}
	}
	*/

	for (int i = 1; i < y-1; ++i) {
		if (!c_members[i].empty()) {
			set<int>::iterator it = c_members[i].upper_bound(visited[i]);
			if (it != c_members[i].end())
				res = min(res, *it-1);
		}
	}

	cout << res << "\n";

	return 0;
}

Measured memory_bytes: 28928
from collections import OrderedDict

str = input()
n = int(str)
hoge = OrderedDict()

hoge['AC'] = 0
hoge['WA'] = 0
hoge['TLE'] = 0
hoge['RE'] = 0

for i in range(n):
    str = input()
    a = 1
    if str in hoge:
        a = hoge[str] + 1
    hoge[str] = a

for k, v in hoge.items():
    print(k, 'x', v)

Measured memory_bytes: 9484
a, b, h, m = gets.chomp.split(' ').map(&:to_i)

hr = 30.0 * h + 0.5 * m
mr = 6.0 * m

r = hr > mr ? hr - mr : mr - hr
r = 360 - r if r > 180


c = Math.sqrt((a ** 2) + (b ** 2) - ((2 * a * b) * Math.cos(r * Math::
PI / 180)))

puts c

Measured memory_bytes: 14800
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
using namespace std;
const int MAX = 100010;
const int MOD = 1000000007;

struct Seg {
    int l;
    int r;
    Seg(int l, int r) {
        this->l = l;
        this->r = r;
    }
};

int T[MAX];
int A[MAX];


int main() {
    //freopen("in.txt", "r", stdin);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++ i) cin >> T[i];
    for (int i = 0; i < n; ++ i) cin >> A[i];

    vector<Seg> segments_1;
    vector<Seg> segments_2;
    for (int i = 0; i < n; ++ i) {
        if (i == 0) {
            segments_1.push_back(Seg(T[i], T[i]) );
        } else {
            if (T[i] > T[i-1]) segments_1.push_back(Seg(T[i], T[i]) );
            else segments_1.push_back(Seg(1, T[i]) );
        }
    }
    for (int i = n-1; i >= 0; -- i) {
        if (i == n-1) {
            segments_2.push_back(Seg(A[i], A[i]) );
        } else {
            if (A[i] > A[i+1]) segments_2.push_back(Seg(A[i], A[i]) );
            else segments_2.push_back(Seg(1, A[i]) );
        }
    }
    reverse(segments_2.begin(), segments_2.end() );

    /*for (int i = 0; i < n; ++ i) {
        cout << segments_1[i].l << ", " << segments_1[i].r << endl;
        cout << segments_2[i].l << ", " << segments_2[i].r << endl;
    }*/

    long long res = 1;
    for (int i = 0; i < n; ++ i) {
        int l = max(segments_1[i].l, segments_2[i].l);
        int r = min(segments_1[i].r, segments_2[i].r);
        if (l > r) {
            cout << 0 << endl;
            return 0;
        }
        res = (res * (r-l+1)) % MOD;
    }
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 3316
import java.util.*;

public class Main{

	public static void main(String[]args){
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int a[]=new int[n];
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		int max=0;
		int min=1000000000;
		for(int i=0;i<n;i++){
			max=Math.max(max,a[i]);
		}
		for(int i=0;i<n;i++){
			min=Math.min(min,a[i]);
		}
		System.out.println(Math.abs(max-min));
	}
}


Measured memory_bytes: 22740
#include <bits/stdc++.h>
#define ll long long
#define maxn 6015 /*rem*/
#define db double
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define fi first
#define se second
using namespace std;
ll dp[maxn][maxn];
int mod;

ll ksm(ll a, ll b) {
   if (!b) return 1;
   ll ns = ksm(a, b >> 1);
   ns = ns * ns % mod;
   if (b & 1) ns = ns * a % mod;
   return ns;
}
ll bk[maxn];
int main() {
	int n;
	cin >> n >> mod;
	n *= 3;
	int ed = n / 3;
	for (int i = 1; i < maxn; i++)
		bk[i] = ksm(i, mod - 2);
	dp[1][0] = 1;
	ll ans = 0;
	for (int i = 1; i <= n + 1; i++) 
		for (int j = 0; j <= ed; j++) {
			if (i != 1) dp[i][j] = dp[i][j] * bk[i - 1] % mod; 
			if (i == n + 1) ans += dp[i][j];
			for (int k = i + 1; k <= i + 3; k++) {
				int ej = j;
				if (k >= i + 2) ej++; 
				dp[k][ej] = (dp[k][ej] + dp[i][j]) % mod; 
			}
		}
	ans %= mod;
	for (int i = 1; i <= n; i++)
		ans = ans * i % mod;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 281728
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
	int D, N, ret;
	cin >> D >> N;
	if(N==100){
		N++;
	}
	ret = pow(100,D)*N;
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 256
n, t = map(int, input().split(" "))
ct = [list(map(int, input().split(" "))) for _ in range(n)]
valid = [_ct for _ct in ct if _ct[-1] <= t]
if len(valid) > 0:
    print(sorted(valid, key=lambda x: x[0])[0][0])
else:
    print("TLE")

Measured memory_bytes: 3060
gen_ls::[String]
gen_ls = ["3","5","7"]++[ls++dig|ls<-gen_ls,dig<-["3","5","7"]]

cond::String->Bool
cond st = (elem '3' st) && (elem '5' st) && (elem '7' st)

solver::Int->Int
solver n = (length.(takeWhile (\s -> n >= read s)).(filter cond)) gen_ls

main::IO()
main=(print.solver.read)=<<getLine

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

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

    int i, j;

    int k = S.size();

    vector<int> T(k+1);
    vector<int> U(k);

    T.at(0) = S[k - 1] - '0';
    U.at(0) = 1;

    for (int i = 1; i < k; ++i) {
        U.at(i) = (U.at(i - 1) * 10) % 2019;

        T.at(i) = ((((S[k - 1 - i]-'0') * U.at(i)) % 2019)+T.at(i-1))%2019;
    }

    T.at(k) = 0;

    int m=0;

    vector<long long> a(2019);

    for (i = 0; i < k+1; ++i) {
        ++a.at(T.at(i));
    }

    long long s = 0;

    for (i = 0; i < 2019; ++i) {
        s += a.at(i) * (a.at(i) - 1) / 2;
    }

    cout << s << endl;

}

Measured memory_bytes: 5184
using System;
using System.Linq;

namespace C_sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                var items = Console.ReadLine().Split();
                
                var H = int.Parse(items[0]);
                var W = int.Parse(items[1]);

                if (H == 0 && W == 0)
                {
                    break;
                }

                var edge = new string('#', W);
                edge += "\n";

                var inner = new string('.', W - 2);
                var inner_line = "#" + inner + "#\n";
                var inner_rect = string.Concat(Enumerable.Repeat(inner_line, H - 2));

                var frame = edge + inner_rect + edge;

                Console.WriteLine(frame);
            }
        }
    }
}



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

int main(){
    int n,k;
    cin >> n >> k;
    vector<int> a(n),num(200000,0);
    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = 0; i < n; i++){
        num[a[i]]++;
    }
    std::sort(num.begin(),num.end(),greater<int>());
    int ans = 0;
    for(int i = 0; i < k; i++){
        ans += num[i];
    }
    ans = n - ans;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#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 int long long  
    typedef long double ld;
    #define pb push_back
    #define f(i,a,b) for(int i=a;i<b;i++)
    #define fd(i,a,b) for(int i=a-1;i>=b;i--)
    #define pf push_front
    #define fi first
    #define se second
    #define INF 1e18
    const int mod=1e9+7;
    int cnt=0; 
    
    
    signed main() {
 
    ios_base::sync_with_stdio(false);
     cin.tie(NULL);  
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("INPUT.txt", "r", stdin);
    // for writing output to output.txt
    freopen("OUTPUT.txt", "w", stdout);
    #endif
    
    // -------------------------------------Code starts here--------------------------------------------------------------------- 
    int t=1;
    //cin>>t;
    while(t--)
    {
       string s,t;
       cin>>s>>t;
       int n=s.length();
       int m=t.length();
       if(n>=m)
       {
          cout<<"No"<<endl;
       }
       else
       {
          int flag=0;
          f(i,0,n)
          {
            if(s[i]!=t[i])
            {
              flag=1;
              break;
            }
          }
          if(flag==1)
          {
            cout<<"No"<<endl;
          }
          else
            cout<<"Yes"<<endl;
       }
    }
} 
 

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,n) for(int i = 1; i <= n; i++)
#define rrep(i,n) for(int i = n - 1; i >= 0; i--)
#define rreps(i,n) for(int i = n; i >= 1; i--)
#define mrep(i,from,n) for(int i = from; i < n; i++)
#define mreps(i,from,n) for(int i = from; i <= n; i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define ERASE(x,val) x.erase(remove(ALL(x), val), x.end())
typedef long long ll;
typedef pair<ll, ll> P;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
ll MOD = 1000000007;

void solve()
{	
	vector<P> ans;
	while (true)
	{
		int x, y; cin >> x >> y;
		if(x == 0 && y == 0)break;
		if(x > y)swap(x, y);
		ans.push_back({x, y});
	}
	rep(i,sz(ans))
	{
		cout << ans[i].first<<" "<< ans[i].second << endl;
	}
	return;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}



Measured memory_bytes: 3232
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int i,j,k,l,n,cnt;
	while(scanf("%d",&n)!=EOF) {
		cnt=0;
		for(i=0;i<=9;i++) {
			for(j=0;j<=9;j++) {
				for(k=0;k<=9;k++) {
					for(l=0;l<=9;l++) {
						if(i+j+k+l==n) {
							cnt++;
						}
					}
				}
			}
		}
		printf("%d\n",cnt);
	}
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define mod 1000000007
#define mod1 998244353
#define timepass 1073741824
#define MAXN 200000 + 5
#define LOGN 20
#define over ((1ll << 32))
using namespace std;
#define N 2005
 
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;*/
 
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define int ll 
#define all(arr) arr.begin() , arr.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i , a , n) for(int i = a ; i < n ; i++)
#define rrep(i , n , a) for (int i = n - 1 ; i >= a ; i--)
#define ms(arr , val) memset(arr , val , sizeof(arr))
#define sp(a , x) cout << fixed << setprecision(a) << x << endl; 
#define siz(temp) (ll)temp.size()
#define len(temp) (ll)temp.length()
#define s(arr) sort(all(arr))
#define r(arr) reverse(all(arr))
#define rs(arr) s(arr) ; r(arr)
#define pi acos(-1)
#define con continue
#define endl "\n"
#define w(q) while(q--)
 
//debug
#define trace1(x)                cout<<#x<<": "<<x<<endl
#define trace2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define trace7(a, b, c, d, e, f , g) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<< f << " | "<< #g <<": "<<g<<endl
#define trace8(a, b, c, d, e, f , g , h) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<< f << " | " << #g <<": "<< g <<" | "<<#h<< ": " << h << endl
 
typedef pair<int , int> pii;
typedef pair<int , pii> piii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<piii> vpiii;


signed main()
{
    int n , k;
    cin >> n >> k;
    int ans = 0;
    for (int i = 1 ; i <= n ;i++)
    {
        int x;
        cin >> x;
        if (x >= k)
            ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
using namespace std;
#include <bits/stdc++.h>
#include<utility>
#include <algorithm>
#include<iterator>
#define  go return 0
#define rep(i,n) for(int i=0;i<n;++i)
#define all(v)   ((v).begin()), ((v).end())
#define F first
#define S second
#define p_b push_back
#define m_p make_pair
typedef long long ll;
typedef double db;
typedef vector<int> ve;
typedef pair<int, int> pa;
typedef vector<pair<int,int> > vepa;
typedef map<int, int> mp;
const ll N=1e5+5;
ll arr[N],A[N],ARR[N]  ;
bool visited[N]={};
ll cnt[N]={};
bool f;
 int main()
{
    string s1,s2,s3;
    cin>>s1>>s2;
    int a,b;
    cin>>a>>b>>s3;
    if(s3==s1)
    {
        cout<<a-1<<" "<<b;
    }else
    {
        cout<<a<<" "<<b-1;
    }
go;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
	int i, d, a, x, f, s, sum;
	while (scanf("%d", &d) != EOF) {
		sum = 0;
		a = 600 / d;
		for (i = 1; i < a; i++) {
        			x = i * d;
        			f = x * x;
        			s = d * f;
        			sum += s;
    		}
    		printf("%d\n", sum);
    		if (d == 0) {
			break;
		}
	}
	return 0;
}



Measured memory_bytes: 2024
#include <iostream>
#include <set>
#include <cstdio>
#include <string>
#include<cmath>
using namespace std;

int main(){
int L,R,ans;
cin>>L>>R;
int x=L;
L=L-L/2019*2019;
R=R-x/2019*2019;
if(R>=2019)
ans=0;
else
{
	ans=2e9;
	for(int i=L;i<=R;i++)
	{
		for(int j=L;j<i;j++)
		ans=min(ans,(i*j)%2019);
	}
	
}
cout<<ans<<"\n";
//cout<<L<<" "<<R;


    return 0;
}

Measured memory_bytes: 384
S = list(input())
N = len(S)
halfS = int((N-1)/2)
rev_S = list(reversed(S))
#S_1 = S[0:halfS]
#S_2 = rev_S[0:halfS]
S__1 = ''.join(S)
S__2 = ''.join(rev_S)
if S__1 == S__2:
    T = S[0:halfS]
    rev_T = list(reversed(T))
    T__1 = ''.join(T)
    T__2 = ''.join(rev_T)
    if T__1 == T__2:
        U = rev_S[0:halfS]
        rev_U = list(reversed(U))
        U__1 = ''.join(U)
        U__2 = ''.join(rev_U)
        if U__1 == U__2:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

else:
    print("No")


Measured memory_bytes: 3064
l,r = map(int,input().split())
mod = 2019
min = 10**9
c = 0
for i in range(l,r):
    for j in range(l+1,r+1):
        if (i*j)%mod < min:
            min = (i*j)%mod
    
        if min == 0:
            break
    if min == 0:
        break

print(min)

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

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

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

/**
 * @brief 多次元 vector の作成
 * @author えびちゃん
 */
namespace detail {
    template<typename T, int N>
    auto make_vec(vector<int>& sizes, T const& x) {
        if constexpr (N == 1) {
            return vector(sizes[0], x);
        } else {
            int size = sizes[N-1];
            sizes.pop_back();
            return vector(size, make_vec<T, N-1>(sizes, x));
        }
    }
}
template<typename T, int N>
auto make_vec(int const(&sizes)[N], T const& x = T()) {
    vector<int> s(N);
    for (int i = 0; i < N; ++i) s[i] = sizes[N-i-1];
    return detail::make_vec<T, N>(s, x);
}

__attribute__((constructor))
void fast_io() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int main() {
    string s, t;
    cin >> s >> t;
    int n = s.size(), m = t.size();
    auto sum = make_vec<int>({2, max(n+1, m+1)}, 0);
    rep(i, n) sum[0][i+1] += sum[0][i] + (s[i] == 'A' ? 1 : 2);
    rep(i, m) sum[1][i+1] += sum[1][i] + (t[i] == 'A' ? 1 : 2);

    int q;
    cin >> q;
    while (q--) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--; c--;
        int x = sum[0][b] - sum[0][a];
        int y = sum[1][d] - sum[1][c];
        if (x % 3 == y % 3) cout << "YES\n";
        else cout << "NO\n";
    }
}


Measured memory_bytes: 4824
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { 
  INIT(){cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


signed main() {
  string s; 
  cin >> s;

  bool ans = true;
  if(s[0] != 'A') ans = false;
  int cnt = 0;
  FOR(i, 2, s.size()-1) if(s[i] == 'C') cnt++;
  if(cnt != 1) ans = false;
  cnt = 0;
  FOR(i, 1, s.size()) if('A' <= s[i] && s[i] <= 'Z') cnt++;
  if(cnt != 1) ans = false;

  if(ans) cout << "AC" << "\n";
  else cout << "WA" << "\n";

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }

int main()
{
    int k, n;
    cin >> k >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    ssort(a);
    int ans = a[n-1] - a[0];
    rep(i,n-1) {
        int _m = a[i] - a[i+1] + k;
        chmin(ans, _m);
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 1024
A, B, K = [int(i) for i in input().split()]

out = set()
for i, j in enumerate(range(A, B + 1)):
    if i + 1 > K:
        break
    out.add(j)
for i, j in enumerate(range(B, A, -1)):
    if i + 1 > K:
        break
    out.add(j)

for i in sorted(list(out)):
    print(i)

Measured memory_bytes: 3060