akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
#define N 10001
int main(){
    int v[100001] = {0};
    int n, m, a, b;
    cin >> n >> m;
    for (int i = 0; i < m; ++i){
        cin >> a >> b;
        ++v[a];
        ++v[b];
    }
    for (int i = 0; i < n; ++i) if (v[i] % 2) {
        cout << "NO";
        return 0;
    }
    cout << "YES";
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <complex>
#include <bitset>
#include <numeric>
#include <random>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n) ;++(i))
#define REPN(i,a,n) FOR((i),(a),(a)+(n))
#define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i))
#define PB push_back
#define MP make_pair
#define SE second
#define FI first
#define DBG(a) cerr<<(a)<<endl;
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;  typedef pair<LL, LL> PLL; typedef vector<LL> VLL;
const LL LINF=334ll<<53; const int INF=15<<26; const LL MOD=1E9+7;

class com{
public:
bool operator()(pair<int,int> a,pair<int,int> b)const{
    return (a.FI/(a.FI+a.SE))<(b.FI/(b.FI+b.SE));
}
};

bool comp(const pair<double,double> a, const pair<double,double> b){
    return (a.FI/(a.FI+a.SE))>(b.FI/(b.FI+b.SE));
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<pair<double,double>> d(6);
    FOR(i,0,6)cin>>d[i].FI;
    FOR(i,0,6)cin >> d[i].SE;
    REP(i,d.size()){
        if(d[i].FI==0 and d[i].SE==0){
            d.erase(d.begin()+i);
            i--;
        }
    }
    sort(d.begin(),d.end(),comp);
    double ans=1.0;
    REP(i,d.size()){
        double tmp=0,tmp2=0,r=d[i].SE/(d[i].FI+d[i].SE);
        REP(j,d.size()){
            tmp+=max(d[j].FI*r/100,d[j].SE*(1-r)/100);
        }
        ans=min(ans,tmp);
        //cout << fixed<< setprecision(10)<< r <<' '<<tmp<<endl;
    }

    cout << fixed<< setprecision(10)<<ans <<endl;

    return 0;
}


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

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      int minv = Integer.parseInt(br.readLine());
      int n1   = Integer.parseInt(br.readLine());
      int maxv = n1- minv;
      if ( n1 < minv ) minv = n1;

      for( int i=2,r,mv; i<n; i++) {
        r = Integer.parseInt(br.readLine());
        if ( r < minv ) minv = r;
        else if ( (mv = r-minv) > maxv ) maxv = mv;
      }

      System.out.println(maxv);
    }
  }
}


Measured memory_bytes: 42544
def bikkuri(n):
    if n <= 0:
        return 1
    else:
        return n * bikkuri(n - 1)

nm = input().split(" ")
print(bikkuri(int(nm[0])) // (bikkuri(int(nm[0]) - 2) * 2) * (0 if int(nm[0]) < 2 else 1) + bikkuri(int(nm[1])) // (bikkuri(int(nm[1]) - 2) * 2) * (0 if int(nm[1]) < 2 else 1))

Measured memory_bytes: 3060
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;

class Solution {
public:
    vector<int> solve(int m, int k) {
        int N = 1 << (m + 1);
        int M = 1 << m;
        if (k >= M) {
            return {};
        }

        vector<int> res;
        if (k == 0) {
            for (int i = 0; i < M; ++i) {
                res.push_back(i);
                res.push_back(i);
            }
            return res;
        }

        int a = 0, b = 0;
        for (int i = 1; i < M; ++i) {
            if (i == k) {
                continue;
            }
            if ((i ^ k) < M && (i ^ k) > 0) {
                a = i;
                b = i ^ k;
                break;
            }
        }

        if (a == 0 || b == 0) {
            return {};
        }

        vector<bool> used(M, false);

        used[a] = used[b] = used[k] = true;
        deque<int> que;
        for (auto x : {k}) {
            que.push_back(x);
        }

        for (int i = 0; i < M; ++i) {
            if (!used[i]) {
                if (que.size() < N) {
                    que.push_back(i);
                }
            }
        }
        que.push_back(a);
        que.push_back(b);
        for (int i = M - 1; i >= 0; --i) {
            if (!used[i]) {
                if (que.size() < N) {
                    que.push_back(i);
                }
            }
        }
        que.push_back(k);
        que.push_back(b);
        que.push_back(a);

        for (auto x : que) {
            res.push_back(x);
        }
        return res;
    }
};

int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int m, k;
    cin >> m >> k;
    Solution sol;
    auto res = sol.solve(m, k);
    if (res.empty()) {
        cout << -1 << '\n';
    } else {
        int n = res.size();
        for (int i = 0; i < n; ++i) {
            cout << res[i] << (i == n - 1 ? '\n' : ' ');
        }
    }

    return 0;
}

Measured memory_bytes: 3004
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int P = 1000000007;
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;


int main(void){ios::sync_with_stdio(false);cin.tie(0);
//////////////////////////////////////////////////////
    
    int n,k;
    cin>>n>>k;
    ll ans=0;
    rep(i,n){
        int a;
        cin>>a;
        if(a>=k)ans++;
    }
    fin(ans);
    
//////////////////////////////////////////////////////
return 0;}


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

void get_expected(char* out,int number) {
	if(number%15==0)strcpy(out,"FizzBuzz");
	else if(number%3==0)strcpy(out,"Fizz");
	else if(number%5==0)strcpy(out,"Buzz");
	else sprintf(out,"%d",number);
}

int main(void) {
	int player_num,nokori_num;
	int now_player;
	int player_list[1000];
	int hatugen_num;
	char hatugen_buf[10000];
	char expected_buf[10000];
	int i;
	int first;
	while(1) {
		scanf("%d%d",&player_num,&hatugen_num);
		if(player_num==0 && hatugen_num==0)break;
		for(i=0;i<player_num;i++)player_list[i]=i+1;
		nokori_num=player_num;
		now_player=0;
		for(i=1;i<=hatugen_num;i++) {
			scanf("%s",hatugen_buf);
			if(nokori_num>1) {
				get_expected(expected_buf,i);
				if(strcmp(hatugen_buf,expected_buf)!=0) {
					player_list[now_player]=0;
					nokori_num--;
				}
				now_player++;
				if(now_player>=player_num)now_player=0;
				while(player_list[now_player]<=0) {
					now_player++;
					if(now_player>=player_num)now_player=0;
				}
			}
		}
		for(i=0,first=1;i<player_num;i++) {
			if(player_list[i]>0) {
				if(!first)putchar(' ');
				printf("%d",player_list[i]);
				first=0;
			}
		}
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 0
//FIRST THINK THEN CODE.

#include <bits/stdc++.h>
 
 
using namespace std;
 
typedef long long ll;
 
#define MOD 998244353
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define FOR(i,n)  for(ll i=0;i<n;i++)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
ll newmod(ll a,ll b)
 {
  return ((a%b)+b)%b;
}
 
 
ll powM(ll a,ll b,ll m )
{ 
  a%=m;
  ll ans=1LL;
  while(b)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }
 
return ans;
}


 
ll poww(ll a,ll b)
{ 
  
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a;
    a=a*a;
    b>>=1;
  }
 
return ans;

}

template<typename T,typename F>
void chmax( T &a,F b){
  if(b>a)a=b;
}

template<typename T,typename F>
void chmin( T &a,F b){
  if(b<a)a=b;
}

const ll N=3e5+5;



int main()
{ 

IOS;

ll n;cin>>n;

ll cnt=0;

for(int i=1;i<=n;i++)
{
  ll x;cin>>x;
  if(i&1&&x&1)cnt++;
}
cout<<cnt<<endl;


return 0;
 
}



Measured memory_bytes: 3632
// https://atcoder.jp/contests/abc046/tasks/arc062_a
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int c, int d) { return c / gcd(c, d) * d; }

// 割り算の切り上げ(7 / 3 = 2.333 → 3)
int divu(int a, int b) { return (a - 1) / b + 1; }
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a = 1, b = 1;
    cin >> n;
    REP(i, n) {
        int x, y;
        cin >> x >> y;
        int mul = max(divu(a, x), divu(b, y));
        a = x * mul;
        b = y * mul;
    }
    cout << a + b << endl;

    return 0;
}


Measured memory_bytes: 256
module Main where

import Data.List

main :: IO()
main = do
  [a,b,c,d] <- map read . words <$> getLine
  print $ solve a b c d

solve :: Int -> Int -> Int -> Int -> Int
solve a b c d = case length (intersect [a..b] [c..d]) - 1 of
  result
    | result <= 0   -> 0
    | otherwise     -> result


Measured memory_bytes: 508
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		int H = sc.nextInt();

		int W = sc.nextInt();

		int ans = (N-H+1)*(N-W+1);

		System.out.println(ans);

	}

}


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

typedef long long int ll;

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

int main() {
  string a,b;
  cin >> a >> b;
  int n = stoi(a+b);
  rep(i,1000) {
    if (i*i == n) {
      cout << "Yes" << endl;
      exit(EXIT_SUCCESS);
    }
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3612
// AOJ 1622 Go around the Labyrinth
// 2018.2.13 bal4u

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

typedef struct { char r, c, d, k; } STACK;
STACK sk[3000]; int top;
char map[53][53];
char mk[53][53];
int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};


int check(int h, int w)
{
	int i, r, c, d, k, nr, nc;

	memset(mk, 0, sizeof(mk));
	sk[0].r = 1, sk[0].c = 1, sk[0].d = 1, sk[0].k = 0, top = 1;
	while (top) {
		r = sk[--top].r, c = sk[top].c, d = sk[top].d, k = sk[top].k;
		if (mk[r][c]) continue;
		mk[r][c] = 1;
		if      (k == 0 && r == 1 && c == w) k = 1;
		else if (k == 1 && r == h && c == w) k = 2;
		else if (k == 2 && r == h && c == 1) k = 3;
		else if (k == 3 && r == 2 && c == 1) return 1;

		d += 3; if (d >= 4) d -= 4;
		for (i = 0; i < 4; i++) {
			if (--d < 0) d = 3; 
			nr = r + mv[d][0], nc = c + mv[d][1];
			if (map[nr][nc] && !mk[nr][nc]) {
				sk[top].r = nr, sk[top].c = nc, sk[top].d = d, sk[top++].k = k;
			}
		}
	}
	return 0;
}

int main()
{
	int h, w, r, c;
	char buf[10], *p;

	while (fgets(buf, 10, stdin) && *buf != '0') {
		sscanf(buf, "%d%d", &h, &w);
		memset(map, 0, sizeof(map));
		for (r = 1; r <= h; r++) {
			fgets(p=map[r]+1, 52, stdin);
			c = w; while (c--) *p = (*p == '.'), p++; *p = 0;
		}
		puts(check(h, w)? "YES": "NO");
	}
	return 0;
}



Measured memory_bytes: 2040
#include <iostream>
#include <vector>
#include <bitset>
#include <cmath>

using namespace std;
typedef long long ll;

const ll MOD = 1e9 + 7;
int t[401][401][401];
long long a[401], b[401];
long long n, c;

long long dp(int i, int c, int lst)
{
    if (t[i][c][lst] != -1)
        return t[i][c][lst];
    if (i == n && c == 0)
        return 1;
    if (i == n)
        return 0;
    if (lst == 0)
    {
        ll ans = 0;
        if (c > 0)
        {
            for (int j = a[i]; j <= b[i]; j++)
            {
                ans += (ll)j * dp(i, c - 1, j);
                ans %= MOD;
            }
        }
        ans += (b[i] - a[i] + 1) * dp(i + 1, c, 0);
        ans %= MOD;
        return t[i][c][lst] = ans;
    }
    else
    {
        ll ans = dp(i + 1, c, 0);
        if (c > 0)
            ans += (ll)lst * dp(i, c - 1, lst);
        ans %= MOD;
        return t[i][c][lst] = ans;
    }
}

int main()
{
    for (int i = 0; i <= 400; i++)
        for (int j = 0; j <= 400; j++)
            for (int k = 0; k <= 400; k++)
                t[i][j][k] = -1;
    cin >> n >> c;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> b[i];
    }
    cout << dp(0, c, 0);
}


Measured memory_bytes: 252160
import java.io.*;
import java.lang.Integer;
public class Main {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String in  = br.readLine() ;
			String[] numStr = in.split(" ");
			int[] num = new int[4];
			num[0] = Integer.parseInt(numStr[0]);
			num[1] = Integer.parseInt(numStr[1]);
			num[2] = Integer.parseInt(numStr[2]);
			int cnt = 0;
			for( int n = num[0] ; n <= num[1] ; n++) {
				if ( (num[2]%n) == 0 ) cnt++;
			}
			System.out.println(cnt);
		} catch ( IOException e ) {
			System.out.println("??¨??????????????????????????????");
		}
	}
}

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

using namespace std;
int main(){
    int N;
    cin >> N;
    int F[105][15];
    for (int i = 0; i < N; i++){
        for (int j = 0; j < 10; j++){
            cin >> F[i][j];
        }
    }
    int P [105][15];
    for (int i = 0; i < N; i++){
        for (int j =0; j < 11; j++){
            cin >> P[i][j];
        }
    }
    int total[100000];
    int maxtotal =  -(1 <<30);
    for (int i = 1; i < (1 << 10); i++){
        total[i] = 0;
        for (int j = 0; j < N; j++){
            int counter = 0;
            for (int k = 0; k < 10; k++){
                if ((i & (1 << k)) && F[j][k]){
                    counter++;
                }
            }
            //cout << counter;
            total[i] += P[j][counter];
        }
        //cout << total[i] << endl;
        maxtotal = max(total[i], maxtotal);
    }

    cout << maxtotal << endl;
    return 0;
}

Measured memory_bytes: 256
main = do
  n <- readLn
  p <- map read . words <$> getLine
  putStrLn (if (f p [1,2..n]) <= 2 then "YES" else "NO")

f :: [Int] -> [Int] -> Int
f a b
  | a == [] = 0
  | head a == head b = 0 + f (tail a) (tail b)
  | otherwise = 1 + f (tail a) (tail b)


Measured memory_bytes: 764
//Om Sree Sai Ram
#include "bits/stdc++.h"
using namespace std;

const int mod = 1e9+7;

void add_self(int&a,int b)
{
  a+=b;
  if(a>=mod)
  {
    a-=mod;
  }
}

int mul(int a,int b)
{
  long long  ans = (long long)a*b;
  return ans%mod;
}

int n;

struct matrix {
    vector<vector<int>> m;
    matrix() {
        m.resize(n, vector<int>(n));
    }
    matrix operator* (const matrix& b) const {
        matrix c = matrix();
        for(int i = 0; i < n; ++i) {
            for(int j = 0; j < n; ++j) {
                for(int k = 0; k < n; ++k) {
                    add_self(c.m[i][k], mul(m[i][j], b.m[j][k]));
                }
            }
        }
        return c;
    }
};


int main() 
{


 //int n;
 long long k;
 cin>>n>>k;
 //cout<<" k = "<<k<<endl;
 vector<vector<int>>can(n,vector<int>(n));
 for(int i=0;i<n;i++)
 {
  for(int j=0;j<n;j++)
  {
    cin>>can[i][j];
  }
 }
 //cout<<" check "<<endl;
 matrix a = matrix();
 matrix tmp = matrix();
 a.m = can;

//initializing tmp with identity matrix

 for(int i=0;i<n;i++)
 {
  tmp.m[i][i] = 1;
 }
 
 while(k)
 {
  if(k&1)
    {
      tmp = tmp*a;
    }
    
    a = a*a;
    //divide k by two
    k = k>>1;

 }

  //vector<int>dp(n,1);
  //dp[i] represents number of ways to reach ith node of the graph
  // with k steps. for that you need number of ways to reach the child 
  // with k-1 steps.
  // // O(k^2*n^2)
  // for(int step=1;step<=k;step++)
  //   {
  //     vector<int> new_dp(n);
  //     for(int i=0;i<n;i++)
  //     {
  //       for(int j=0;j<n;j++)
  //       {
  //         if(can[i][j])
  //         {
  //         new_dp[j] += dp[i];
  //        }
  //       }
  //     }
  //     dp = new_dp;
  //   }

    int ans =0;
    for(int i=0;i<n;i++)
    {
      for(int j = 0;j<n;j++)
      {
        add_self(ans,tmp.m[i][j]);
      }
    }
cout<<ans%mod<<endl;
return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter

val br = BufferedReader(InputStreamReader(System.`in`))
val pw = PrintWriter(System.out)
fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    // 回答をここに書く
    val (A, B, C) = listOfInt()
    val count = B / A
    println(if(C > count) { count} else {C})
}

// 入力取得
fun next() = br.readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun listOfString() = next().split(" ")
fun listOfInt() =listOfString().map { it.toInt() }
fun listOfLong() =listOfString().map { it.toLong() }

// 約数のList
fun divisor(value : Long) : List<Long> {
    val max = Math.sqrt(value.toDouble()).toLong()
    return (1..max)
        .filter { value % it == 0L }
        .map { listOf(it, value / it) }
        .flatten()
        .sorted()
}

// 範囲内の素数を取得
// fromだけ指定すると戻り値の個数で素数判定ができる
fun prime(from : Long, to : Long = from) : List<Long> {
    return (from..to).filter { i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all { j ->  i % j != 0L }
    }
}

// 素因数分解
fun decom(value : Long) : List<Long>{
    if (value == 1L) return listOf(1)
    val max = Math.sqrt(value.toDouble()).toLong()
    return prime(2, max).filter { value % it == 0L }
}

// 最大公約数
fun gcd(a : Long, b : Long) : Long {
    return if (a % b == 0L) b else gcd(b, a % b)
}

// 文字列を入れ替え
fun swap(base : String, a : String, b : String) : String {
    return base.map {
        when (it) {
            a.toCharArray()[0] -> b
            b.toCharArray()[0] -> a
            else -> it.toString()
        }
    }.joinToString()
}

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

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

int main(){
  int N,K;
  cin >> N >> K;

  vector<int> data(N);
  for(int i=0; i<N; i++){
    cin >> data.at(i);
  }

  auto dist= [](int l, int r){
    if(r <= 0){
      return -l;
    }
    else if(l >= 0){
      return r;
    }
    else{
      return min(-l, r)+ (r-l);
    }
  };

  int ans= INT_MAX;
  for(int left=0, right=K-1; right<N; left++, right++){
    ans= min(ans, dist(data.at(left), data.at(right)));
  }

  cout << ans << endl;
}

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

int main() {
	int H, W;
	while (true) {
		cin >> H >> W;
		if (H == 0 && W == 0)break;
		for (int i=1;i<=H;i++) {
			for (int j=1;j<=W;j++) {
				cout << '#';
			}
			cout <<endl;
		}
		cout <<endl;
	}


}

Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int main() {
	long long W, H, x;
	cin >> W >> H;
	vector<long long> P;
	P.reserve(W + H);
	for (int i = 0; i < W; i++)
		cin >> x, P.push_back(x * 2);
	for (int i = 0; i < H; i++)
		cin >> x, P.push_back(x * 2 + 1);
	sort(P.begin(), P.end());
	W++, H++;
	long long r = 0;
	for (auto p : P) {
		if (p % 2)
			r += p / 2 * W, H--;
		else
			r += p / 2 * H, W--;
	}
	cout << r;
	return 0;
}

Measured memory_bytes: 1792
/* ANTHOR KUMAR DAS
KUET ECE 2K18*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sc(a) scanf("%d",&a)
#define sc1(n) scanf("%lld",&n)
#define sc2(b,c) scanf("%lld%lld",&b,&c)
#define f(a,b) for(a=0;a<b;a++)
#define pb(a) push_back(a)
#define br break
int main()
{
    vector<ll int>a,b;
    ll i,j,n,k,q,p;
    cin>>n>>k>>q;
    f(i,q)
    {
        cin>>p;
        b.pb(p);
    }
    f(i,n)
    {
        a.pb(k);
    }
    f(i,q)
    {
        a[b[i]-1]++;
    }
    f(i,n)
    {
        if((a[i]-q)>0)
        {
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }



    return 0;
}



Measured memory_bytes: 2548
import scala.annotation.tailrec
import scala.io.Source

object Main extends App {
  val lines = Source.stdin.getLines()
  val n = lines.next().toInt
  val list = lines.next.split(" ")
  val realList = list.toList
  solve(realList)


  def solve(list: List[String]): List[Int] = {
    list.map(_.toInt).foldLeft(List[Int]())((x, y) => {
      val sorted = insert(x, y)
      println((sorted ::: realList.drop(sorted.size)).mkString(" "))
      sorted
    })
  }

  def insert(list: List[Int], x: Int): List[Int] = list match {
    case Nil => List(x)
    case y :: ys => if (y > x) x :: y :: ys else y :: insert(ys, x)
  }
}


Measured memory_bytes: 46068
f :: String->Int->[Int]
f [] _=[]
f (x:xs) c1= if x=='W' then c1 : f xs (c1+1) else c1 : f xs c1

f2 :: String->Int->[Int]
f2 [] _=[]
f2 (x:xs) c1= if x=='E' then c1 : f2 xs (c1+1) else c1 : f2 xs c1

main =do
        e<-getLine
        e2<-getLine
        let z1= f e2 0
            z2= reverse (f2 (reverse e2) 0)
        putStrLn $ show $ minimum $ map (\(a,b)->a+b) $ zip  z1 z2

Measured memory_bytes: 43388
/*
    if you can't see the repay
    Why not just work step by step
    rubbish is relaxed
    to ljq
*/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <cmath>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
using namespace std;

#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define lc (rt<<1)
#define rc (rt<<11)
#define mid ((l+r)>>1)
#define MOD 1000000007

typedef pair<int,int> pll;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const int _inf = 0xc0c0c0c0;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const ll _INF = 0xc0c0c0c0c0c0c0c0;
const ll mod =  (int)1e9+7;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll ksm(ll a,ll b,ll mod){int ans=1;while(b){if(b&1) ans=(ans*a)%mod;a=(a*a)%mod;b>>=1;}return ans;}
ll inv2(ll a,ll mod){return ksm(a,mod-2,mod);}
void exgcd(ll a,ll b,ll &x,ll &y,ll &d){if(!b) {d = a;x = 1;y=0;}else{exgcd(b,a%b,y,x,d);y-=x*(a/b);}}//printf("%lld*a + %lld*b = %lld\n", x, y, d);
const int MAX_N = 10025;
int dp[MAX_N][105][2],D;
char str[MAX_N];
int arr[MAX_N],len;
ll dfs(int pos,int now,bool limit)
{
    if(dp[pos][now][limit]>=0) return dp[pos][now][limit]%MOD;
    if(pos==len+1) return dp[pos][now][limit] = (now==0);
    int up = limit?arr[pos]:9,sum = 0;
    for(int i = 0;i<=up;++i)
    {
        sum+=dfs(pos+1,(now+i)%D,limit&&i==up);
        if(sum>=MOD) sum-=MOD;
    }
    return dp[pos][now][limit] = sum;
}
int main()
{
    //ios::sync_with_stdio(false);
    //freopen("a.txt","r",stdin);
    //freopen("b.txt","w",stdout);
    scanf("%s",str+1);
    scanf("%d",&D);
    len = strlen(str+1);
    for(int i = 1;i<=len;++i) arr[i] = str[i] - '0';
    memset(dp,-1,sizeof(dp));
    printf("%lld\n",(dfs(1,0,true)-1+MOD)%MOD);
    //fclose(stdin);
    //fclose(stdout);
    //cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
    return 0;
}


Measured memory_bytes: 9600
#include<stdio.h>
int main(void){
  int n, i, b, j, ans=0;
  scanf("%d", &n);
  int a[n];
  for(i=0;i<n;i++){
    scanf("%d", &a[i]);
  }
  for(i=0; i<n; i++){
    for(j=n-1; j>i; j--){
      if(a[i] > a[j]){
        b = a[i];
        a[i] = a[j];
        a[j] = b;
        ans++;
      }
    }
  }
  if(ans<=1){
    printf("YES\n", ans);
  }else{
    printf("NO\n");
  }
  return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£????????????
		Scanner sc = new Scanner(System.in);
		//???????????±????????????????????°
		int n = sc.nextInt();
		//???????????£?¨?
		int list[] = new int[n];
		//?????????????´?
		for(int i = 0; i < n; i++){
			list[i] = sc.nextInt();
		}
			//?°??????????????????????
			for(int i = n-1; i>=0;i--){
				//??????????????????????????????????????????
				if(i > 0){
					System.out.print(list[i] + " ");
				}else{
					System.out.print(list[i]);
				}
			}
			//??????
			System.out.println();
	}
}

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

public class Main {

  public static void main(String[] args) throws IOException {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    String readStr;
    int angle = 0;
    double x = 0;
    double y = 0;

    while (true) {
      String[] strs = reader.readLine().split(",");
      int forwardLength = Integer.parseInt(strs[0]);
      int rotateAngle = Integer.parseInt(strs[1]);
      if (forwardLength == 0 && rotateAngle == 0)
        break;
      x += Math.sin(Math.toRadians(angle)) * forwardLength;
      y += Math.cos(Math.toRadians(angle)) * forwardLength;
      angle += rotateAngle;
    }

    System.out.println((int) x);
    System.out.println((int) y);

  }

}

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

int main(){
    int n;
    cin >> n;
    int t=n;
    int fx=n%10;
    for(int i=0;n>0;i++){
        n/=10;
        fx+=n%10;
    }
    if(t%fx==0)
    puts("Yes");
    else
    puts("No");
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# 整数の入力
L = input().split()
LS = [int(i) for i in L]
X = abs(LS[0])
K = LS[1]
D = LS[2]

length = X % D
move = X // D

if X - K * D >= 0:
    print(X - K * D)
else:
    if (K - move) % 2 == 0:
        print(length)
    else:
        print(abs(length - D))

Measured memory_bytes: 9032
#include <bits/stdc++.h>
//For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test int t; cin>>t; while(t--)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopr(i,a,b) for(int i=a;i>=b;i--)
#define loops(i,a,b,step) for(int i=a;i<b;i+=step)
#define looprs(i,a,b,step) for(int i=a;i>=b;i-=step)
#define ull unsigned long long int
#define ll long long int
#define P pair
#define PLL pair<long long, long long>
#define PII pair<int, int>
#define PUU pair<unsigned long long int, unsigned long long int>
#define L list
#define V vector
#define D deque
#define ST set
#define MS multiset
#define M map
#define UM unordered_map
#define mp make_pair
#define pb push_back
#define pf push_front
#define MM multimap
#define F first
#define S second
#define IT iterator
#define RIT reverse_iterator
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define all(a) a.begin(),a.end()
#define ld long double
using namespace std;
// For ordered_set
using namespace __gnu_pbds;
template <typename T>
using ord_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const ll maxn = 1e5;
const ll inf = 1e9;
const double pi = acos(-1);

int main(){
	int n;
  cin >> n;
  string a,b;
  cin >> a >>b;
  loop(i,0,n)cout << a[i] << b[i];
   return 0;
}

Measured memory_bytes: 256
import sys
n,m = map(int,input().split())
d = [None]*n
for i in range(n):
    a,b = map(int,input().split())
    d[i] = [a,b]

d.sort(key=lambda x: x[0])

ryoukin = 0
cnt = 0
for lst in d:
    for i in range(lst[1]):
        ryoukin += lst[0]
        cnt += 1
        if cnt == m:
            print(ryoukin)
            sys.exit()

Measured memory_bytes: 21220
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i < n; i++)
#define reps(i, n) for(int i=1; i <= n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

using namespace std;
using ll=long long;

//---------------------------------------------------------------------------------------------------
int main() {
  string s;
  cin >> s;
  int Q;cin >> Q;

  deque<char> q;
  for(auto c: s)q.push_back(c);
  bool flip = false;
  rep(i,Q){
    int t;
    cin >> t;
    if(t==1){flip = !flip;}
    else {
      int f; char c;
      cin >> f >> c;
      if(flip)f=3-f;
      if(f==1)q.push_front(c);
      if(f==2)q.push_back(c);
    }
  }
  if(flip)reverse(ALL(q));
  for (auto c:q)cout << c;
}

Measured memory_bytes: 896
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
 { 
	
	public static void main (String[] args)
	 {
Scanner scan=new Scanner(System.in);

	    
	    String s=scan.next();
	    String t=scan.next();
	    if(t.substring(0,s.length()).equals(s))
	    System.out.println("Yes");
	    else
	    System.out.println("No");
	   
	   
		
   
   }
	   
	 }



Measured memory_bytes: 35660
import java.util.Scanner;

//Caesar Chipher
public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			String[] s = sc.nextLine().split(" ");
			for(int i=0;i<26;i++){
				boolean f = false;
				for(int j=0;j<s.length;j++){
					char[] a = s[j].toCharArray();
					for(int k=0;k<a.length;k++){
						if(Character.isLowerCase(a[k]))
							a[k] = (char)((a[k]-'a'+1)%26+'a');
					}
					s[j] = new String(a);
					if(s[j].equals("the")||s[j].equals("this")||s[j].equals("that"))f=true;
				}
				if(f)break;
			}
			boolean f = true;
			for(String r:s){
				if(!f)System.out.print(" ");
				f=false;
				System.out.print(r);
			}
			System.out.println();
		}
	}
}

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

#ifdef _DEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> xs;
    for (int i = 0; i < N; ++i) {
        int x;
        cin >> x;
        xs.push_back(x);
    }
    int mn = numeric_limits<int>::max();
    for (int p = 1; p <= 100; ++p) {
        int sum = 0;
        for (int i = 0; i < N; ++i) {
            sum += (xs[i] - p) * (xs[i] - p);
        }
        mn = min(mn, sum);
    }
    cout << mn << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define mod 1000000007
int main()
{
  long long int n,k;
  scanf("%lld %lld",&n,&k);
  long long int ans=0,min,max;
  for(long long int i=k;i<=n+1;i++)
  {
    min=(i*(i-1))/2;
    max=(n*(n+1))/2-((n+1-i)*(n-i))/2;
    ans+=(max-min+1);
    ans=ans%mod;
  }
  printf("%lld",ans);
}

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

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

signed main(){
  int n, k; cin >> n >> k;
  int ans = 0;
  rep(i,n-1){
    ans += ans/(k-1) + 1;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3104
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(void){
   int n;
   char s[101];
   scanf("%d",&n);
   scanf("%s",&s);
   
   char t[101];
   
   t[0] = s[0];
   int k=0;
   for(int i=n/2;i<n;i++){
       t[k] = s[i];
       k++;
   }
   t[k] = '\0';
   s[n/2] = '\0';
   if(strcmp(s,t) == 0) printf("Yes\n");
   else printf("No\n");
}


Measured memory_bytes: 256
from bisect import bisect

n, k = map(int, input().split())
*v, = map(int, input().split())
candidate = []
for i in range(k+1):
    for j in range(k-i+1):
        if i + j >= n:
            candidate.append(v)
        elif j == 0:
            candidate.append(v[:i])
        else:
            candidate.append(v[:i]+v[(-1)*j:])
ans = 0
for cand in candidate:
    cand.sort()
    idx = bisect(cand, -1)
    rem = k-len(cand)
    p = min(idx, rem)
    if ans < sum(cand[p:]):
        a = cand
        b = p
        ans = sum(cand[p:])
print(ans)


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

#define reps(i, n, m) for (int i = (int) (n); i < (int) (m); i++)
#define rep(i, n) reps(i, 0, (n))
#define all(v) (v).begin(), (v).end()

const int inf = 1e9+100;
vector<vector<int>> dp;
vector<int> a, b;

int dfs(int l, int r) {
    int& res = dp[l][r];
    if (res != inf) return res;
    if (r - l == 1) return res = 0;
    reps(i, l+1, r) {
        int t = dfs(l, i) + dfs(i, r) + a[l] * a[i] * b[r-1];
        res = min(res, t);
    }
    return res;
}

int main() {
    int n; cin >> n;
    a.resize(n); b.resize(n);
    rep(i, n) cin >> a[i] >> b[i];
    dp.resize(n+1, vector<int>(n+1, inf));
    cout << dfs(0, n) << endl;
}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
#define ll long long
#define ulli unsigned long long int
#define ld long double  
using namespace std; 
void solve(); 
int main() 
{ 
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
  
    int t = 1; 
    //cin >> t; 
    while (t--) { 
        solve(); 
    } 
  
    cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
    return 0; 
} 

void solve() {
    string a, b;
    cin >> a >> b;

    string c = a+b;
    float d = atoi(c.c_str());

    if (ceil(sqrt(d)) == floor(sqrt(d))) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
}

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

int main() {
  int A,B;
  cin >> A >> B;
  if (A == 1) {
    A = 14;
  }
  if (B == 1) {
    B = 14;
  }
  if (A > B) {
    cout << "Alice" << endl;
  }
  if (A == B) {
    cout << "Draw" << endl;
  }
  if (A < B) {
    cout << "Bob" << endl;
  }
}

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

#define IOS                               \
	ios_base::sync_with_stdio(false); \
	cin.tie(0);                       \
	cout.tie(0);                      \
	cin.exceptions(cin.failbit);
#define int long long int //Comment when Unnecessary
#define ll long long
#define sz(a) (int)((a).size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define pii pair<int, int>
#define vi vector<int>
#define F first
#define S second
#define endl "\n" // Remove on Interactive

const int N = 300009;
const int mod = 1000000007;

void pre()
{
}

int32_t main()
{
	IOS;
	pre();
	int n, m;
	string s;
	cin >> s;
	int a = 0, b = 0;
	rep(i, 0, 3)
	{
		if (s[i] == 'A')
			a++;
		else
			b++;
	}
	if (a > 0 && b > 0)
	{
		cout << "Yes\n";
	}
	else
	{
		cout << "No\n";
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define REPr(i,n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m , n) for(int i = (n);i >=(m);--i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define VSCD(v,N) REP(i,N){int (x); SCD(x); v.PB(x);}
#define VSCLLD(v,N) REP(i,N){long long (x); SCLLD(x); v.PB(x);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x,S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x,y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
typedef pair<int,int> PII;
typedef pair<long long,long long> PLL;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const ll MOD = 1000000007;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

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;
}
///////////////////////////////////////////////
int main(){
    int N,K;
    cin >> N >> K;
    if (N % K != 0) PRINTD(1);
    else PRINTD(0);
}


Measured memory_bytes: 256
#include<iostream>
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
int x, y, a, b;
int main()
{
    IO
    cin>>x>>y;
    b=(y-2*x)/2;
    a=(y-4*b)/2;
    if(2*a+4*b==y && a+b==x && a>=0 && b>=0)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}


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

#define int long long
#define pb push_back 
#define pf push_front 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i, n) for ( int i = 0 ; i < (n); i++ )
#define All(v) v.begin(), v.end()

typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;

signed main() {
	int N;
	int A[100001];
	char op[100001];
	int dp[100001][3];	

	fill_n(*dp, 100001*3, -INF);
	
	cin >> N;
	cin >> A[0];
	dp[0][0] = A[0];

	for ( int i = 1; i < N; i++ ) cin >> op[i] >> A[i];
	
	for ( int i = 1; i < N; i++ ) {
		if ( op[i] == '+' ) {
			dp[i][0] = dp[i-1][0]+A[i];
			dp[i][1] = dp[i-1][1]-A[i];
			dp[i][2] = dp[i-1][2]+A[i];
		} else {
			//open
			dp[i][1] = max(dp[i-1][0], dp[i-1][2])-A[i];
			dp[i][0] = dp[i][2] = dp[i-1][1]+A[i];			
		}

		//close
		dp[i][1] = max(dp[i][1], dp[i][2]);
		dp[i][0] = max(dp[i][0], dp[i][1]);
	}

	cout << *max_element(dp[N-1], dp[N-1]+3) << endl;

	return 0;
}


Measured memory_bytes: 3456
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int cnt[100];
signed main(void)
{
	int n, m;
	cin >> n >> m;
	REP(i, m) {
		int a, b;
		cin >> a >> b;
		cnt[a-1]++;
		cnt[b-1]++;
	}

	REP(i, n) {
		cout << cnt[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
#define in(a) scanf("%lld", &(a))
#define in2(a,b) scanf("%lld %lld",&(a),&(b))
#define in3(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c))
#define ind(a) scanf("%lf", &(a))
#define ins(a) scanf("%s", (a))
#define inc(a) scanf("%c", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a))
//      puts(a) printf("%s\n", a) 文字はこっち
//your code here!
int main(void){
    ll N, a[100100], ans=0, next, i=0;
    in(N);
    rep(i, N) in(a[i]);
    for(ll can=N+5; can; can--){
        next = a[i];
        ans++;
        if(next==2){
            put(ans);
            return 0;
        }
        i = next - 1;
    }
    puts("-1");
    return 0;
}


Measured memory_bytes: 896
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            if (n == 1)
                out.println("Hello World");
            else {
                int a = in.nextInt();
                int b = in.nextInt();
                out.println(a + b);
            }
        }

    }

    static class FastScanner {
        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int bufPointer;
        private int bufLength;

        public FastScanner(InputStream in) {
            this.in = in;
        }

        private int readByte() {
            if (bufPointer >= bufLength) {
                if (bufLength == -1)
                    throw new InputMismatchException();

                bufPointer = 0;
                try {
                    bufLength = in.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (bufLength <= 0)
                    return -1;
            }
            return buffer[bufPointer++];
        }

        private static boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public long nextLong() {
            long n = 0;

            int b = readByte();
            while (isSpaceChar(b))
                b = readByte();

            boolean minus = (b == '-');
            if (minus)
                b = readByte();

            while (b >= '0' && b <= '9') {
                n *= 10;
                n += b - '0';
                b = readByte();
            }

            if (!isSpaceChar(b))
                throw new NumberFormatException();

            return minus ? -n : n;
        }

        public int nextInt() {
            long n = nextLong();

            if (n < Integer.MIN_VALUE || n > Integer.MAX_VALUE)
                throw new NumberFormatException();

            return (int) n;
        }

    }
}



Measured memory_bytes: 20692
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;

//最大公約数
int gcd(int a,int b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}

//最小公倍数
int lcm(int a,int b){
	return a /gcd(a,b) * b;
}

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

// 素因数分解
vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

// 10進数から2進数
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}




int main() {
  ll w, h, n;
  cin >> w >> h >> n;
 
  vector<ll> x(n);
  vector<ll> y(n);
  vector<ll> a(n);
  for (ll i = 0; i < n; ++i) {
    cin >> x[i] >> y[i] >> a[i];
  }
 
  ll wi = 0;
  ll hi = 0;
  for (ll i = 0; i < n; ++i) {
    if (a[i] == 1) {
      wi = max(wi, x[i]);
    } else if (a[i] == 2) {
      w = min(w, x[i]);
    } else if (a[i] == 3) {
      hi = max(hi, y[i]);
    } else if (a[i] == 4) {
      h = min(h, y[i]);
    }
  }
 
  ll ans = 0;
  if ((w-wi) > 0 && (h-hi) > 0) {
    ans = (w-wi) * (h-hi);
  }
  cout << max(ans, 0LL) << endl;
 
  return 0;
}

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

char maze[50][50];
int  dist[50][50];

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

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  
  string s;

  cin>>s;
  rep(i,s.size()){
    if(i%2==0){
      if(s[i]=='R' || s[i]=='U' || s[i]=='D')
        continue;
      else{
        cout<<"No"<<endl;
        return 0;
      }
    }
    if(i%2==1){
      if(s[i]=='L' || s[i]=='U' || s[i]=='D')
        continue;
      else{
        cout<<"No"<<endl;
        return 0;
      }
    }
  }
  cout<<"Yes"<<endl;
  
  
}
  



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

int main() {
  int N,sum,q,r;
  cin >> N;
  sum = 0;
  q = N;
  for (int i=0;i<8;i++){
    r = q%10;
    q/=10; 
    sum += r;
    if (i == 8-1){
      sum +=q;
    }
  }
  if (!(N%sum)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256