akhauriyash/Code-Regression huggingface dataset:
i = list(map(int, input().split()))
if i[0]>i[1] and i[0]-i[1]>=2:
	print(2*(i[0])-1)
elif i[1]>i[0] and i[1]-i[0]>=2:
	print(2*(i[1])-1)
else:
	print(i[1]+i[0])

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int thisYear = 2019;

int main() {
  ll l, r;
  cin >> l >> r;
  r = min(r, l + 4038);
  int ans = 2018;
  for (ll i = l; i <=r ; ++i) {
    for (ll j = i + 1; j <= r; ++j) {
      int x = i * j % 2019;
      ans = min(ans, x);
    }
  }

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


Measured memory_bytes: 256
import sys
from fractions import gcd
import bisect
 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

a, b, c, d = [ni() for _ in range(4)]

print(min(a, b) + min(c, d))

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

namespace CompetitiveProgCsLib
{
	class MainProg
	{
		static string R => Console.ReadLine();
		static int RI => int.Parse(R);
		static double RD => double.Parse(R);
		static int[] RIs => R.Split(' ').Select(int.Parse).ToArray();
		static double[] RDs => R.Split(' ').Select(double.Parse).ToArray();
		static void Out(object obj) => Console.WriteLine(obj);
		static void OutLine<T>(IEnumerable<T> obj, string separateChar) => Out(String.Join(separateChar, obj));
		static void Outb(bool b) => Out(b ? "Yes" : "No");
		static void OutB(bool b) => Out(b ? "YES" : "NO");
		static bool IsIn(int y, int x, int h, int w) => 0 <= x && x < w && 0 <= y && y < h;

		static void Main(string[] args)
		{
			var nm = RIs;
			var n = nm[0];
			var m = nm[1];
			var p = RIs;
			var union = new UnionFind(n);
			for(int i = 0;i < m;i++)
			{
				var xy = RIs;
				union.UnionSet(xy[0] - 1, xy[1] - 1);
			}
			int ans = 0;
			for(int i = 0;i < n;i++)
			{
				var x = p[i]-1;
				var y = i;
				if (union.FindSet(x, y)) ans++;
			}
			Out(ans);
		}

		/// <summary>
		/// union findを提供する
		/// 入力は0-origin
		/// </summary>
		public class UnionFind
		{
			#region member
			private List<int> data;
			#endregion

			#region constructor
			/// <summary>
			/// コンストラクタ
			/// </summary>
			/// <param name="size">初期サイズ</param>
			public UnionFind(int size) : this()
			{
				addSize(size - 1);
			}

			public UnionFind()
			{
				data = new List<int>();
				data.Add(0);
			}
			#endregion

			#region public method
			/// <summary>
			/// xの集合とyの集合を併合する
			/// </summary>
			/// <param name="x"></param>
			/// <param name="y"></param>
			/// <returns></returns>
			public void UnionSet(int x, int y)
			{
				x = getRoot(x);
				y = getRoot(y);
				if (x != y) data[x] = y;
			}

			/// <summary>
			/// xとyが同じ集合に入っているかを判定する
			/// </summary>
			/// <param name="x"></param>
			/// <param name="y"></param>
			/// <returns></returns>
			public bool FindSet(int x, int y)
			{
				return getRoot(x) == getRoot(y);
			}
			#endregion

			#region private method
			/// <summary>
			/// 頂点を増やす
			/// </summary>
			/// <param name="size">増やす数</param>
			private void addSize(int size)
			{
				int dataSize = data.Count;
				data.AddRange((new int[size]).Select((value, index) => value = index + dataSize));
			}

			/// <summary>
			/// ルートを取得する
			/// </summary>
			/// <param name="x"></param>
			/// <returns></returns>
			private int getRoot(int x)
			{
				if (x >= size) addSize(x - size + 1);
				if (data[x] == x) return x;
				else return data[x] = this.getRoot(data[x]);
			}
			#endregion

			#region property
			private int size
			{
				get
				{
					return data.Count;
				}
			}
			#endregion
		}
	}
}


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

const int MAX = 100000;

vector<int> G[MAX];
int n;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev){
  prenum[current] = lowest[current] = timer;
  timer++;
  visited[current] = true;

  int next;

  for(int i=0;i<G[current].size();i++){
    next = G[current][i];
    if(!visited[next]){
      parent[next] = current;
      dfs(next, current);

      lowest[current] = min(lowest[current], lowest[next]);
    }
    else if(next != prev){
      lowest[current] = min(lowest[current], prenum[next]);
    }
  }
}

void art_points(){
  for(int i=0;i<n;i++) visited[i] = false;
  timer = 1;
  dfs(0, -1);

  set<int> ap;
  int np = 0;
  for(int i=1;i<n;i++){
    int p = parent[i];
    if(p == 0) np++;
    else if(prenum[p] <= lowest[i]) ap.insert(p);
  }
  if(np > 1) ap.insert(0);
  for(set<int>::iterator it=ap.begin(); it!=ap.end(); it++){
    cout << *it << endl;
  }
}

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

  for(int i=0;i<m;i++){
    int s, t;
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  art_points();
  return 0;
}



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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int[] a = new int[5];
    for(int i=0; i<5; i++){
      a[i] = Integer.parseInt(in.readLine());
    }
    int k = Integer.parseInt(in.readLine());
    boolean flg = true;

    for(int i=0; i<5; i++){
      for(int j=i+1; j<5; j++){
        if(a[j]-a[i]>k) {
          flg = false;
          break;
        }
      }
    }
    System.out.println(flg==true?"Yay!":":(");
  }
}

Measured memory_bytes: 21204
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class MainClass : Scanner
{
    static void Main()
    {
        int N = RInt();
        var A = RLongs();
        int now = 0;
        long money = 1000;
        long tickets = 0;
        while (now < N)
        {
            while (now < N - 1 && A[now] >= A[now + 1]) now++;
            if (now == N - 1) break;
            tickets += money / A[now];
            money%=A[now];
            while (now < N - 1 && A[now] <= A[now + 1]) now++;
            money += tickets * A[now];
            tickets = 0;
        }
        WriteLine(money);
    }
}

class Scanner
{
    public static int RInt() => int.Parse(Console.ReadLine());
    public static long RLong() => long.Parse(Console.ReadLine());
    public static string RString() => Console.ReadLine();
    public static double RDouble() => double.Parse(Console.ReadLine());

    public static int[] RInts() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
    public static int[] RInts(Func<string, int> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static long[] RLongs() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
    public static long[] RLongs(Func<string, long> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static double[] RDoubles() => Array.ConvertAll(Console.ReadLine().Split(), double.Parse);
    public static double[] RDoubles(Func<string, double> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static string[] RStrings() => Console.ReadLine().Split();
    //public static string[] RStrings(Func<string, string> func) => Console.ReadLine().Split().Select(func).ToArray();
    public static T1 ReadStream<T1>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        return r1;
    }
    public static (T1, T2) ReadStream<T1, T2>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        return (r1, r2);
    }
    public static (T1, T2, T3) ReadStream<T1, T2, T3>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        var r3 = (T3)Convert.ChangeType(r[2], typeof(T3));
        return (r1, r2, r3);
    }
    public static (T1, T2, T3, T4) ReadStream<T1, T2, T3, T4>()
    {
        var r = RStrings();
        var r1 = (T1)Convert.ChangeType(r[0], typeof(T1));
        var r2 = (T2)Convert.ChangeType(r[1], typeof(T2));
        var r3 = (T3)Convert.ChangeType(r[2], typeof(T3));
        var r4 = (T4)Convert.ChangeType(r[3], typeof(T4));
        return (r1, r2, r3, r4);
    }
}

Measured memory_bytes: 27540
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M;cin>>N>>M;
  vector<vector<char>> a(N,vector<char>(N));
  vector<vector<char>> b(M,vector<char>(M));
  for(int i=0; i<N; i++){
    string s;cin>>s;
    for(int j=0; j<N; j++)a[i][j]=s[j];
  }
  for(int i=0; i<M; i++){
    string s;cin>>s;
    for(int j=0; j<M; j++)b[i][j]=s[j];
  }
  string ans="No";
  for(int i=0; i<N-M+1; i++){
    for(int j=0; j<N-M+1; j++){
      bool same=true;
      for(int x=0; x<M; x++){
        for(int y=0; y<M; y++){
          if(a[i+x][j+y]!=b[x][y])same=false;
        }
      }
      if(same)ans="Yes";
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()

int main() {
    //1 = A枚　0 = B枚　-1 = C枚　K枚選ぶ
    int A, B, C, K;
    cin >> A >> B >> C >> K;
    int ans = 0;
    
    if (A < K) {
        ans += A;
        K -= A;
    }
    else {
        ans += K;
        K = 0;
    }

    if (K > 0) {
        if (B < K) {
            K -= B;
        }
        else {
            K = 0;
        }
    }

    ans -= K;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3632
x=int(input())
y=int(input())

if x==1 and y==2:
  print(3)
elif x==1 and y==3:
  print(2)
elif x==2 and y==1:
  print(3)
elif x==2 and y==3:
  print(1)
elif x==3 and y==1:
  print(2)
elif x==3 and y==2:
  print(1)

Measured memory_bytes: 3060
x,y = map(int,input().split())
A = [1,3,5,7,8,10,12]
B = [4,6,9,11]
C = [2]
if (x in A and y in A) or (x in B and y in B) or (x in C and y in C):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include <iostream>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <map>
#include <set>
#include <vector>
#include <utility>
#include <queue>
#include <cmath>

#define BEGIN(x) x.begin()
#define END(x) x.end()
#define ALL(x) BEGIN(x), END(x)
#define PAIR make_pair
#define VEC(type) vector<type >
#define endl '\n'

#define FOR(i, A, B) for(auto i = (A);i != (B); i++)
#define FORD(i, A, B) for(auto i = (A);i != (B); i--)

#define READRANGE(begin, end) FOR(it, begin, end) cin >> *it
#define READVEC(V) READRANGE(BEGIN(V), END(V))

using namespace std;

typedef long long lint;
typedef pair<int, int> Pii;
typedef pair<int, lint> Pil;
typedef pair<lint, lint> Pll;
typedef pair<lint, int> Pli;

// ---- BEGIN LIBRARY CODE ----
// ---- END LIBRARY CODE ----
void io_init()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
};

int main(int argc, char **argv)
{
    io_init();

    // Actual program code starts here.
    const int MOD = 1000000007;

    VEC(VEC(int)) F(2005, VEC(int)(2005, 0));
    F[0][0] = 1;
    FOR(n, 1, 2005) {
        FOR(k, 1, 2005) {
            F[n][k] = F[n - 1][k - 1];
            F[n][k] += F[n - 1][k];
            if (F[n][k] >= MOD)
                F[n][k] -= MOD;
        }
    }

    int N, K;
    cin >> N >> K;
    FOR(k, 1, K + 1) {
        cout << (int)((F[K][k] * 1LL * F[N - K + 2][k + 1]) % MOD);
        cout << "\n";
    }

    return 0;
};


Measured memory_bytes: 16000
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;


int solve(int x){
    map<int, int> M;
    for(int i=2; i*i<=x; i++){
        while(x%i==0){
            M[i]++;
            x/=i;
        }
    }
    if(x!=1) M[x]++;
    int v = 1;
    for(auto m:M)
        v *= m.second + 1;
    
    if(v==8) return 1;
    return 0;
}


int main() {
    int N; cin >> N;
    int ans = 0;
    for(int i=1; 2*i-1<=N; i++)
        ans += solve(2*i-1);

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





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

int main(){
    int n;

    cin >>n;
    vector<int> p(n);

    for (int i = 0; i < n;i++){
        cin >> p[i];
    }
    sort(p.rbegin(), p.rend());
    int ans = 0;

    ans += p[0]/2;
    for(int i = 1; i < n; i++){
        ans +=p[i];
    }
    cout << ans <<endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _LIBCPP_DEBUG 0
using namespace std;
typedef long long int ll;
ll MOD = 1e9 + 7;
int INF = 1 << 30;

int main(void){

    int K;cin>>K;
    int A,B;cin>>A>>B;


    for (int i = A; i <= B; ++i) {
        if(i%K==0){
            cout<<"OK"<<endl;
            return 0;
        }
    }
    cout<<"NG"<<endl;
}


Measured memory_bytes: 3620
#include<stdio.h>

int main(void) {
	int A, B, C,c=0;
	scanf("%d", &A);
	scanf("%d", &B);
	scanf("%d", &C);
	if (A == B)
		c++;
	if (A == C)
		c++;
	if (B == C)
		c++;
	if (c == 1)
		printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 128
/*!enjoy karo yaar!*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

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

/*-----<Defines>-----*/
#define     int             long long int
#define     fast()          ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)          begin(x),end(x)
#define     rz(x)           resize(x)
#define     asn(x,y)        assign(x,y)
#define     mem(a,b)        memset(a,b,sizeof(a))
#define     sz(x)           ((int)size(x))
#define     eb              emplace_back
#define     pb              push_back
#define     pf              push_front
#define     pob             pop_back
#define     pof             pop_front
#define     ins             insert
#define     vi              vector<int>
#define     pii             pair<int,int>
#define     mii             map<int,int>
#define     F               first
#define     S               second
#define     remax(a,b)      a=max(a,b)
#define     remin(a,b)      a=min(a,b)
#define     bitcount(x)     __builtin_popcountll(x)
#define     iceil(n,x)      (((n)-1)/(x)+1)
#define     flush           fflush(stdout)

using ull=unsigned long long;
using ll=long long;
using ld=long double;
/*-----</Defines>-----*/

/*-----<Debugging Stuff>-----*/
string to_string(char s)
{   string res="'''";res[1]=s;return res; }

string to_string(string s)
{   return '"'+s+'"'; }

string to_string(const char* s)
{   return to_string((string)s); }

string to_string(bool b)
{   return (b?"true":"false"); }

template<typename A, typename B>
string to_string(pair<A, B> p)
{   return "("+to_string(p.F)+", "+to_string(p.S)+")"; }

template<typename A>
string to_string(A v)
{
    bool first=1; string res="{";
    for(const auto &x:v)
    {
        if(!first)  res+=", ";
        first=0;
        res+=to_string(x);
    }
    res+="}";
    return res;
}

void debug() { cout<<"\n"; }
template<typename Head, typename... Tail>
void debug(Head H, Tail... T)
{
    cout<<" "<<to_string(H);
    debug(T...);
}

#define show(...) cout << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
/*-----</Debugging Stuff>-----*/

/*-----<Mod Operations>-----*/
const int M=1e9+7;
inline int add(int a,int b,int p=M){ a=a+b; if(a>=p) a-=p; return a; }
inline int sub(int a,int b,int p=M){ a=a-b; if(a<0) a+=p; return a; }
inline int mul(int a,int b,int p=M){ a=(a*1ll*b)%p; return a; }
/*-----</Mod Operations>-----*/

/*-----<Constants>-----*/
const ld pi=acos(-1),eps=1e-9;
const ll inf=1e18;
const int N=1;
/*-----</Constants>-----*/

void solve()
{
    int x;
    cin>>x;

    int y=x/200;
    y=10-y;
    cout<<y;
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    for(int z=1;z<=t;++z)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}




Measured memory_bytes: 3632
#include <stdio.h>

#define DATA 1000

int main(void)
{
	int h[DATA], w[DATA];
	int i, j, k;

	for(i = 0;i < DATA;i++)
	{
		scanf("%d %d", &h[i], &w[i]);
		if((w[i] == 0) && (h[i] ==0))
			break;
	}
	for(i = 0;(w[i] != 0) || (h[i] != 0);i++)
	{
		for(j = 0;j < h[i];j++)
		{
			for(k = 0;k < w[i];k++)
				printf("#");
			printf("\n");
		}
		printf("\n");
	}

	return 0;
}

Measured memory_bytes: 580
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <bits/stdc++.h>
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=1;i<=(n);++i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define DUMP(x) cout<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;

class DSummerVacation {
public:
	void solve(std::istream& in, std::ostream& out) {
	    int N, M;
	    in>>N>>M;
	    vector<pii> A(N);
	    REP(i, N) in>>A[i].first>>A[i].second;
	    priority_queue<int> pq;
	    sort(ALL(A));
	    int idx = 0, ans = 0;
	    for(int i=M-1;0<=i;i--){
	        while(idx<N and A[idx].first<=M-i){
	            pq.push(A[idx++].second);
	        }
	        if(!pq.empty()){
	            ans += pq.top(); pq.pop();
	        }
	    }
	    out<<ans<<'\n';
	}
};


int main() {
	DSummerVacation solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
void Main();

using i8  = int8_t;   /* -128 ~ 127 */
using u8  = uint8_t;  /* 0 ~ 255 */
using i16 = int16_t;  /* -32,768 ~ 32,767 */
using u16 = uint16_t; /* 0 ~ 65,535 */
using i32 = int32_t;  /* -2,147,483,648 ~ 2,147,483,647 */
using u32 = uint32_t; /* 0 ~ 4,294,967,295 */
using i64 = int64_t;  /* -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807 */
using u64 = uint64_t; /* 0 ~ 18,446,744,073,709,551,615 */
using f32 = float;    /* (-3.4 * 10^38) ~ (3.4 * 10^38) */
using f64 = double;   /* (-1.7 * 10^308) ~ (1.7 * 10^308) */
using f80 = __float80;
template <class T> using Vec = vector<T>;
constexpr i64 INF = 1010000000000000017;
constexpr i64 MOD = 1e9 + 7;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define ALL(v) v.begin(), v.end()
#define YN(a, b, c) ((c)? a : b)
#define GCD(a, b) __gcd(a, b) /* 最大公約数 */
#define LCM(a, b) (i64)(a / (f64)__gcd(a, b) * b) /* 最小公倍数 */

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

void Main() {
    i32 H, W;
    cin >> H >> W;
    Vec<Vec<char>> a(H, Vec<char>(W));
    for (i32 i = 0; i < H; i++) {
        for (i32 j = 0; j < W; j++) {
            cin >> a[i][j];
        }
    }
    Vec<i32> rh, rw;
    for (i32 i = 0; i < H; i++) {
        i32 sum = 0;
        for (i32 j = 0; j < W; j++) {
            if (a[i][j] == '.') sum++;
        }
        if (sum == W) rw.push_back(i);
    }
    for (i32 j = 0; j < W; j++) {
        i32 sum = 0;
        for (i32 i = 0; i < H; i++) {
            if (a[i][j] == '.') sum++;
        }
        if (sum == H) rh.push_back(j);
    }
    for (i32 i = 0; i < H; i++) {
        if (find(ALL(rw), i) != rw.end()) continue;
        for (i32 j = 0; j < W; j++) {
            if (find(ALL(rh), j) != rh.end()) continue;
            cout << a[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;

int main(){
    int n,q,fig,value;
    cin >> n >> q;
    vector <int> memo(n+1);
    fill(memo.begin(),memo.end(),0);
    priority_queue<pair<int,int> > que;
    que.push(make_pair(0,-1));
    while(q--){
        cin >> fig >> value;
        memo[fig] += value;
        que.push(make_pair(memo[fig],-fig));
        for(;;){
            if(que.top().first == memo[-que.top().second]){
                cout << -que.top().second << " " << que.top().first << endl;
                break;
            }
            que.pop();
        }
    }
}

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

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

    int64_t ans = 0;
    if (K - A >= 0) {
        ans = ans + A;
    } else {
        ans = ans + K;
    }

    K = K - A;
    K = K - B;

    if (K > 0) {
        ans = ans - K;
    }

    cout << ans << endl;
}

Measured memory_bytes: 3624
#include<iostream>
using namespace std;
int main()
{
	int n,d,x,a;
	cin>>n;
	cin>>d>>x;
	int num=x;
	for(int i=1;i<=n;i++){
		cin>>a;
		num+=(d-1-(d-1)%a)/a+1;
	}
	cout<<num;
	return 0;
}

Measured memory_bytes: 256
M = 10**9 + 7
x,y = map(int, input().split())

def solve():
    at = 2*x - y
    bt = 2*y - x
    if at < 0 or bt < 0 or at % 3 != 0 or bt %3 != 0:
        return 0
    a = at // 3
    b = bt // 3
    num = den = 1
    for i in range(max(a, b)+1, (a+b)+1):
        num = num * i % M
    for i in range(2, min(a, b)+1):
        den = den * i % M
    inv_den = pow(den, M-2, M)
    return num * inv_den % M

print(solve())


Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file  
#include <ext/pb_ds/tree_policy.hpp>  
#include <functional> // for less  
using namespace         std;
#define                 int long long
#define                 double long double
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<'\n'
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define N 1014159
#define  vi vector<int>
#define  v  vector
#define die exit(0)
#define alln(arr) arr+1 , arr+1+n
using namespace __gnu_pbds;  
typedef tree<int, null_type, less<int>, rb_tree_tag,  
            tree_order_statistics_node_update> oset; 

int n,m,k,arr[N];

void solve()
{
    //int m,n;
	cin>>m>>n;

	//cout<<ceil(1.0*m/n);
	int sum = 0;
	forn(i,1,n)
	{
		int a;
		cin>>a;
		sum+=a;
	}
	if(sum>=m)
	{
		cout<<"Yes";
	}
	else cout<<"No";	
}


signed main() 
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 
    int t = 1;
    //cin>>t;
    forn(i,1,t)
    {
        solve();
        nl;
    }



    return 0;

}

//       clang++ c.cpp ; ./a.out < a.txt ;  

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

using namespace std;

typedef long long ll;

const int M = 1e5+ 50;

ll a[M],b[M],x[M],v[M];


int main() {
	ll  n,c;
	scanf("%lld %lld",&n,&c);
	
	for(int i=1;i<=n;i++) scanf("%lld %lld",&x[i],&v[i]);x[n+1] = c;
	
//  shun	
	for(int i=1;i<=n;i++) a[i] = a[i - 1] + (v[i] - (x[i] - x[i-1]));
	for(int i=1;i<=n;i++) a[i] = max(a[i-1],a[i]);

//  ni
	for(int i=n;i>=1;i--) b[i] = b[i+1] + (v[i] - (x[i+1] - x[i]));
	for(int i=n;i>=1;i--) b[i] = max(b[i],b[i+1]);
	
	ll ans = 0;
	for(int i=1;i<=n;i++) {
		ans = max(ans,a[i]);
		ans = max(ans,b[i]);
		ans = max(ans,a[i] - x[i] + b[i+1]);
		ans = max(ans,b[i] - (c - x[i]) + a[i-1]);
	}
	
	printf("%lld\n",ans);
	
} 

Measured memory_bytes: 3328
// doubling

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

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using ll = long long;

//2^16 桁数
// 使わない
const int D = 60;
const int MAX_N = 20000;

int to[D][MAX_N];

int main()
{
  ll n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
      cin >> a.at(i);
      a[i]--;  // 0-indexed に変更
  }
  int logK = 1;
  while ((1ll << logK) < k) logK++;
  // doubling[i][j] : j番目から 2^i 進んだ町
  vector<vector<int> > doubling(logK, vector<int>(n));
  rep(i, n) {
    doubling[0][i] = a[i];
  }
  // 前処理 doubling の計算
  for (int i = 0; i < logK - 1; i++) {
      for (int j = 0; j < n; j++) {
        doubling[i + 1][j] = doubling[i][doubling[i][j]];
      }
  }
  int now = 0;
  for (int i = 0; k > 0; i++) {
    //cout << k <<endl;
    if (k & 1) {
      //cout << i << ' ' << k << endl;
      now = doubling[i][now];
      //cout << now << endl;
    } 
    k = k >>1;
  }

  cout << now + 1 << endl;
  
  return 0;
}

Measured memory_bytes: 51744
#include <iostream>
#include <cstdio>

using namespace std;

int N;
int a[105];

int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", a+i);
  }

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0 && a[i] % 2 == 1) ans++;
  }
  printf("%d\n", ans);
}


Measured memory_bytes: 3760
import std.stdio,
	   std.string,
	   std.conv;

void main() {
	while(true){
	string s = readln;
	if (stdin.eof()) break;
	int n = s.chomp.to!int;

	int c = 0;
	foreach(int i; 0..10)
	foreach(int j; 0..10)
	foreach(int k; 0..10)
	foreach(int l; 0..10)
		if (i + j + k + l == n){
			c += 1;
		}

	writeln(c);
	}

}

Measured memory_bytes: 1052
#include<iostream>
#include<queue>
#include<utility>
using namespace std;
#define INF 9999
typedef pair<int,int> P;
int w;//???
int h;//???
int num;//??\????????° 
P pos;//???????????? 
char fty[1005][1005]; 
P f_pos[10];
int step;
int mp[1005][1005];
void bfs(int x,int y){
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			mp[i][j]=INF;
		}
	}
	mp[pos.first][pos.second]=0;
	
	int dx[4]={1,0,-1,0};
	int dy[4]={0,1,0,-1};
	queue<P> que;
	que.push(pos);
	while(que.size()){
		P s = que.front();
		que.pop();
		if(s.first==x&&s.second==y) break;
		for(int i=0;i<4;i++){
			for(int j=0;j<4;j++){
				int nx = s.first+dx[i];
				int ny = s.second+dy[i];
				if(nx>=0&&nx<h&&ny>=0&&ny<w&&mp[nx][ny]==INF&&fty[nx][ny]!='X'){
					mp[nx][ny]=mp[s.first][s.second]+1;
					que.push(P(nx,ny));
				}
			}
		}
	}
	step+=mp[x][y]; 
	pos.first=x;
	pos.second=y;
}
int main(){
	cin>>h>>w>>num;
	step=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>fty[i][j];
			for(int k=1;k<=num;k++){
				if(fty[i][j]-48==k){
					f_pos[k].first=i;
					f_pos[k].second=j;
					break;
				}
				
			}
			if(fty[i][j]=='S'){
				pos.first=i;
				pos.second=j;
			}
		}
	}
	step=0;
	for(int k=1;k<=num;k++){
		bfs(f_pos[k].first,f_pos[k].second);
	}
	cout<<step<<endl;
}

Measured memory_bytes: 7992
number = gets.to_i
vehicle = [ ]
vehicle.push gets.to_i # densha
vehicle.push gets.to_i # basu
vehicle.push gets.to_i # takusi-
vehicle.push gets.to_i # hikouki
vehicle.push gets.to_i # hune

max = 0

vehicle.each_index do |i|
  m = number / vehicle[i]
  r = number % vehicle[i]
  sum = m + (r==0 ? 0 : 1)
  if max < sum
    max = sum
  end
end

p( max + vehicle.size - 1 )


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

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < n; i++)

void solve();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

int main(void) {
    init();
    solve();
    return 0;
}

void solve() {
    ll a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;
    ll buyAB = max(x, y);
    ll minPrice = INT64_MAX;
    rep (i, buyAB + 1) {
        ll price = 0;
        if (x - i > 0) {
            price += (x - i) * a;
        }
        if (y - i > 0) {
            price += (y - i) * b;
        }
        price += i * 2 * c;
        minPrice = min(price, minPrice);
    }
    cout << minPrice << "\n";
}


Measured memory_bytes: 3620
#include<iostream>
#include<algorithm>
using namespace std;
int a[105];
int main(void)
{
    int n;
    cin >> n;
    for(int i=1;i<=n;i++)
        cin >> a[i];
    sort(a+1,a+n+1);
    cout << a[n]-a[1];
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const ll MOD=1e9+7;
ll powmod(ll a, ll k){
    ll ap=a, ans=1;
    while(k){
        if(k&1){
            ans*=ap;
            ans%=MOD;
        }
        ap=ap*ap;
        ap%=MOD;
        k>>=1;
    }
    return ans;
}
ll inv(ll a){
    return powmod(a, MOD-2);
}
ll f[2000001], invf[2000001];
void fac(int n){
    f[0]=1;
    for(ll i=1; i<=n; i++) f[i]=f[i-1]*i%MOD;
    invf[n]=inv(f[n]);
    for(ll i=n-1; i>=0; i--) invf[i]=invf[i+1]*(i+1)%MOD;
}
ll comb(int x, int y){
    if(!(0<=y && y<=x)) return 0;
    return f[x]*invf[y]%MOD*invf[x-y]%MOD;
}
int main()
{
	int x, y;
	cin>>x>>y;
	if((x+y)%3!=0){
		cout<<0<<endl;
		return 0;
	}
	int n=(x+y)/3;
	if(x<n || y<n){
		cout<<0<<endl;
		return 0;
	}
	x-=n;
	y-=n;
	fac(x+y);
	cout<<comb(x+y, x)<<endl;
	return 0;
}

Measured memory_bytes: 14592
import java.awt.geom.*;
import java.io.*;
import java.util.*;


public class Main {
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if((n|m) == 0) break;
			int [] data = new int[n];
			for(int i = 0; i < n; i++){
				data[i] = sc.nextInt();
			}
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i = 0; i < (1 << n); i++){
				int sum = 0;
				for(int j = 0; j < n; j++){
					if((i & (1 << j)) == 0) continue;
					sum += data[j];
				}
				list.add(sum);
			}
			Collections.sort(list);
			int INF = 1 << 24;
			int [] dp = new int[m + 1];
			Arrays.fill(dp, INF);
			dp[0] = 0;
			for(int i = 0; i < m; i++){
				if(dp[i] == INF) continue;
				for(int j = 0; j < list.size(); j++){
					int nextind = i + list.get(j);
					if(nextind > m) break;
					int value = dp[i] + 1;
					dp[nextind] = Math.min(dp[nextind], value);
				}
			}
			System.out.println(dp[m]);
		}
	}
	
	

	public static void main(String [] args){
		new Main().doit();
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <time.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 2020000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

int main(){
	ll x; cin >> x;
	cout << 10-x/200 << endl;
}

Measured memory_bytes: 3632
n, m = map(int, input().split())
xyz = [tuple(map(int, input().split())) for _ in range(n)]

s1 = abs(sum(sorted([x+y+z for x, y, z in xyz])[:m]))
s2 = abs(sum(sorted([x+y-z for x, y, z in xyz])[:m]))
s3 = abs(sum(sorted([x-y+z for x, y, z in xyz])[:m]))
s4 = abs(sum(sorted([x-y-z for x, y, z in xyz])[:m]))
s5 = abs(sum(sorted([-x+y+z for x, y, z in xyz])[:m]))
s6 = abs(sum(sorted([-x+y-z for x, y, z in xyz])[:m]))
s7 = abs(sum(sorted([-x-y+z for x, y, z in xyz])[:m]))
s8 = abs(sum(sorted([-x-y-z for x, y, z in xyz])[:m]))

print(max(s1, s2, s3, s4, s5, s6, s7, s8))

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 200001

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define part(v, s, e) v.begin() + s, v.begin() + e
#define print(v) for (auto i: v) cout << i << " ";

int main() {
    fast;
    ll a, b, c, d, an, l;
    cin >> a >> b >> c >> d;
    ll x = (a/c + bool(a%c)) * c, y = (b/c)*c;
    an = (y-x)/c + 1;
    x = (a/d + bool(a%d)) * d, y = (b/d)*d;
    an += (y-x)/d + 1;
    l = (c*d)/__gcd(c, d);
    //cout << an << " " << l << endl;
    x = (a/l + bool(a%l)) * l, y = (b/l)*l;
    an = an - (y-x)/l - 1;
    cout << b-a + 1 - an << endl;
    return 0;
}


Measured memory_bytes: 256
# AOJ 0022 Maximum Sum Sequence
# Python3 2018.6.16 bal4u

while 1:
	n = int(input())
	if n == 0: break
	s = [0]*5001
	ans = s[0] = int(input())
	for i in range(1, n):
		v = int(input())
		s[i] = v if s[i-1]+v < v else s[i-1]+v
		if s[i] > ans: ans = s[i]
	print(ans)


Measured memory_bytes: 5680
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <numeric>
#include <algorithm>
#include <stack>


using namespace std;
#define INF  1000000
int n;
int num[12] = {1, 6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049};
int dp[100001];
int main() {
    cin >> n;
    for(int i=0; i<100001; ++i){
        dp[i] = INF;
    }
    dp[0] = 0;
    for(int i=1; i<=n; ++i){
        for(int j=0; j<12; ++j){
            if(i < num[j]) break;
            dp[i] = min(dp[i-num[j]] + 1, dp[i]);
        }
    }
    cout << dp[n] << endl;
    return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<math.h>
int main()
{
  int n,i;
  int s[1000];
  double dis=0,ave=0;

     while(1)//二回目以降の処理に注意
       {
	 ave = 0; dis = 0;
      scanf("%d",&n);
      if(n == 0) break;
      for(i=0; i<n; i++)
	{
	  scanf("%d",&s[i]);//各点数
	  ave = ave + s[i];
	}
      ave = ave / n;//平均値
      for(i=0; i<n; i++)
	{
	  dis = dis + (s[i]-ave)*(s[i]-ave);//分散
	   
	}
        
       printf("%lf\n",sqrt(dis / n));
      }
  
    return 0;
}



Measured memory_bytes: 2104
// by Balloons
#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define mpr make_pair
#define debug() puts("okkkkkkkk")
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)

using namespace std;

typedef long long LL;

const int inf = 1 << 30;
const int maxn=4005;

int n,d;
vector<int>g[maxn]; 
int vis[maxn],dis[maxn];
int ex[maxn],ey[maxn];

void dfs(int x){
	vis[x]=1;
	for(int i=0;i<g[x].size();i++){
		int u=g[x][i];
		if(vis[u])continue;
		dis[u]=dis[x]+1;
		dfs(u);
	}
}

int main(){
	scanf("%d%d",&n,&d);
	for(int i=1;i<=n-1;i++){
		scanf("%d%d",&ex[i],&ey[i]);
		g[ex[i]].push_back(ey[i]);g[ey[i]].push_back(ex[i]);
	}
	if(d&1){
		int ans=inf;
		for(int i=1;i<=n-1;i++){
			memset(vis,0,sizeof vis);memset(dis,0,sizeof dis);
			int u=ex[i],v=ey[i];
			vis[v]=1;
			dfs(u);
			
			vis[v]=0;
			dfs(v);
			
			int res=0;
			for(int j=1;j<=n;j++)
				if(dis[j]>(d-1)/2)++ res;
				
			ans=min(ans,res);
		}
		printf("%d\n",ans);
	}else{
		int ans=inf;
		for(int i=1;i<=n;i++){
			int x=i;
			memset(vis,0,sizeof vis);
			dis[x]=0;
			dfs(x);
//			for(int j=1;j<=n;j++)printf("%d ",dis[j]);puts("");
			
			int res=0;
			for(int j=1;j<=n;j++)
				if(dis[j]>d/2)++ res;

			ans=min(ans,res);
		}
		printf("%d\n",ans);
	}

	return 0;
}


Measured memory_bytes: 512
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.next();
		int NoFlag = 0;
		for (int i=0;i<S.length();i++) {
			if((i%2 ==0 && S.charAt(i)=='L' )||(i%2==1 && S.charAt(i)=='R' )){
				NoFlag++;
			}
			else{};	
		}
		if(NoFlag==0){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}
}
		
	

Measured memory_bytes: 21716
#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <ostream>
#include <random>
#include <set>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#ifdef ONLINE_JUDGE
#pragma GCC optimize("O2")
#pragma GCC target("avx,avx2")
#endif

using namespace std;

using u64 = uint64_t;
using i64 = int64_t;
using u32 = uint32_t;
using vi = vector<int>;
using vi64 = vector<i64>;

#define seq(i, a, b) for (int i = (a); i < (b); ++i)
#define rev(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define dbg(x) \
  { cerr << #x << ": " << x << endl; }

constexpr long mod = 998244353;

template <typename T>
class Segment
{
   public:
    Segment(int n)
    {
        len = 1;
        while (len < n) len <<= 1;
        data.resize(n + len);
    }

    void add(int l, int r, T val)
    {
        for (l += len, r += len; l < r; l >>= 1, r >>= 1) {
            if ((l % 2) == 1) { data[l] = (data[l]+val) % mod; ++l; }
            if ((r % 2) == 1) { --r; data[r] = (data[r]+val) % mod; }
        }
    }

    T get(int pos)
    {
        T summa = 0;
        for (pos += len; pos > 0; pos >>= 1) {
            summa = (summa + data[pos]) % mod;
        }
        return summa;
    }

    void set(int pos, T value) { data[pos + len] += value - get(pos); }

   private:
    int len;
    vector<T> data;
};

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

  int n; cin >> n;
  int k; cin >> k;
  Segment<long> f(2*n+1);
  f.add(1, 2, 1);

  vector<pair<int,int>> segments;
  seq(_,0,k) {
    int x,y; cin >> x >> y;
    segments.push_back({x, y});
  }

  seq(i,1,n) {
    for (auto [l,r] : segments) {
      f.add(i+l, i+r+1, f.get(i));
    }
  }

  cout << f.get(n) << endl;
}


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

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		try {
			int lim = Integer.parseInt(in.readLine());
			int[] a = new int[lim];
			for (int i = 0; i < lim; i++) {
				a[i] = Integer.parseInt(in.readLine());
			}

			int cnt = 0;
			int m = (int)Math.sqrt(lim);
			if (m > 100) m = 100;
			
			int[] g = new int[m];
			for (int i = 0; i < m; i++) {
				g[i] = (m - i) * (m - i);
			}
			
			for (int k = 0; k < m; k++) {
				for (int i = g[k]; i < a.length; i++) {
					int v = a[i];
					
					int j = i - g[k];
					while ((j >= 0) && (a[j] > v)) {
						a[j + g[k]] = a[j];
						j = j - g[k];
						cnt++;
					}
					a[j + g[k]] = v;
				}
			}
			
			System.out.println(m);
			System.out.print(g[0]);
			for (int i = 1; i < g.length; i++) {
				System.out.print(" " + g[i]);
			}
			System.out.println();
			System.out.println(cnt);
			
			for (int i = 0; i < a.length; i++) {
				System.out.println(a[i]);
			}
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

Measured memory_bytes: 106496
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long

int h, w;
int dp[105][105][2][2];

int main()
{
	while (1)
	{
		dp[105][105][2][2] = {};
		cin >> h >> w; if (h == 0 && w == 0) return 0;
		//3つ目　下から来た場合0,左から来た場合1
		//4つ目　曲がっていなければ0,曲がっていれば1
		FOR(i, 1, h) dp[i][0][0][0] = 1;
		FOR(j, 1, w) dp[0][j][1][0] = 1;
		FOR(i, 1, h)FOR(j, 1, w)
		{
			dp[i][j][0][0] = (dp[i-1][j][0][0] + dp[i-1][j][0][1]) % 100000;
			dp[i][j][0][1] = dp[i - 1][j][1][0];
			dp[i][j][1][0] = (dp[i][j-1][1][0] + dp[i][j-1][1][1]) % 100000;
			dp[i][j][1][1] = dp[i][j-1][0][0];
		}
		cout << (dp[h-1][w-1][0][0] + dp[h-1][w-1][1][0] + dp[h-1][w-1][0][1] + dp[h-1][w-1][1][1])%100000 << endl;
	}
}

Measured memory_bytes: 1328
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <iomanip>
# define M_PIl        3.141592653589793238462643383279502884
using namespace std;

typedef long long ll;
typedef long double ld;

int main(){
  vector<ll> arr(1e7+7,1);
  for(ll i=2;i<=1e7;i++){
    for(ll z=(i-1);z<=1e7;z+=i){
      arr[z]++;
    }
  }
  ll n; cin >> n;
  ll ans = 0;
  for(ll i=1;i<=n;i++){
    ans += i*arr[i-1];
  }
  cout << ans;
}

Measured memory_bytes: 80812
#include <bits/stdc++.h>
using namespace std;
int main(){
string S,T;
  cin>>S>>T;
  int count=0;
  for(int i=0;i<S.size();i++){
  if(S.at(i)==T.at(i)){
   continue;
  }
    else{
    count++;
    }
  }
  cout<<count;
}

Measured memory_bytes: 3912
#include<bits/stdc++.h>
#define pb push_back
#define sz(v) (v).size()
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define mp make_pair
#define inf 1000000007
#define mod 1000000007
using namespace std;
template <typename T> T Max(T x,T y){return x>y?x:y;}
template <typename T> T Min(T x,T y){return x<y?x:y;}
template <typename T> void chmax(T &x,T y){x=x>y?x:y;return;}
template <typename T> void chmin(T &x,T y){x=x<y?x:y;return;}

typedef long long ll;
int n;
ll ans=1,t1=1,t2=1,t3;

int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		ans*=10;
		ans%=mod;
		t1*=9;
		t1%=mod;
		t2*=8;
		t2%=mod;
	}
	t3=(t1+t1)%mod-t2;
	while(t3<0) t3+=mod;
	ans-=t3;
	while(ans<0) ans+=mod;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3624
// Atcoder 176 ABC
#include <iostream>
using namespace std;
#define ll long long
#define M 1000000007
int main(){
	int n , x, t;
	cin>>n>>x;
	cin>>t;
	if(n%x == 0){
		cout << (n/x)*t << endl;
	}
	else{
		cout << (n/x + 1)*t << endl;
	}
	return 0;

}



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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

int nextInt() { int x; scanf("%d", &x); return x;}
ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  int a = nextInt();
  int b = nextInt();
  if (a < b) {
    cout << string(b, '0' + a) << endl;
  } else {
    cout << string(a, '0' + b) << endl;
  }
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}


Measured memory_bytes: 256
# Aizu Problem ALDS_1_4_A: Linear Search
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input2.txt", "rt")


_ = input()
S = set([int(_) for _ in input().split()])
_ = input()
T = set([int(_) for _ in input().split()])
print(len(S.intersection(T)))

Measured memory_bytes: 8596
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int k = scan.nextInt();

		if (k % 2 == 0) {
			System.out.println((k / 2) * (k / 2));
		} else {
			System.out.println((k - 1) / 2 * (k + 1) / 2);
		}
		scan.close();

	}

}


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

typedef pair <int, int> pii;

const int MAXN = 1e5 + 5;

int N;
set <pii> adj[MAXN];
int ans[MAXN];

void load() {
	scanf("%d", &N);
	for (int j = 0; j < 2; j++)
		for (int i = 1; i <= N; i++) {
			int par;
			scanf("%d", &par);
			if (par == -1)
				par = 0;
			adj[i].insert({par, j});
			adj[par].insert({i, j});
		}
}

void euler(int x) {
	while (!adj[x].empty()) {
		pii edge = *adj[x].begin();
		adj[x].erase(edge);
		adj[edge.first].erase({x, edge.second});
		euler(edge.first);
		ans[edge.first] += edge.second;
		ans[x] -= edge.second;
	}
}

void solve() {
	for (int i = 1; i <= N; i++)
		if (adj[i].size() % 2) {
			puts("IMPOSSIBLE");
			return;
		}
	
	euler(0);
	
	puts("POSSIBLE");
	for (int i = 1; i <= N; i++)
		printf("%d ", ans[i]);
	puts("");
}

int main() {
	load();
	solve();
	return 0;
}

Measured memory_bytes: 36864
#include <algorithm>
#include <bitset>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  int a;
  for (int i = 0; i < n; ++i) {
    cin >> a;
    if (a % 2 == 0) {
      if (a % 3 != 0 && a % 5 != 0) {
        cout << "DENIED";
        return 0;
      }
    }
  }
  cout << "APPROVED";
  return 0;
}


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

public class Program
{

    public void Proc()
    {
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        this.IslCount = inpt[0];
        int shipCount = inpt[1];

        for (int i = 0; i < shipCount; i++) {
            inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();
            if(!Ship.ContainsKey(inpt[0])) {
                Ship.Add(inpt[0], new Dictionary<int, bool>());
            }
            if(!Ship.ContainsKey(inpt[1])) {
                Ship.Add(inpt[1], new Dictionary<int, bool>());
            }
            Ship[inpt[0]][inpt[1]] = true;
            Ship[inpt[1]][inpt[0]] = true;
        }

        string ans = "IMPOSSIBLE";
        if(this.CanReach(1, 2)) {
            ans = "POSSIBLE";
        }
        Console.WriteLine(ans);
    
    }

    private int IslCount;

    private bool CanReach(int idx, int remain) {
        if(idx == this.IslCount) {
            return true;
        }
        if(remain<=0) {
            return false;
        }
        if(Ship.ContainsKey(idx)) {
            foreach(int nextIsl in Ship[idx].Keys) {
                if(nextIsl == 1) {
                    continue;
                }
                if(CanReach(nextIsl, remain-1)) {
                    return true;
                }
            }
        }
        return false;
    }
    private Dictionary<int, Dictionary<int, bool>> Ship = new Dictionary<int, Dictionary<int, bool>>();


    public class Reader
	{
		private static StringReader sr;
		public static bool IsDebug = false;
		public static string ReadLine()
		{
			if (IsDebug)
			{
				if (sr == null)
				{
					sr = new StringReader(InputText.Trim());
				}
				return sr.ReadLine();
			}
			else
			{
				return Console.ReadLine();
			}
		}
		private static string InputText = @"



3 2
1 2
2 3

";
	}

	public static void Main(string[] args)
	{
#if DEBUG
		Reader.IsDebug = true;
#endif
		Program prg = new Program();
		prg.Proc();
	}
}

Measured memory_bytes: 79292