akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define int long long
int f[1000005], inv[1000005], mod = 998244353;
int quickmod (int x, int y) {
	int ans = 1;
	while (y) {
		if (y & 1) ans = (ans * x) % mod;
		x = (x * x) % mod;
		y >>= 1;
	} 
	return ans;
}
int C (int x, int y) {
	return f[x] * inv[x-y] % mod * inv[y] % mod;
}
int invC (int x, int y) {
	return inv[x] * f[x-y] % mod * f[y] % mod;
}
signed main () {
	int n, m;
	scanf ("%lld %lld", &n, &m);
	f[0] = 1;
	for (int i = 1; i <= 1000000; i++) f[i] = (f[i-1] * i) % mod;
	inv[1000000] = quickmod (f[1000000], mod - 2);
	for (int i = 999999; i >= 0; i--) inv[i] = (inv[i+1] * (i + 1)) % mod;
	int ans = 0;
	for (int i = 1; i <= min (n, m); i++) ans = (ans + (C (n + m - 2 * i, n - i) * C (2 * i, i))) % mod;
	ans = (ans * invC (n + m, m) % mod * inv[2]) % mod;
	printf ("%lld", (ans + max (n, m)) % mod);
	return 0;
}

Measured memory_bytes: 18868
import java.util.Scanner;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.lang.Math;

class Main{
    
    public static void main(String[] args){
        InputStreamReader inputStreamReader = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(inputStreamReader);
        
        String str;
        int[] num;
        boolean flag = false; // 提出時はfalse
        boolean first = true;
        
        int n = 0;
        int total = 0;
        int max = -100000;
        int[] list = null;

        try {
            while(flag || reader.ready()){
                str = reader.readLine();
                num = getNum(str);

                if (first) {
                    list = new int[n = num[0]];
                    max = -100000;
                    first = false;
                    continue;
                }

                list[--n] = num[0];
                total = 0;

                for (int i = n; i < list.length; i++){
                    max = (total += list[i]) > max ? total : max;
                }

                if(n == 0) {
                    System.out.println(max);
                    first =true;
                }


            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static int[] getNum(String str){
    //private static double[] getNum(String str){
        String[] data = str.split(" "); 

        
        int[] num = new int[data.length];
        for (int i = 0; i < data.length; i++){
            num[i] = Integer.parseInt(data[i]);
        }
        

        /*
        double[] num = new double[data.length];
        for (int i = 0; i < data.length; i++){
            num[i] = Double.parseDouble(data[i]);
        }
        */

        return num;
    }
}


Measured memory_bytes: 26888
#include<stdio.h>
int main(){
  for(;;){
    int H,W;
    scanf("%d %d", &H, &W);
    if(H == 0 && W == 0)break;
    int h,w;
    for(h = 1 ; h <= H/2 ; h++){
      for(w = 1 ; w <= W/2 ; w++){
	printf("#.");
      }
      if(W%2 == 1){
	printf("#");
      }
      printf("\n");
      for(w = 1 ; w <= W/2 ; w++){
	printf(".#");
      }
      if(W%2 == 1){
	printf(".");
      }
      printf("\n");
    }
    if(H%2 == 1){
      for(w = 1 ; w <= W/2 ; w++){
	printf("#.");
      }
      if(W%2 == 1){
	printf("#");
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}



Measured memory_bytes: 2040
using System;

namespace HelloWorld
{
    class Program
    {
        static void Main()
        {
            const int READALL = 8;
            string[] auth = {
                                "1100000011",
                                "1000000010000000100000001",
                                "1111",
                                "1000000110000001",
                                "11000000011",
                                "100000001100000001",
                                "110000011"
                                };
            string content;
            while ((content = Console.ReadLine()) != null)
            {
                for (int i = 0; i < READALL; ++i)
                {
                    content += Console.ReadLine();
                }
                for (int i = 0; i < READALL - 1; ++i)
                {
                    if (content.Contains(auth[i]))
                    {
                        Console.WriteLine((char)('A' + i));
                    }
                }
            }
        }
    }
}


Measured memory_bytes: 17960
N = int(input())
S = input()

al = [chr(i) for i in range(65, 65+26)]
res_list = []
for s in S:
    tidx = al.index(s)
    if 0 <= tidx+N <=25:
        # print(al[tidx+N])
        res_list.append(al[tidx+N])
    else:
        # print(al[abs(25-(tidx+N)) - 1])
        res_list.append(al[abs(25-(tidx+N)) - 1])
print(''.join(res_list))


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

    divisors.sort()
    return divisors


N = int(input())

list_y = make_divisors(N)
#  print(list_y)
point = len(list_y)
if point % 2 == 0:
    print(list_y[point // 2] + list_y[point // 2 - 1] - 2)
else:
    print(list_y[point // 2] * 2 - 2)

Measured memory_bytes: 3272
fn main() {
    let mut buf = String::new();
    let _ = std::io::stdin().read_line(&mut buf).ok();
    let mut downs = Vec::new();
    let mut lakes: Vec<(usize, usize)> = Vec::new();
    let mut sum = 0;
    
    for (i,c) in buf.trim().chars().enumerate() {
        if c == '\\' {
            downs.push(i);
        } else if c == '/' {
            match downs.pop() {
                Some(left) => {
                    sum += i - left;
                    lakes.push((left, i - left));
                },
                None => (),
            }
        }
        while lakes.len() >= 2 && lakes[lakes.len()-2].0 > lakes[lakes.len()-1].0 {
            let (l, a) = lakes.pop().unwrap();
            let (_, ao)   = lakes.pop().unwrap();
            lakes.push((l, a+ao));
        }
    }
    println!("{}", sum);
    print!("{}", lakes.len());
    if lakes.len() != 0 {
        print!(" ");
    }
    for i in 0..lakes.len() {
        print!("{}", lakes[i].1);
        if i != lakes.len()-1 {
            print!(" ");
        }
    }
    println!()
}



Measured memory_bytes: 5024
// Problem : E - Double Factorial
// Contest : AtCoder Beginner Contest 148
// URL : https://atcoder.jp/contests/abc148/tasks/abc148_e
// Memory Limit : 1024.000000MB 
// Time Limit : 2000.000000milisec 
// Powered by CP Editor (https://github.com/coder3101/cp-editor2)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0);cout<<fixed<<setprecision(16);
#define ll long long int
#define ld long double
#define el '\n'
#define El '\n'
#define PI (ld)3.141592653589793238462643383279502884197169399375105820974944
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < n; i++)
#define pll pair<ll, ll>
#define ml map<ll,ll>
#define vpl vector<pll>
#define vvl vector<vector<ll> >
#define vvpl vector< vector<pll> >
#define ff first
#define ss second
#define pqueue priority_queue< ll >
#define pdqueue priority_queue< ll,vl ,greater< ll > >
#define mem(a,b) memset(a,b,sizeof(a));
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) (ll)a.size()
#define all(a) a.begin(),a.end()
#define vl vector<ll>


/*#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}*/


//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

using namespace __gnu_pbds;
 
typedef tree<pll,null_type,less<pll>,rb_tree_tag,tree_order_statistics_node_update> order_set;

// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << t<<" "; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << v.first << " " << v.second ; }

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}


ll kv;
ll t,n,x,y,h,k,z,p,q,w;
string s,s1,s2;
//vvl v;
//vl vis,d;

int main() {
    IOS;
    cin>>n;
	if(n%2)cout<<0;
	else{
		n/=2;
		while(n>0){
			n/=5;kv+=n;
		}
		cout<<kv;
	}
    return 0;
}


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

int main(void){
   int N,K;
   cin>>N>>K;
   int ans=10000;
   for(int i=0;i<=N;i++){
      int sum=0;
      for(int j=N;j>=N-i;j--){
         sum=(int)pow(2,i)+j*K;
      }
      ans=min(sum,ans);
   }
   cout<<ans<<endl;
   return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		String s = "";
		boolean minus = n<0;
		if(minus)n*=-1;
		while(n > 0) {
			if(n%2 == 1) {
				s = '1' + s;
				if(minus) {
					n++;
				}else {
					n--;
				}
			} else {
				s = '0' + s;
			}
			minus = !minus;
			n/=2;
		}
		if(s.length() == 0) {
			System.out.println(0);
		} else {
			System.out.println(s);
		}
	}
}


Measured memory_bytes: 23252
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string S;
    cin >> S;
    if(S == "ABC"){
        cout << "ARC" << endl;
    }else{
        cout <<"ABC" << endl;
    }
    return 0;
}


Measured memory_bytes: 3612
import math
a, b, x = map(int, input().split())

if abs(((a**2) * b) / 2 - x) < 1e-2:
    print(45)
elif ((a**2) * b) == x:
    print(0)
elif ((a**2) * b) / 2 < x:
    atan = math.degrees(math.atan((a**3)/(2*b*(a**2) - 2*x)))
    print(90-atan)
else:
    atan = math.degrees(math.atan((2*x)/(a*(b**2))))
    print(90-atan)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
//#define int long long int
//#define ll long long int
#define ld long double
#define getFaster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define rep(i,init,n) for(int i=init;i<(int)n;i++)
#define rev(i,n,init) for(int i=(int)n;i>=init;i--)
#define MAXN 200005
#define MOD2 998244353
#define MOD1 1e9+7
#define f first
#define s second
#define endl '\n'
#define pii pair<int,int>
#define piii pair<pii,int>
#define precise(i) cout<<fixed<<setprecision(i)
#define codejam cout<<"Case #"<<ii+1<<": ";
#define impossible cout<<"IMPOSSIBLE"<<endl;
#define error(s) throw runtime_error(s)
// std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// int myRand(int R) {
// 	int val=rng() % R;
//       assert(val>=0);
//       return val;
// }

using namespace std;
const long double PI = atan(1.0)*4;
const int64_t INF=3e18;
const int32_t LOG=21;
const int32_t MOD=MOD1;



int32_t main()
{ 
      getFaster;
      int tests=1; 
      //cin>>tests;
      rep(ii,0,tests)
      {
            string s;
            cin>>s;
            int cnt=0;
            int ans=0;
            for(auto it:s)
            {
                 if(it=='R')
                 {
                       cnt++;
                       continue;
                 }
                 ans=max(ans,cnt);
                 cnt=0;
            }
            ans=max(ans,cnt);
            cout<<ans<<endl;
      } 
      return 0;                         
}

Measured memory_bytes: 3632
function Main(input) {
    var N = parseInt(input[0], 10);
    var a = input.slice(1)
        .map(e => parseInt(e, 10))
        .sort((a, b) => {
            return b - a;
        });

    var sum = 1;

    for (var i = 1; i < N; i++) {
        if (a[i-1] > a[i]) {
            sum++;
        }
    }

    console.log(sum);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));

Measured memory_bytes: 7628
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def main():
    N = int(readline())
    a = [0]+[int(i) for i in readline().split()]
    table = [0 for _ in range(N+1)]     
    def S(a, i):
        res = 0
        j = i
        while i <= N:
            res += a[i]
            i += j
        return res%2

    for i in reversed(range(1, N+1)):
        x = S(table, i)
        table[i] = (S(table, i)+a[i])%2

    m = sum(table)
    print(m)
    for i in range(1, N+1):
        if table[i]:
            print(i, end=' ')
if __name__ == '__main__':
    main()


Measured memory_bytes: 7080
#include <bits/stdc++.h>
using namespace std;
using ll  = long long;
using vl  = vector<ll>;
using pll = pair<ll,ll>;
using vll = vector<pll>;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rng(i,a,b) for(int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main() {
    string s; cin >> s;
    if (s[0]=='7' or s[1]=='7' or s[2]=='7') {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3612
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(N) for (int i = 0; i < N; i++)

int main(){
    string S, K;
    cin >> S >> K;
    long K_int = stol(K);
    long one_count = 0;
    for (long i = 0; i < K_int; i++){
        if (S[i] == '1'){
            if (i == K_int - 1) cout << S[i] << endl;
            else continue;
        }else{
            cout << S[i] << endl;
            break;
        }
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>

int main()
{
    std::string input;
    int count;
    std::cin >> input;
    std::cin >> count;
    
    for (int n = 0; n < count + 1; ++n)
    {
        std::string line;
        std::getline(std::cin, line, '\n');
        std::stringstream ss(line);
        
        int i = 0;
        
        std::string com;
        int a, b;
        std::string key;
        
        while (std::getline(ss, line, ' '))
        {
            switch (i)
            {
            case 0:
                com = line; break;
            case 1:
                a = std::stoi(line); break;
            case 2:
                b = std::stoi(line); break;
            case 3:
                key = line; break;
            }
            
            ++i;
        }
        
        if (com == "print")
        {
            for (int at = a; at <= b; ++at)
                std::cout << input[at];
            
            std::cout << std::endl;
        }
        else if (com == "replace")
        {
            int ki = 0;
            for (int at = a; at <= b; ++at)
            {
                input[at] = key[ki++];
            }
        }
        else
        {
            std::string temp;
            for (int at = b; at >= a; --at)
            {
                temp += input[at];
            }
            
            int ki = 0;
            for (int at = a; at <= b; ++at)
            {
                input[at] = temp[ki++];
            }
        }
    }
    
    return 0;
}


Measured memory_bytes: 3220
using System;
using System.Globalization;
using System.IO.Pipes;
using System.Runtime.InteropServices;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int i, j, k;

            i = int.Parse(str[0]);
            j = int.Parse(str[1]);
            k = int.Parse(str[2]);

            if (i>=j && i>=k) Console.WriteLine(10 * i + j + k);
            else if (j>=i && j>=k) Console.WriteLine(10 * j + i + k);
            else Console.WriteLine(10 * k + i + j);
        }

    }
}


Measured memory_bytes: 27412
import sys
A,B,C = map(int, input().split())
K = int(input())

for i in range(K):
    for j in range(K):
        if C*(2**(K-i-j)) > B*(2**j) > A*(2**i):
            print("Yes")
            sys.exit()
        else: continue
print("No")

Measured memory_bytes: 8968
N,M = map(int,input().split())
edge = [[] for i in range(N)]

for i in range(M):
	a,b = map(int,input().split())
	edge[a-1].append(b-1)
	edge[b-1].append(a-1)

cnt = 0
for i in range(N):
	for j in edge[i]:
		E = [[n for n in edge[m] if not((n,m)==(i,j) or (n,m)==(j,i))] for m in range(N)]
		searched = []
		search = [i]

		while len(search) > 0:
			s = search.pop(0)
			if s in searched:
				continue
			searched.append(s)
			for v in E[s]:
				search.append(v)
		if len(searched) < N:
			cnt += 1
print(int(cnt/2))



Measured memory_bytes: 3064
N,M = list(map(int,input().split()))
listA = []
for i in range(N):
    listA.append(int(input()))
listA.sort()
min_sum = float("INF")
for i in range(N-M+1):
    if min_sum > listA[i+M-1]-listA[i]:
        min_sum = listA[i+M-1]-listA[i]
print(min_sum)

Measured memory_bytes: 7384
import datetime
import sys

for line in sys.stdin:
	days = line.strip().split(' ')
	days = list(map(int, days))
	da = datetime.datetime(2016, 7, 11, days[0], days[1], days[2])
	db = datetime.datetime(2016, 7, 11, days[3], days[4], days[5])
	delta = str(db - da).split(':')
	delta = [str(int(v)) for v in delta]
	print(' '.join(delta))

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

string build_str(vector<int> nums, bitset<3> ops)
{
    string s = to_string(nums.at(0));
    for (int i = 0; i < 3; i++)
    {
        if (ops.test(i))
        {
            s += "+";
        }
        else
        {
            s += "-";
        }
        s += to_string(nums.at(i + 1));
    }

    s += "=7";
    return s;
}

int sum(vector<int> nums, bitset<3> ops)
{
    int sum = nums.at(0);
    for (int i = 0; i < 3; i++)
    {
        if (ops.test(i))
        {
            sum += nums.at(i + 1);
        }
        else
        {
            sum -= nums.at(i + 1);
        }
    }
    return sum;
}

int main()
{

    int N, A, B, C, D;
    cin >> N;

    D = N % 10;
    N /= 10;

    C = N % 10;
    N /= 10;

    B = N % 10;
    N /= 10;

    A = N % 10;

    vector<int> nums = {A, B, C, D};
    bitset<3> s;
    for (int tmp = 0; tmp < (1 << 3); tmp++)
    {
        s = bitset<3>(tmp);
        if (sum(nums, s) == 7)
        {
            break;
        }
    }

    cout << build_str(nums, s) << endl;
    return 0;
}

Measured memory_bytes: 3684
#include <stdio.h>

typedef long long ll;

ll A[200005];

int main() {

	int N;

	scanf("%d",&N);

	int i;

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

	ll ans=0ll;

	int l,r;

	r=0;

	ll sum,xor;

	for(l=0;l<N;l++){
		if(l==0){sum=xor=0ll;}
		else{
			sum-=A[l-1]+A[r];
			xor=sum;
		}
		for(;r<N;r++){
			sum+=A[r];
			xor^=A[r];
			if(sum!=xor){break;}
		}
		ans+=r-l;
	}

	printf("%lld\n",ans);

	return 0;
}

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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class FPondSkater {
public:
    int dx[4] = {-1, 1, 0, 0};
    int dy[4] = {0, 0, -1, 1};

    void solve(std::istream& cin, std::ostream& cout) {
        int H, W, K;
        cin >> H >> W >> K;
        int sx, sy, gx, gy;
        cin >> sx >> sy >> gx >> gy;
        sx--, sy--, gx--, gy--;

        vector<vector<char>> c(H, vector<char>(W));
        REP(i, H) REP(j, W) cin >> c[i][j];

        vector<vector<int>> dist(H, vector<int>(W, INT_MAX));
        dist[sx][sy] = 0;

        queue<tuple<int, int, int>> q;
        q.push({sx, sy, 0});
        while (!q.empty()) {
            int x, y, d;
            tie(x, y, d) = q.front();
            q.pop();
            if (dist[x][y] < d) continue;
            dist[x][y] = d;

            REP(k, 4) {
                int nx = x + dx[k];
                int ny = y + dy[k];
                while (0 <= nx && nx < H && 0 <= ny && ny < W) {
                    if (dist[nx][ny] <= d) break;
                    if (abs(nx - x) > K || abs(ny - y) > K) break;
                    if (c[nx][ny] == '@') break;
                    if (dist[nx][ny] == INT_MAX) {
                        q.push({nx, ny, d + 1});
                        dist[nx][ny] = d + 1;
                    }
                    nx += dx[k];
                    ny += dy[k];
                }
            }
        }
        if (dist[gx][gy] == INT_MAX) {
            cout << -1 << endl;
            return;
        }
        cout << dist[gx][gy] << endl;

    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    FPondSkater solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 11932
#include<stdio.h>

int nextInt();

int A, B;

int main(){
	A=nextInt();
	B=nextInt();
	printf("%d\n", A*B/2);
	return 0;
}

int nextInt(){
	int f=0; char c=getchar();
	while((c<'0')||('9'<c)){c=getchar();}
	while((c>='0')&&(c<='9')){f=f*10+(c-'0'); c=getchar();}
	return f;
}


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

int main(){

  string s;
  cin >> s;

  int a, b, n=s.size();
  for(int i=0; i<n; i++){
    if(s[i]=='A'){
      a = i;
      break;
    }
  }

  for(int i=n-1; 0<=i; i--){
    if(s[i]=='Z'){
      b = i;
      break;
    }
  }

  cout << b - a + 1 << endl;
  return 0;
}

Measured memory_bytes: 640
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n, m = na()
c = na()
dp = [[100000000] * (50001) for _ in range(20+1)]
for i in range(20+1):
    dp[i][0] = 0
for i in range(m):
    for j in range(n+1):
        if j >= c[i]:
            dp[i+1][j] = min(dp[i+1][j-c[i]] + 1, dp[i][j])
        else:
            dp[i+1][j] = dp[i][j]
print(dp[m][n])


Measured memory_bytes: 47140
#include <cstring>
#include <algorithm>
#include <map>
#include <stack>
#include <cassert>
#include <cmath>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <vector>
#include <iostream>
#include <set>
#define MP make_pair
#define F first
#define PB push_back
#define S second
using namespace std;
typedef long long ll;
const int maxn = 2e5 + 50;
const int mod = 1e9 + 7;
const int inf = (1 << 30);
ll Sum[maxn], Xor[maxn], a[maxn];

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++) {
        Xor[i] = (Xor[i - 1] ^ a[i]);
        Sum[i] = Sum[i - 1] + a[i];
    }
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        int l = i, r = n + 1;
        while (r - l > 1) {
            int mid = (l + r) / 2;
            if ((Xor[mid] ^ Xor[i - 1]) == Sum[mid] - Sum[i - 1])
                l = mid;
            else
                r = mid;
        }
        ans += l - i + 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PI 3.1415926535
#define MOD 1000000007

int main(){
  
  ll S,W;
  cin >> S >> W;
  
  if(S <= W)  cout << "unsafe" << endl;
  else  cout << "safe" << endl;
  
  return 0;
}

Measured memory_bytes: 3632
#include<iostream>
using namespace std;
int main()
{
	int x,y;
	cin >> x >> y;
	if(x==1)
	x=14;
	if(y==1)
	y=14;
	if(x==y)
	cout << "Draw" << endl;
	else if(x<y)
	cout << "Bob" << endl;
	else
	cout << "Alice" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<iomanip>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#include<stack>
#include<set>
#include<map>
#include<ctime>
#include<cstdlib>
#define INF long long (int)1e18+1
#define MAX 200001
#define rep(i,n,m) for(int i=n;i<m;i++)

using namespace std;
	
int main() {
	int n, k;
	cin >> n >> k;
	set<int>s;
	vector<pair<int, int>>d(k);
	vector<long long>bsum(k);
	rep(i, 0, k) {
		int x, y;
		cin >> x >> y;
		d[i].first = x;
		d[i].second = y;
		bsum[i] = 0;
		rep(i, x, y + 1)s.insert(i);
	}
	vector<long long>dp(n + 2, 0);
	for (auto a : s)dp[a + 1]++;
	rep(i, 1, n + 1) {
		rep(j, 0, k) {
			if (i - d[j].first >= 0)bsum[j] += dp[i - d[j].first];
			if (i - d[j].second > 0)bsum[j] -= dp[i - d[j].second - 1];
			dp[i] += bsum[j];
			dp[i] %= 998244353;
		}
	}
	cout << dp[n] << endl;
}


Measured memory_bytes: 14352
x=int(input())
def eratosthenes(n):
  l0=list(range(2,n+1))
  l1=[1]*(n+1)
  l1[0]=0
  l1[1]=0
  for li in l0:
    if li>int(n**0.5):
      break
    if l1[li]==1:
      k=2
      while k*li<=n:
        l1[k*li]=0
        k+=1
  ret=[i for i,li in enumerate(l1) if li==1]
  return ret
a=eratosthenes(x)
if x in a:
  print(x)
  exit()
while True:
  flg=True
  for ai in a:
    if x%ai==0:
      flg=False
      break
  if flg:
    print(x)
    exit()
  x+=1


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

int main() {
  int N, K, x, sum_dist;
  cin >> N >> K;
  sum_dist = 0;
  
  for (int i = 0; i < N; i++) {
    cin >> x;
    if (x - 0 <= K - x) {
      sum_dist += (x - 0) * 2;
    }
    else {
      sum_dist += (K - x) * 2;
    }
  }
  
  cout << sum_dist << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int k, n;
	cin >> k >> n;
	
	vector<int> a(n);
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	
	vector<int> dis;
	for(int i = 0; i < n - 1; ++i) {
		dis.push_back(a[i + 1] - a[i]);
	}
	
	dis.push_back(k - a[n - 1] + a[0]);
	
	int maxD = *max_element(dis.begin(), dis.end());
	
	int ans = 0;
	for(auto& x : dis) {
		ans += x;
	}
	
	ans -= maxD;
	cout << ans << endl;
	
	return 0;
}


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

	public static void main(String [] args) {
		
		Scanner in = new Scanner(System.in);
		int numSwaps = 0;
		
		int n = in.nextInt();
		int [] arr = new int [n];
		
		for(int i = 0; i < n; i++) {
			arr[i] = in.nextInt();
		}
		
		for(int j = 0; j < n - 1; j++) {
			
			
			for(int h = n - 1; h > j ; h--) {
				
				if(arr[h] < arr[h - 1]) {
					int temp = arr[h];
					arr[h] = arr[h - 1];
					arr[h - 1] = temp;
					numSwaps++;
				}
			}
		}
		
		for(int k = 0; k < n; k++) {
			System.out.print(arr[k]);
			
			if(k != n - 1) {
				System.out.print(" ");
			}
		}
		
		System.out.println("\n" + numSwaps);
	}
}



Measured memory_bytes: 26136
# coding: utf-8
from itertools import combinations


def eratosthenes(N):
    # 素数判定
    flag = True
    for i in range(2, int(N**0.5) + 1):
        if N % i == 0:
            flag = False
            break
    return flag

def make_prime_nums(N):
    # Nまでの素数のリストを作成
    prime_tf = [True for _ in range(N+1)]
    prime_tf[0] = False
    prime_tf[1] = False
    for i in range(N+1):
        if prime_tf[i]:
            if eratosthenes(i):
                for j in range(i*2, N+1, i):
                    prime_tf[j] = False
    primes = [i for i in range(N+1) if prime_tf[i] and i % 5 == 1]
    return primes
def divisor(N):
    # 約数列挙
    divs = []
    for i in range(2, int(N**0.5)+1):
        if N % i == 0:
            divs.append(i)
            divs.append(N//i)
    return divs

N = int(input())
primes = make_prime_nums(55555)
print(*primes[:N])
    

Measured memory_bytes: 3760
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque

def prime_factorization(x):
    """素因数分解"""
    import math
    re = []
    i = 2
    while x != 1:
        if x % i == 0:
            re.append(i)
            x //= i
        else:
            i += 1
            if i > math.sqrt(x):
                re.append(x)
                break
    return re


def cmb(n, r):
    """組み合わせ"""
    import math
    if n < r:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(N):
    pf = []
    for i in range(1, N + 1):
        pf += prime_factorization(i)
    pf_num = {}
    for p in pf:
        pf_num.setdefault(p, 0)
        pf_num[p] += 1
    over2 = 0
    over4 = 0
    over14 = 0
    over24 = 0
    over74 = 0
    for v in pf_num.values():
        if 74 <= v:
            over74 += 1
        if 24 <= v:
            over24 += 1
        if 14 <= v:
            over14 += 1
        if 4 <= v:
            over4 += 1
        if 2 <= v:
            over2 += 1
    ans = 0
    # 3-5-5
    ans += (over2 - over4) * cmb(over4, 2)
    ans += cmb(over4, 3) * 3

    # 5-15
    ans += (over4 - over14) * over14
    ans += cmb(over14, 2) * 2

    # 3-25
    ans += (over2 - over24) * over24
    ans += cmb(over24, 2) * 2

    # 75
    ans += over74

    print(ans)


if __name__ == '__main__':
    N = int(input())
    solve(N)

    # # test
    # from random import randint
    # from func import random_str
    # solve()


Measured memory_bytes: 9236
def operation_of_foa(input_seq, times)
	operated_seq = Array.new
	input_seq.each { |x| operated_seq << input_seq.count(x) }
	if operated_seq == input_seq
		return [operated_seq, times]
	else
		operation_of_foa(operated_seq, times+1)
	end
end

def print_seq(seq, times)
	puts times
	seq.each.with_index { |x,i| print (i.zero? ? x : " #{x}") }
	puts ""
end

while gets
	n = $_.to_i
	break if n == 0
	input_seq = gets.chomp.split.map(&:to_i)
	print_seq(*operation_of_foa(input_seq, 0))
end

Measured memory_bytes: 6124
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

std::pair<int, int> solve(
    const std::string& s,
    const std::string& t,
    int a,
    int b,
    const std::string& u)
{
  if (u == s) a -= 1;
  if (u == t) b -= 1;
  return {a, b};
}

int main()
{
  std::string s, t, u;
  int a, b;
  std::cin >> s >> t >> a >> b >> u;

  const auto p = solve(s, t, a, b, u);
  std::cout << p.first << " " << p.second << std::endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
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<bool> vb;
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 irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#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())
#define MATHPI acos(-1)
#define itn int;
#define endl '\n';
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;



int main() {
    
    int n;
    cin>>n;
    vi v(n);
    rep(i,n)cin>>v[i];
    Sort(v);
    map<int,int> m;
    rep(i,n)m[v[i]]++;
    vll w;
    irep(i,m){
        if(i->second>=2){
            w.pb(i->first);
        }
        if(i->second>=4){
            w.pb(i->first);
        }
    }
    Rort(w);
    if(w.size()<2)fin(0);
    else cout<<w[0]*w[1]<<endl;

}



Measured memory_bytes: 5376
def find(u,x):
    if u[x]<0:
        return x
    u[x] = find(u,u[x])
    return u[x]

def unite(u,a,b):
    a = find(u,a)
    b = find(u,b)
    if a == b:
        return False
    if u[b] < u[a]:
        a,b = b,a
    u[a] += u[b]
    u[b] = a
    return True

n,m = map(int, input().split())
l = [tuple(map(int, input().split())) for _ in range(m)]
uf = [-1]*(n+1)
cnt = n*(n-1)//2
tl = [cnt]
for _ in range(m-1):
    a,b = l.pop()
    a,b = find(uf,a),find(uf,b)
    if a != b:
        cnt -= uf[a]*uf[b]
        unite(uf,a,b)
    tl.append(cnt)
for _ in range(m):
    print(tl.pop())

Measured memory_bytes: 17932
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = s.nextInt();

		}
		Arrays.sort(arr);

		int count = 1;
		long curr = arr[0];
		
	
		for (int j = 1; j < n; j++) {
			if ( 2 * curr >=arr[j] ) {
				count++;

			} else {
				count = 1;
			}
			curr += arr[j];

		}
		System.out.println(count);

	}

}

Measured memory_bytes: 50592
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
using namespace std;
using boost::irange;

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> as(n);
    for (int i : irange(0, n)) {
        cin >> as[i];
    }

    sort(as.begin(), as.end());
    long result = accumulate(as.begin(), as.begin() + max(0, n - k), 0l);
    cout << result << endl;
}


Measured memory_bytes: 1024
N = int(input())
S = input()

ans = S
cnt = 0
now = ""
for s in S:
    now = s
    if s == "(":
        cnt += 1
    elif s == ")":
        cnt -= 1
    if cnt == -1:
        ans = "(" + ans
        cnt = 0
if cnt > 0:
    ans = ans + ")"*cnt

print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#include <stdio.h>
#include <iostream>
#include <vector>
#include <set>
#include <math.h>
using namespace std;
using ll = long long;

using Graph = vector<vector<int>>;

int main(){
    int k;
    cin >>k;
    string s;
    cin >> s;
    if(s.size()<=k){
        cout <<s<<endl;
    }
    else{
        s = s.substr(0,k);
        cout <<s<<"..."<<endl;
    }
    return 0;
}




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

using namespace std;

typedef long long ll;

const int INF = 1000000000;

int main()
{
  int N; scanf("%d", &N);
  vector<int> A(N), B(N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &A[i]);
  }
  for (int i = 0; i < N; ++i) {
    scanf("%d", &B[i]);
  }
  int ans = 0;
  for (int k = 0; k < 30; ++k) {
    int m = (1 << (k + 1));
    vector<int> BB(N);
    for (int i = 0; i < N; ++i) {
      BB[i] = B[i] % m;
    }
    sort(BB.begin(), BB.end());
    ll cnt = 0;
    ll c = (1LL << k);
    for (int i = 0; i < N; ++i) {
      int a = A[i] % m;
      cnt += distance(lower_bound(BB.begin(), BB.end(), c - a),
                      lower_bound(BB.begin(), BB.end(), 2 * c - a));
      cnt += distance(lower_bound(BB.begin(), BB.end(), 3 * c - a),
                      lower_bound(BB.begin(), BB.end(), 4 * c - a));
    }
    if (cnt % 2) { ans |= (1 << k); }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 2560
#include <stdio.h>
#include <stdlib.h>


int able(int p,int n, int k, int* w);
long long minimum(int n,int k,int* w);

int main(void){
    int n,k;
    scanf("%d %d",&n,&k);
    int* w = (int*)malloc(n*sizeof(int));
    for(int i=0;i<n;i++){
        scanf("%d",&(w[i]));
    }
    printf("%lld\n",minimum(n,k,w));
    return 0;
}

int able(int p,int n,int k,int* w){
    int truck=1;
    long weight=0;
    for(int i=0;i<n;i++){
        if(w[i]>p){
            return 0;
        }
        if(weight+w[i]>p){
            truck+=1;
            weight=0;
        }
        weight+=w[i];
    }
    if(truck>k){
        return 0;
    }
    else{
        return 1;
    }
}

long long minimum(int n,int k,int* w){
    long long min,max,mid;
    min=0;
    max=1000000010;
    while(min+1<max){
        mid=(min+max)/2;
        if(able(mid,n,k,w)){
            max=mid;
        }
        else{
            min=mid;
        }
    }
    for(long long i=min;i<=max;i++){
        if(able(i,n,k,w)){
            return i;
        }
    }
}



Measured memory_bytes: 2236
#include <cstdio>
#include <vector>
using namespace std;

int main()
{
  const int MAX = 200000;
  bool p[MAX];
  for (int i = 0; i < MAX; ++i)
    p[i] = true;
  p[0] = p[1] = false;

  for (int i = 2; i*i <= MAX; ++i) {
    if (p[i]) {
      for (int j = i+i; j < MAX; j += i)
	p[j] = false;
    }
  }

  vector<int> prime;
  for (int i = 0; i < MAX; ++i) {
    if (p[i])
      prime.push_back(i);
  }

  for (unsigned int i = 1; i < prime.size(); ++i)
    prime[i] += prime[i-1];

  int n;
  while (~scanf("%d", &n)) {
    if (n == 0)
      break;
    printf("%d\n", prime[n-1]);
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    sort(all(a));
    vector<ll> dp(n);
    int ans = 0;
    
    rep(i, n) {
        if (i == 0) {
            dp[i] = a[i];
        }
        else {
            dp[i] = dp[i - 1] + a[i];
        }
    }
    
    rreps(i, 1, n) {
        if (a[i] > (dp[i - 1] * 2)) {
            ans = i;
            break;
        }
    }
    
    ans = n - ans;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1536
using System;
using System.IO;
using System.Text;
using static Scanner;

class Program
{
    static void Main(string[] args) {
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Solve();
        Console.Out.Flush();
    }
    static void Solve() {
        int N = ScanInt(), M = ScanInt(), X = ScanInt();
        var texts = new (int C, int[] A)[N];
        for (int i = 0; i < N; i++) {
            texts[i].C = ScanInt();
            texts[i].A = ScanIntArray(M);
        }
        var answer = int.MaxValue;
        for (int bit = 0; bit < 1 << N; bit++) {
            var levels = new int[M];
            var cost = 0;
            for (int i = 0; i < N; i++) {
                if (((bit >> i) & 1) == 0) continue;
                cost += texts[i].C;
                if (cost > answer) break;
                for (int j = 0; j < M; j++) levels[j] += texts[i].A[j];
            }
            if (cost > answer) continue; 
            var isAchieved = true;
            for (int j = 0; j < M; j++) {
                if (levels[j] >= X) continue;
                isAchieved = false;
                break;
            }
            if (isAchieved) answer = cost;
        }
        Console.WriteLine(answer == int.MaxValue ? -1 : answer);
    }
}

public static class Scanner
{
    static readonly Stream stdin = Console.OpenStandardInput();
    static readonly byte[] buffer = new byte[1024];
    static int length, p;
    static bool isEof;
    private static byte StdIn() {
        if (isEof) return 0;
        if (p < length) return buffer[p++];
        p = 0;
        if ((length = stdin.Read(buffer, 0, 1024)) > 0) return buffer[p++];
        isEof = true;
        return 0;
    }
    public static char GetChar() {
        var by = StdIn();
        while ((by < '!' || '~' < by) && !isEof) by = StdIn();
        return (char) by;
    }
    public static int ScanInt() {
        var temp = 0;
        for (var ch = GetChar(); '0' <= ch && ch <= '9'; ch = (char) StdIn()) {
            temp = temp * 10 + ch - '0';
        }
        return temp;
    }
    public static int[] ScanIntArray(int len, int add = 0) {
        var array = new int[len];
        for (int i = 0; i < len; i++) array[i] = ScanInt() + add;
        return array;
    }
}

Measured memory_bytes: 25856
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <complex>
#include <cstdio>
#include <string>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>

#define isNum(a) (a >= '0' && a <= '9')
#define SP putchar(' ')
#define EL putchar('\n')
#define File(a) freopen(a ".in", "r", stdin), freopen(a ".out", "w", stdout)

template<class T>
void read(T&);
template<class T>
void write(const T&);

typedef long long ll;
typedef unsigned long long ull;
typedef const long long & cll;
typedef const int & ci;
typedef std::pair<int, int> pii;
const int iinf = 2147483647;
const ll llinf = 9223372036854775807ll;
using std::min;
using std::max;
using std::abs;
using std::sort;

int main () {
  int a, b;
  read(a), read(b);
  if (a > b) {
    a ^= b ^= a ^= b;
  }
  for (int i = 1; i <= b; ++i) {
    write(a);
  }
  EL;
  return 0;
}

template<class T>
inline void read(T &Re) {
  T k = 0;
  char ch = getchar();
  int flag = 1;
  while (!isNum(ch)) {
    if (ch == '-') {
      flag = -1;
    }
    ch = getchar();
  }
  while (isNum(ch)) {
    k = (k << 1) + (k << 3) + ch - '0';
    ch = getchar();
  }
  Re = flag * k;
}
template<class T>
inline void write(const T &Wr) {
  if (Wr < 0) {
    putchar('-');
    write(-Wr);
  } else {
    if (Wr < 10) {
      putchar(Wr + '0');
    } else {
      write(Wr / 10);
      putchar((Wr % 10) + '0');
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template<class T> using VE = vector<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// const ll MOD = 1e9 + 7;
const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
int f(int x) { int res = 0; while (x) { res += x % 10; x /= 10; } return res; }
int main() {
	int n;
	cin >> n;
	puts(n % f(n) ? "No" : "Yes");
	return 0;
}

Measured memory_bytes: 3532
#include <stdio.h>
#include <stddef.h>

int max(int x, int y) { return x > y ? x : y; }

typedef struct Node
{
	int v;
	struct Node *p;
	struct Node *l;
	struct Node *r;
} Node;

Node* root(Node *node)
{
	return node->p ? root(node->p) : node;
}

void x_order(Node *node, int x)
{
	if(!node){ return; }

	if(x == 1) { printf(" %d", node->v); }
	x_order(node->l, x);
	if(x == 2) { printf(" %d", node->v); }
	x_order(node->r, x);
	if(x == 3) { printf(" %d", node->v); }
}


int main()
{
	int n, x, l, r;
	Node *p, nodes[25];
	
	scanf("%d", &n);
	for(int i = 0; i < n; ++i)
	{
		nodes[i].v = i;
		nodes[i].p = nodes[i].l = nodes[i].r = NULL;
	}

	for(int i = 0; i < n; ++i)
	{
		scanf("%d %d %d", &x, &l, &r);
		if(l != -1)
		{
			nodes[x].l = &nodes[l];
			nodes[l].p = &nodes[x];
		}
		if(r != -1)
		{
			nodes[x].r = &nodes[r];
			nodes[r].p = &nodes[x];
		}
	}

	p = root(&nodes[0]);
	printf("Preorder\n");  x_order(p, 1); printf("\n");
	printf("Inorder\n");   x_order(p, 2); printf("\n");
	printf("Postorder\n"); x_order(p, 3); printf("\n");
}




Measured memory_bytes: 2120
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll INF = 1e9+7;
ll MOD = 998244353;
typedef pair<long long,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define rf(i,a,b) for(long long i=a;i>=b;i--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define w(t) while(t--)
#define c(n); cin>>n;
#define p(n) cout<<n;
#define pl(n) cout<<n<<"\n";
#define ps(n); cout<<n<<" ";
#define F first
#define S second
#define pb(a) push_back(a)
#define all(x) (x).begin(), (x).end()
#define ull unsigned long long
#define vll vector<ll>
#define vii vector<ii>
#define mkp make_pair
#define ld long double
#define arrin(a,n) f(i,0,n){cin>>a[i];}
#define arrout(a,n) f(i,0,n){cout<<a[i]<<" ";}
#define printclock cerr<<"Time : "<<*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define PI (2*acos(0))
#define EPS 1e-18
vector<vll>adj;
vll vis;
void dfs(ll s){
    vis[s] = 1;
    for(auto x:adj[s]){
        if(!vis[x]){
            dfs(x);
        }
    }
}
int main(void){
    fastio;
    ll n,m;
    cin>>n>>m;
    adj.assign(n+5,vll());
    vis.assign(n+5,0);
    f(i,0,m){
        ll a,b;
        cin>>a>>b;
        adj[a].pb(b);
        adj[b].pb(a);
    }
    ll ans = 0;
    f(i,1,n+1){
        if(!vis[i]){
            dfs(i);
            ans++;
        }
    }
    pl(ans-1);
}




Measured memory_bytes: 10592