akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;

public class Main
{

  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);

    HashMap<String, Integer> h = new HashMap<>();

    int n = Integer.parseInt(r.readLine());
    for(int i = 0; i < n; i++)
    {
      String s = r.readLine();
      if(!h.containsKey(s))
      {
        h.put(s, 1);
      }
      else
      {
        h.put(s, 1 + h.get(s));
      }
    }

    n = Integer.parseInt(r.readLine());
    for(int i = 0; i < n; i++)
    {
      String s = r.readLine();
      if(!h.containsKey(s))
      {
        h.put(s, - 1);
      }
      else
      {
        h.put(s, - 1 + h.get(s));
      }
    }

    ArrayList<Integer> v = new ArrayList<>(h.values());

    int z = 0;
    for(int i = 0; i < v.size(); i++)
    {
      if(z < v.get(i))
      {
        z = v.get(i);
      }
    }

    System.out.println(z);

  }

}


Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;i<(n);i++)
#define REP(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
#define int long long
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)?"YES":"NO")
#define sec second
#define fir first
typedef long long ll;
typedef pair<int, int> P;
typedef priority_queue<int> pque;
typedef vector<int> Vec;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a/gcd(a,b)*b;};
int mod(int a,int b){return (a+b-1)/b;};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N],const T &val){std::fill((T*)array,(T*)(array+N),val);}
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;};



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

	int a, b;
	cin >> a >> b;
	cout << (a * (a-1)) / 2 + (b * (b-1)) / 2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  	int f = 0;
  	int s= 0;
  	for(int i=0;i<3;i++){
      	int x;
      	cin>>x;
      	if(x==5) f++;
      	if(x==7) s++;
    }
  if(s==1 && f==2) cout<<"YES";
  else cout<<"NO";
  return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def dfs(x:int, y:int):
    
    if(y == 1 and x == (N-1)):
        return A[y][x]

    elif(y > 1 or x > N-1):
        return 0
    else:
        return max(dfs(x+1, y), dfs(x, y+1)) + A[y][x]
    
    
def solve(N: int, A: "List[List[int]]"):
    print(dfs(0,0))
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    global N, A
    N = int(next(tokens))  # type: int
    A = [[int(next(tokens)) for _ in range(N)] for _ in range(2)]  # type: "List[List[int]]"
    solve(N, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P>IP;
typedef vector<ll> V;
typedef vector<V> V2;
typedef vector<vector<P> > G;
void g_dir(G &graph, ll a, ll b, ll w = 1){graph[a].push_back(P(b, w));}
void g_undir(G &graph, ll a, ll b, ll w = 1){g_dir(graph, a, b, w);g_dir(graph, b, a, w);}
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}
const ll INF = 1145141919810893;
const ll MOD = 1000000007;
const ll NUM = 101010;

int main(){

    ll H, W, N;
    cin >> H >> W >> N;
    ll ans = 0;
    while(ans * max(H, W) < N)ans++;
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
#define BUFSIZE 1000000

int n;
int p[BUFSIZE]={0};



int compare(int start_p){
  if(p[start_p] < p[start_p + 1] && p[start_p + 1] < p[start_p + 2]
    || p[start_p + 2] < p[start_p + 1] && p[start_p + 1] < p[start_p]){
      return 0;
    }
return 1;
}





int main(void){
  scanf("%d",&n);
  for(int i = 0;i < n;i++){
    scanf("%d",&p[i]);
  }
  int cnt = 0;
  for(int i = 0;i < n - 2;i++){
  if( compare(i) == 0) cnt++;

  }
  printf("%d",cnt);



return 0;



}


Measured memory_bytes: 1712
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int D = sc.nextInt();
		int X = sc.nextInt();
		int[]A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		sc.close();
		int sum = 0;
		for(int i = 0; i < N; i++) {
			int t = (D - 1) / A[i];
			sum += 1 + t;
		}
		System.out.println(sum + X);
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> data(N);
  
  for(int i=0; i<N; i++) cin >> data.at(i);
  
  int A=0,B=0, max, count=0;
  
  while(count<N){
    max=0;
    int temp=0;
    for(int i=0;i<N;i++){
      if(max<data.at(i)){
        max=data.at(i);
        temp = i;
      }
    }
    if(count%2==0) A += max;
    else B += max;
    data.at(temp)=0;
    count++;
  }
  
  cout << A-B << endl;
}


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

namespace ConsoleApp1 {
    public class Class {
        static void Main(string[] args) {
            var D = int.Parse(Console.ReadLine());
            var C = RL<long>();
            var Co = Enumerable.Repeat(0, 26).ToArray();
            var S = new List<long>[D];
            for (var i = 0; i < D; i++) S[i] = RL<long>().ToList();
            long ans = 0;
            for (var i = 0; i < D; i++) {
                var t = int.Parse(Console.ReadLine());
                long m = 0;
                for (var a = 0; a < 26; a++) {
                    if (t - 1 == a) {
                        Co[a] = 0;
                        continue;
                    }
                    Co[a]++;
                }
                for(var a = 0; a < 26; a++) {
                    m += Co[a] * C[a];
                }
                ans += S[i][t - 1] - m;
                Console.WriteLine(ans);
            }
        }

        static T[] RL<T>() where T : IComparable {
            if (typeof(T) == typeof(int)) {
                return (T[])(object)Console.ReadLine().Trim().Split().Select(int.Parse).ToArray();
            }
            if (typeof(T) == typeof(long)) {
                return (T[])(object)Console.ReadLine().Trim().Split().Select(long.Parse).ToArray();
            }
            if (typeof(T) == typeof(double)) {
                return (T[])(object)Console.ReadLine().Trim().Split().Select(double.Parse).ToArray();
            }
            if (typeof(T) == typeof(decimal)) {
                return (T[])(object)Console.ReadLine().Trim().Split().Select(decimal.Parse).ToArray();
            }
            return (T[])(object)Console.ReadLine().Trim().Split().ToArray();
        }
    }
}


Measured memory_bytes: 28760
import math
from itertools import accumulate

N, K = map(int, input().split())
al = list(map(int, input().split()))
syusoku = [N] * N

for _ in range(K):
    s = [0] * N
    for i in range(N):
        left = i - al[i]
        right = i + al[i]
        if left < 0:
            left = 0
        s[left] += 1
        if right + 1 <= N - 1:
            s[right + 1] -= 1
        # print(left,right)
    al = list(accumulate(s))
    # print(al)
    if al == syusoku:
        print(*al)
        #print('end')
        exit()

print(*al)


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

int n;
vector<int> p(0), q(0);
int main() {
  cin >> n;
  rep(i, n){
    int tmp; cin >> tmp;
    p.push_back(tmp);
  }
  rep(i, n){
    int tmp; cin >> tmp;
    q.push_back(tmp);
  }
  vector<int> seq(n);
  rep(i, n) seq.at(i) = i + 1;
  int a = 0, b = 0;
  int cnt = 0;
  //for(int x : p) cerr << x; cerr << " "; for(int x : q) cerr << x; cerr << endl;
  do{
    //for(int x : seq) cerr << x; cerr << endl;
    if(seq == p){
      a = cnt;
    }
    if(seq == q){
      b = cnt;
    }
    cnt++;
  }while(next_permutation(seq.begin(), seq.end()));
  cout << abs(a - b) << endl;
  
  return 0;
}


Measured memory_bytes: 256
S = input()
max_ctr = 0
ctr = 0

for i in range(len(S)):
    if (S[i] == 'A' or S[i] == 'T' or S[i] == 'C' or S[i] == 'G'):
        ctr += 1
        max_ctr = max(ctr, max_ctr)
    else:
        ctr = 0

print(max_ctr)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef vector<int> intvec;
typedef queue<int> intqueue;


void quicksort(int v_id, int v_l, intvec &vec) {
  intqueue small, big;
  int N = v_l - v_id;
  int N_big = 0;
  int pivot = vec[v_id];
  for(int i = v_id + 1; i < v_l; i++){
    if(pivot <= vec[i]){
      big.push(vec[i]);
      N_big++;
    }
    else small.push(vec[i]);
  }

  for (int i = v_id; i < v_id + N_big; i++){
    vec[i] = big.front();
    big.pop();

  }
  vec[v_id+N_big] = pivot;
  for (int i = v_id + 1 + N_big; i < v_l; i++){
    vec[i] = small.front();
    small.pop();

  }


  if( N_big > 1){
    quicksort(v_id, v_id + N_big, vec);
  }
  if (N_big < N-1){
    quicksort(v_id + N_big + 1, v_l, vec);
  }
}

int main(){
int N,M;

while(1){
  int value = 0, buf;
  cin >> N >> M;
  intvec vec(N);
  if(N==0&&M==0) break;
  for(int i = 0; i < N; i++){
    cin >> vec[i];
  }
  quicksort(0,N,vec);
  for (int i=0; i<N; i++){
    for (int j = i+1; j<N; j++){
      buf = vec[i] + vec[j];
      if(buf == M){
        value = buf;
        i=N-1;
        j=N-1;
      }

      else if(buf < M){
        if(value < buf) value = buf;
        break;
      }
    }
  }
  if(value == 0) cout << "NONE" << endl;
  else cout << value << endl;
}
}



Measured memory_bytes: 4464
#include <bits/stdc++.h>
//#include "bits/stdc++.h"
#include <atcoder/all>

using namespace std;
using namespace atcoder;
typedef long long ll;

/*
#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
*/
 
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-12;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
//#define endl "\n"  //インタラクティブで消す！！！！！！！！！！！！！！！！！！！！！
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=50000;
    rep(y,1,P){
        ll x=mod(y*k);
        
        if(abs(x)<=P||x+P>=i_7){
            if(x+P>=i_7){
                x-=i_7;
            }
            cout<<x<<"/"<<y<<endl;
            //cout<<setprecision(5)<<(dd)x/(dd)y;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
typedef vector<ll> vl;
//////////////////////////

int main(){fastio
    ll n,q;cin>>n>>q;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    fenwick_tree<ll>fw(n);
    rep(i,0,n-1)fw.add(i,a[i]);
    while(q--){
        ll p,l,r;cin>>p>>l>>r;
        if(p==0){
            fw.add(l,r);
        }else{
            cout<<fw.sum(l,r)<<endl;
        }
    }
    
    return 0;
}


Measured memory_bytes: 12156
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();

        long[] a = sc.LongArray();

        if (a.Contains(0))
        {
            Console.WriteLine(0);
            return;
        }

        long answer = 1;
        for (int i = 0; i < n; i++)
        {
            try
            {
                checked
                {
                    answer *= a[i];
                    if (answer > (long)1e18)
                    {
                        Console.Write(-1);
                        return;
                    }
                }
            }
            catch (OverflowException)
            {
                Console.Write(-1);
                return;
            }
        }

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 42896
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600

int dp[1010][1010][1<<4];

int main(){
  int h,w;
  cin>>h>>w;
  vector<string> str(h);
  rep(i,h) cin>>str[i];
  vector<vector<int>> vec(h+2,vector<int>(w+2,0));
  rep(i,h) rep(j,w) vec[i+1][j+1] = ((str[i][j]=='.')?(0):(str[i][j]-'0'));

  fill(dp[0][0], dp[1010][0], INF);

  dp[1][1][0] = 0;
  rep(i,h+1) rep(j,w+1) rep(mask, 1<<4) if(dp[i][j][mask]<INF){//dbg(mp(i,j));
    bool isu = mask%2;
    bool isl = (mask>>1)%2;
    bool isur = (mask>>2)%2;
    bool isld = (mask>>3)%2;
    int vu = (isu?0:vec[i-1][j]);
    int vl = (isl?0:vec[i][j-1]);
    int vr = vec[i][j+1];
    int vd = vec[i+1][j];

    if(i<h){ // down
      // ????????¨?????????
      int ncost = vr+vl+vd;
      int nmask = 1 + (isld<<1) + (1<<2);
      dp[i+1][j][nmask] = min(dp[i+1][j][nmask], dp[i][j][mask] + ncost);
      // ????????¨?????????
      ncost = vu+vl+vd;
      nmask = 1 + (isld<<1);
      dp[i+1][j][nmask] = min(dp[i+1][j][nmask], dp[i][j][mask] + ncost);
      // ?????????
      ncost = vu+vr+vd;
      nmask = 1 + (isld<<1) + (1<<2);
      dp[i+1][j][nmask] = min(dp[i+1][j][nmask], dp[i][j][mask] + ncost);
    }
    if(j<w){ // right
      // ??????
      int ncost = vr+vl+vd;
      int nmask = (isur) + (1<<1) +(1<<3);
      dp[i][j+1][nmask] = min(dp[i][j+1][nmask], dp[i][j][mask] + ncost);
      // ??????
      ncost = vr+vl+vu;
      nmask = (isur) + (1<<1);
      dp[i][j+1][nmask] = min(dp[i][j+1][nmask], dp[i][j][mask] + ncost);
      // ?????????
      ncost = vu+vr+vd;
      nmask = (isur) + (1<<1) +(1<<3);
      dp[i][j+1][nmask] = min(dp[i][j+1][nmask], dp[i][j][mask] + ncost);
    }
  }

  int ans = INF;
  rep(m,1<<4) ans = min(ans, dp[h][w][m]);
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 71792
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
using namespace std;

long long int gcd(long long int m, long long int n)
{
    return n ? gcd(n, m % n) : m;
}

int main()
{
    long long int N, X;
    if (scanf("%lld%lld", &N, &X) < 2) return 0;

    printf("%lld\n", 3 * (N - gcd(N, X)));
    return 0;
}


Measured memory_bytes: 128
#include <stdio.h>

int main(){
    int a, b, c, d;
    
    scanf("%d %d %d %d", &a, &b, &c, &d);

    if(b <= c || d <= a){
        printf("0\n");
        return 0;
    }

    if(a <= c){
        if(b <= d){
            printf("%d\n", b-c);
            return 0;
        }else{
            printf("%d\n", d-c);
            return 0;
        }
    }else{
        if(b <= d){
            printf("%d\n", b-a);
            return 0;
        }else{
            printf("%d\n", d-a);
            return 0;
        }
    }
}

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

int main() {
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(a*b>=c*d)cout<<a*b<<endl;
  else cout<<c*d<<endl;
  return 0;
}

Measured memory_bytes: 256
extern crate core;

use std::io::{self, Read};

#[macro_export]
macro_rules! input {
  ($s:expr=>$($t:tt)*) => {
    let mut lines=$s.split("\n");
    $(
        line_parse!(lines,$t);
    )*
  };
}

macro_rules! line_parse {
  ($lines:expr,($($name:ident:$t:tt)*)) => {
    let mut line=$lines.next().unwrap().split_whitespace();
    $(value_def!(line,$name,$t);)*
  };

  //複数行
  ($lines:expr,{$n:expr;$name:ident:$t:tt}) => {
    values_def!($lines,$n,$name,$t);
  };
}

macro_rules! value_def {
    ($line:expr, $name:ident, $t:tt) => {
        let $name = value!($line, $t);
    };
}

macro_rules! values_def {
    ($lines:expr, $n:expr, $name:ident, $t:tt) => {
        let $name = {
            let mut vec = Vec::new();
            for i in 0..$n {
                let mut next = $lines.next().unwrap().split_whitespace();
                vec.push(value!(next, $t));
            }
            vec
        };
    };
}

macro_rules! value {
  //配列
  ($line:expr,[$t:tt]) => {
    $line.map(|x|{
      let mut iter=::std::iter::once(x);
      value!(iter,$t)
    }).collect::<Vec<_>>()
  };
  //タプル
  ($line:expr,($($t:tt),*)) => {
    ($(value!($line,$t),)*)
  };
  //文字列
  ($line:expr,#) => {
    $line.next().unwrap()
  };
  //インデックス(-1)
  ($line:expr,@) => {
    $line.next().unwrap().parse::<usize>().unwrap()-1
  };
  //単一値
  ($line:expr,$t:ty) => {
    $line.next().unwrap().parse::<$t>().unwrap()
  };
}

fn main() {
    let mut input = String::new();
    io::stdin().read_to_string(&mut input).unwrap();
    let output = solve(input.trim().to_string());
    println!("{}", output);
}

fn solve(input: String) -> String {
    input!(input=>(n:String));
    n.chars()
        .map(|x| match x {
            '1' => '9',
            _ => '1',
        })
        .collect::<String>()
}

macro_rules! tests {
    ($($name:ident: $input:expr=>$output:expr,)*) => {
        mod tests {
            $(
                #[test]
                fn $name() {
                    assert_eq!($output.trim().to_string(),super::solve($input.trim().to_string()));
                }
            )*
        }
    }
}

tests! {
    test1: "119" => "991",
    test2: "999" => "111",
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

int main(){
	int a, b; scanf("%d%d", &a, &b);
	if(a > b) swap(a, b);
	REP(i, b) printf("%d", a);
}


Measured memory_bytes: 256
# coding: utf-8

import sys


def Round(ip, dg):  # ip????°???°?????\???dg?????§?????¨?????\????????¢??°
    ip = ip * 10**dg
    if(ip-int(ip) >= 0.5):
        return (int(ip) + 1)/10**dg
    else:
        return int(ip)/10**dg


for i in sys.stdin:
    try:
        line = [int(k) for k in i.split(" ")]
        a = line[0]
        b = line[1]
        c = line[2]
        d = line[3]
        e = line[4]
        f = line[5]
        print("{0:.03f}".format(Round((c*e-f*b)/(a*e-d*b), 3)) + " " + "{0:.03f}".format(Round((a*f-d*c)/(a*e-d*b), 3)))
    except:
        exit()

Measured memory_bytes: 7676
#---------------------------------------------------------------------#
#Initialize

num = gets.to_i
ary_original = gets.split

#aryB: array for Bubble Sort
aryB = Marshal.load(Marshal.dump(ary_original))

#aryS: array for Selection Sort
aryS = Marshal.load(Marshal.dump(ary_original))

def stable? (ary, org)

  (ary.size - 1).times do |i|

    if ary[i][1] == ary[i+1][1]
      if org.index(ary[i]) > org.index(ary[i+1])
        return "Not stable"
      end
    end
  end

  return "Stable"
end

#---------------------------------------------------------------------#
#Bubble Sort

index_last = num - 2

while index_last >= 0

  for i in 0 .. index_last

    if aryB[i][1] > aryB[i + 1][1]
      aryB[i], aryB[i + 1] = aryB[i + 1], aryB[i]
    end
  end

  index_last -= 1
end

#---------------------------------------------------------------------#
#Selection Sort

for i in 0 .. num-2

  min = aryS[i][1]
  min_index = i

  for j in i .. num-1

    if min > aryS[j][1]
      min = aryS[j][1]
      min_index = j
    end
  end

  if aryS[i][1] != aryS[min_index][1]
    aryS[i], aryS[min_index] = aryS[min_index], aryS[i]
  end
end

#---------------------------------------------------------------------#
#Output

#Bubble Sort
puts aryB.join(" ")
puts stable?(aryB, ary_original)

#Bubble Sort
puts aryS.join(" ")
puts stable?(aryS, ary_original)



Measured memory_bytes: 6916
/*
                IftekharMd.Shishir
                Dept. of Information and Communication Engineering
                University of Rajshahi
*/

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>

#define ll  long long
#define ull  unsigned long long
#define ld  long double
#define f(i,n)  for(i=0;i<n;i++)
#define F(i,n)  for(i=n-1;i>=0;i--)
#define fa(i,a,b)  for(i=a;i<=b;i++)
#define Fa(i,a,b)  for(i=a;i>=b;i--)
#define printArray(i,a,n)  f(i,n)cout<<a[i]<<" "; cout<<endl;
#define printSet(a)  for(auto setData:a) cout<<setData<<" ";cout<<endl;
#define printMap(a)  for(auto mapData:a) cout<<mapData.first<<" "<<mapData.second<<endl;
#define printVector(a)  for(auto vectorData:a)cout<<vectorData<<" ";cout<<endl;
#define printLinkedList()  temp=head;while(temp){cout<<temp->data<<" ";temp=temp->post;} cout<<endl;

#define pb(x)  push_back(x)
#define all(a)  a.begin(),a.end()
#define rall(a)  a.rbegin(),a.rend()

#define bs  binary_search
#define lb  lower_bound
#define ub  upper_bound
#define mp  make_pair
#define TxtIO  freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define TxtTest freopen("C:/Users/Iftekhar/Documents/what/input.txt", "r", stdin);
#define FastIO  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
#define TestCase  ll t;cin>>t;while(t--)
#define points(x)  fixed<<setprecision(x)
#define scd(a,x,y)  a/__gcd(x,y);
#define nl  cout<<endl;
#define done  return 0

const ld PI= 3.14159265358979323846264338327950288;  //2*acos(0.0);
const long long MOD= 1000000007;
const long long MAX = 32000;

// stringstream demo(str);  demo >> x;
// stringstream demo;  demo << x;  name=demo.str();

using namespace __gnu_pbds;
using namespace std;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int main()
{
        FastIO;
        //TxtTest;
        string a,b;
        ll i;
        cin>>a>>b;
                f(i,a.size()){
                        cout<<a[i];
                  		if(i<b.size())cout<<b[i];
                }
                nl;
                done;
}


Measured memory_bytes: 3640
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto n = readln.chomp.to!int;
  auto k = readln.chomp.to!int;
  auto x = 1;

  foreach (i; 0..n) {
    if (x < k) {
      x *= 2;
    } else {
      x += k;
    }
  }
  x.writeln;
}


Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next()

  println(abc122b(s))
}

private fun abc122b(s: String): Int {
  var max = 0
  var tmp = 0
  for (c in s) {
    if (isACGT(c)) {
      tmp++
      max = Math.max(max, tmp)
    } else {
      tmp = 0
    }
  }

  return max
}

private fun isACGT(c: Char): Boolean {
  if (c != 'A' && c != 'C' && c != 'G' && c != 'T') {
    return false
  }
  return true
}


Measured memory_bytes: 31260
import std.algorithm, std.conv, std.range, std.stdio, std.string;

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}
void readA(T)(size_t n,ref T t){t=new T(n);auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(ElementType!T);r.popFront;}}
void readM(T...)(size_t n,ref T t){foreach(ref v;t)v=new typeof(v)(n);foreach(i;0..n){auto r=readln.splitter;foreach(ref v;t){v[i]=r.front.to!(ElementType!(typeof(v)));r.popFront;}}}
void readS(T)(size_t n,ref T t){t=new T(n);foreach(ref v;t){auto r=readln.splitter;foreach(ref j;v.tupleof){j=r.front.to!(typeof(j));r.popFront;}}}

void main()
{
  int h, w; readV(h, w);
  string[] s; readM(h, s);

  auto g = GraphW!()(h*w);
  foreach (i; 0..h)
    foreach (j; 0..w)
      if (s[i][j] == '.') {
        if (i > 0   && s[i-1][j] == '.') g.addEdge(i*w+j, (i-1)*w+j, 1);
        if (i < h-1 && s[i+1][j] == '.') g.addEdge(i*w+j, (i+1)*w+j, 1);
        if (j > 0   && s[i][j-1] == '.') g.addEdge(i*w+j, i*w+(j-1), 1);
        if (j < w-1 && s[i][j+1] == '.') g.addEdge(i*w+j, i*w+(j+1), 1);
      }

  auto d = Dijkstra!(typeof(g)).dijkstra(g, 0);
  if (d[h*w-1] == g.inf) {
    writeln(-1);
  } else {
    auto r = s.map!(si => si.count('#')).sum;
    writeln(h*w-(d[h*w-1]+1)-r);
  }
}

struct GraphW(N = int, W = int, W i = 10^^9)
{
  alias Node = N, Wt = W, inf = i;
  struct Edge { Node src, dst; Wt wt; alias cap = wt; }
  Node n;
  Edge[][] g;
  alias g this;
  this(Node n) { this.n = n; g = new Edge[][](n); }
  void addEdge(Node u, Node v, Wt w) { g[u] ~= Edge(u, v, w); }
  void addEdgeB(Node u, Node v, Wt w) { g[u] ~= Edge(u, v, w); g[v] ~= Edge(v, u, w); }
}

template Dijkstra(Graph)
{
  import std.array, std.container, std.traits;
  alias Node = TemplateArgsOf!Graph[0], Wt = TemplateArgsOf!Graph[1];
  alias Edge = Graph.Edge;

  void dijkstra(ref Graph g, Node s, out Wt[] dist, out Node[] prev)
  {
    auto n = g.n, sent = n;

    dist = new Wt[](n);
    dist[] = g.inf;
    dist[s] = 0;

    prev = new Node[](n);
    prev[] = sent;

    auto q = heapify!("a.wt > b.wt")(Array!Edge(Edge(sent, s, 0)));
    while (!q.empty) {
      auto e = q.front; q.removeFront();
      if (prev[e.dst] != sent) continue;
      prev[e.dst] = e.src;
      foreach (f; g[e.dst]) {
        auto w = e.wt + f.wt;
        if (dist[f.dst] > w) {
          dist[f.dst] = w;
          q.insert(Edge(f.src, f.dst, w));
        }
      }
    }
  }

  auto dijkstra(ref Graph g, Node s)
  {
    Wt[] dist;
    Node[] prev;
    dijkstra(g, s, dist, prev);
    return dist;
  }
}


Measured memory_bytes: 2556
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e10;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 




////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////

int n,m;vector<int> g[210000];
int visited[210000];

void dfs(int node){
  rep(i,g[node].size()){
    if(visited[g[node][i]])continue;
    visited[g[node][i]] = true;
    dfs(g[node][i]);
  }
}

signed main(){
  cin>>n>>m;
  rep(i,n){
    int k;cin>>k;
    rep(j,k){
      int l;cin>>l;l--;
      g[i].push_back(n+l);
      g[n+l].push_back(i);
    }
  }
  dfs(0);
  rep(i,n){
    if(!visited[i]){
      cout << "NO" << endl;return 0;
    }
  }
  cout << "YES" << endl;
}


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

int main() {
    vector<int> s;
    int n;
    for (int i = 0; i < 4; i++) {
        cin >> n;
        s.push_back(n);
    }
    sort(s.begin(), s.end());
    if (s[0] == 1 && s[1] == 4 && s[2] == 7 && s[3] == 9) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws java.io.IOException {
		Scanner scan = new Scanner(System.in);
		int x[] = new int[100];
		while(scan.hasNext()){
			int a = scan.nextInt();
			x[a-1]++;
		}
		int mux = x[0];
		for(int i = 1 ; i < x.length ; i++){
			if(mux < x[i]){
				mux = x[i];
			}
		}
		for(int i = 0 ; i < x.length ; i++){
			if(mux == x[i]){
				System.out.println(i+1);
			}
		}
	}
}

Measured memory_bytes: 18120
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
using namespace std;

ll n,d,ans,pos=1;

int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> d;
    while(pos<=n) ans++,pos+=d+d+1;
    cout << ans;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << #x << ": " << x << endl;
#else
    #define debug(x)
#endif

int main() {
    cin.tie(0);ios::sync_with_stdio(false);cout << fixed << setprecision(20);

    ll N;
    cin >> N;
    vll a(N);
    rep(i,N) cin >> a[i];
    vll cnt(1100000, 0);
    rep(i,N) cnt[a[i]]++;

    if(N==1) {
        cout << 1 << endl;
        return 0;
    }

    if(cnt[1]==1) {
        cout << 1 << endl;
        return 0;
    }
    else if(cnt[1] >= 2) {
        cout << 0 << endl;
        return 0;
    }

    ll ans = 0;
    rep(i, N) {
        bool ok = true;
        for(ll n = 2; n*n <= a[i]; n++) {
            if(a[i] % n == 0) {
                ll m = a[i]/n;
                if(cnt[n]) ok = false;
                if(cnt[m]) ok = false;
            }
        }
        if(cnt[a[i]] >= 2) ok = false;
        if(ok) ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 13476
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <limits>
#include <numeric>

using namespace std;
typedef long long int ll;
typedef long double ld;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }                   // 最大公約数
ll lcm(ll a, ll b) { return a * b / gcd(a, b); };                      // 最小公倍数
ll getDigit(ll num) { return log10(num) + 1; }                         // 桁数
ll digitSum(ll n) { return (n < 10) ? n : digitSum(n / 10) + n % 10; } // 各桁の和
#define pb push_back
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repn(i, n) for (ll i = 1; i <= n; i++)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define all(x) (x).begin(), (x).end()

void Main()
{
    string s;
    cin >> s;
    s[5] = ' ';
    s[13] = ' ';
    cout << s << endl;
    return;
}

signed main(void)
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
from sys import stdin
import numpy as np
# import math
import fractions as math
# N = int(stdin.readline().rstrip().split()[0])
# A = [int(x) for x in stdin.readline().rstrip().split()]
# N, X = [int(x) for x in stdin.readline().rstrip().split()]
# S = stdin.readline().rstrip().split()[0]

N = int(stdin.readline().rstrip().split()[0])
B = [int(x) for x in stdin.readline().rstrip().split()]

ans = []
def check(b,n):
  # print(b,n)
  if n==0:
    return True
  for i in range(n-1,-1,-1):
    if b[i] == i+1:
      # print(i+1)
      b.pop(i)
      ans.append(i+1)
      return check(b,n-1)
  return False

if check(B, N):
  ans = ans[::-1]
  for i in range(N):
    print(ans[i])
else:
  print(-1)



Measured memory_bytes: 13552
#include<stdio.h>
#include<string.h>
int main()
{
    char a[150000];
    int b[150000],c[150000];
    int k,i,ans=0;
    scanf("%s",a);
    int l=strlen(a);
    for(int i=0;i<l;i++)
    {
        b[i]=a[i]-48;
        if(b[i]==0)
            ans++;
    }
    int ant=l-ans;
    int x=ans<ant?ans:ant;
    printf("%d",2*x);
    /*c[0]=b[0];
    int cnt=0,ans=1;*/
   /* for(int i=1;i<l;i++)
    {
        if(b[i]==c[cnt])
        {
            cnt=cnt+1;
            ans=ans+1;
            c[cnt]=b[i];
        }
        else
        {
            if(cnt>=1)
            {
                cnt=cnt-1;

            }
            ans=ans-1;
        }
    }*/

    return 0;
}


Measured memory_bytes: 256
from datetime import datetime

youbi = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']

while True:
    line = input()
    if line.strip() == '0 0':
        break
    else:
        month, day = map(int, line.strip().split(' '))
        f = '%Y-%m-%d'
        a = datetime.strptime('2004-{}-{}'.format(month, day), f)
        print(youbi[a.weekday()])



Measured memory_bytes: 7336
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

    private void solve(FastScanner sc) {
        String s = sc.next();
        String t = "CODEFESTIVAL2016";
        int c = 0;
        for (int i = 0; i < t.length(); i++) {
            if (s.charAt(i) != t.charAt(i)) c++;
        }
        System.out.println(c);
    }

    /*
     * template
     */

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        new Main().solve(sc);
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int bufLen = 0;

        private boolean hasNextByte() {
            if (ptr < bufLen) {
                return true;
            } else {
                ptr = 0;
                try {
                    bufLen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (bufLen <= 0) {
                    return false;
                }
            }
            return true;
        }

        private int readByte() {
            if (hasNextByte()) return buffer[ptr++];
            else return -1;
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

        boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
            return hasNextByte();
        }

        String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while (isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 8148
#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
const int mn=1e5+4;
ll a[mn],b[mn];
void solve(long long n, long long C, vector<long long> x, vector<long long> v){
	ll final=0;
	ll best1=0;
	{
		ll sum=0;
		for (ll i=0;i<n;i++) {
			sum+=v[i];
			chkmax(best1,sum-x[i]);
			a[i]=best1;
		}
	}
	ll best2=0;
	{
		ll sum=0;
		for (ll i=n-1;i>=0;i--) {
			sum+=v[i];
			chkmax(best2,sum-(C-x[i]));
			b[i]=best2;
		}
	}
	chkmax(final,max(best1,best2));
	{
		ll sum=0;
		for (ll i=0;i<n-1;i++) {
			sum+=v[i];
			chkmax(final,b[i+1]+sum-2*x[i]);
		}
	}
	{
		ll sum=0;
		for (ll i=n-1;i>=1;i--) {
			sum+=v[i];
			chkmax(final,a[i-1]+sum-2*(C-x[i]));
		}
	}
	printf("%lld\n",final);
}

int main(){	
	ios_base::sync_with_stdio(false); cin.tie(0);
	long long N;
	long long C;
	scanf("%lld",&N);
	vector<long long> v(N-1+1);
	vector<long long> x(N-1+1);
	scanf("%lld",&C);
	for(int i = 0 ; i <= N-1 ; i++){
		scanf("%lld",&x[i]);
		scanf("%lld",&v[i]);
	}
	solve(N, C, x, v);
	return 0;
}



Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
#define pi 3.14159
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
#define mp make_pair
#define pq priority_queue
#define mod 1000000007
#define f first
#define s second
#define pii pair< int, int >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)

using namespace std;
string repeat(string s, int n) {
    string s1 = "";
    for (int i=0; i<n;i++)
        s1+=s;
    return s1;
}
string getString(char x) {
    string s(1, x);
    return s;
}

void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int gcd(int a, int b){
    if (a == 0)  return b;
    return gcd(b % a, a);
}
void  solve(){
  int n;
  cin>>n;
  string s[n];
  set<string> s1;
  cin>>s[0];
  s1.insert(s[0]);
  int flag=0;
  rep(i,1,n){
    cin>>s[i];
    if(s[i][0]!=s[i-1][s[i-1].length()-1] || s1.find(s[i])!=s1.end()){

      flag=1;
    }
    s1.insert(s[i]);
  }
  if(flag) cout<<"No\n";
  else cout<<"Yes\n";
}
int main(){
    optimizeIO();
    // tc
    { solve();
    }
}


Measured memory_bytes: 3632
using System;
using System.Collections.Generic;
using System.Linq;

namespace AizuOnlineJudge
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());

            var list = new List<Dice>();

            for (var i = 0; i < n; ++i)
                list.Add(new Dice(Console.ReadLine().Split(' ').Select(int.Parse).ToArray()));

            for(var i = 0; i < list.Count - 1; ++i)
                for(var k = i + 1; k < list.Count; ++k)
                {
                    if (list[i].IsStructureEquals(list[k]))
                    {
                        Console.WriteLine("No");
                        return;
                    }
                }
            Console.WriteLine("Yes");
        }
    }

    internal class Dice
    {
        public int[] Sides { private set; get; }

        public bool IsStructureEquals(Dice d)
        {
            var parents = new[] { d, d.North(), d.South(), d.East(), d.West(), d.North2() };
            var childs = parents.Select(e => new[] { e, e.R(), e.L(), e.R2() }).SelectMany(e => e);
            return childs.Any(e => e.Equals(this));
        }

        /// <summary>
        /// 完全に一致するかどうかを調べます
        /// </summary>
        /// <param name="obj">比較の対象</param>
        /// <returns>一致するかどうか</returns>
        public override bool Equals(object obj)
        {
            if(obj is Dice)
            {
                return ((Dice)obj).Sides.SequenceEqual(Sides);
            }
            return false;
        }

        public int this[int i]
        {
            get { return Sides[i]; }
        }

        public Dice(int[] v)
        {
            Sides = v;
        }

        //0 <- 3 <- 5 <- 2 <- 0
        public Dice East()
        {
            return new Dice(new[] { this[3], this[1], this[0], this[5], this[4], this[2] });
        }
        //0 -> 3 -> 5 -> 2 -> 0
        public Dice West()
        {
            return new Dice(new[] { this[2], this[1], this[5], this[0], this[4], this[3] });
        }
        //0 <- 1 <- 5 <- 4 <- 0
        public Dice North()
        {
            return new Dice(new[] { this[1], this[5], this[2], this[3], this[0], this[4] });
        }
        //0 -> 1 -> 5 -> 4 -> 0
        public Dice South()
        {
            return new Dice(new[] { this[4], this[0], this[2], this[3], this[5], this[1] });
        }
        //Rev(X Aligned)
        public Dice North2()
        {
            return new Dice(new[] { this[5], this[4], this[2], this[3], this[1], this[0] });
        }
        //Spin Right 1 <- 2 <- 4 <- 3 <- 1
        public Dice R()
        {
            return new Dice(new[] { this[0], this[2], this[4], this[1], this[3], this[5] });
        }
        //Spin Left 1 -> 2 -> 4 -> 3 -> 1
        public Dice L()
        {
            return new Dice(new[] { this[0], this[3], this[1], this[4], this[2], this[5] });
        }
        //Spin Left 1 <-> 4, 2 <-> 3
        public Dice R2()
        {
            return new Dice(new[] { this[0], this[4], this[3], this[2], this[1], this[5] });
        }
    }
}


Measured memory_bytes: 18460
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
typedef pair<string,string> Ps;
const ll INF=10000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct pos{
	// 1 変数を入れる;
	ll x,cost;
};
int main() {

	ll n,a,b;
	cin>>n>>a>>b;
	ll total=a*(n/(a+b));
	n=n%(a+b);
	cout<<total+min(n,a)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
  long long int n;
  cin>>n;
  long long int a = sqrt(n);
  long long int i;
  for(i=a;;i--)
  {
    if(n%i==0)
      break;
  }
  cout<<(i+(n/i)-2);
  return 0;
}


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

int main()
{
  int S,h,m,s;
  
  cin >> S;
  
  h = S/3600;
  m = (S-h*3600)/60;
  s = S-(h*3600+m*60);
  
  cout << h << ":" << m << ":" << s << '\n';
  
  return 0;
}

Measured memory_bytes: 3060
#include <cstdio>
#include <cstring>
#include <cassert>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;


typedef long long i64;
const i64 inf = 1.5e18;


int main()
{
	i64 a, b, c;
	i64 ans = inf;

	scanf("%lld%lld%lld", &a, &b, &c);

	ans = min({a * b * (c % 2), a * c * (b % 2), b * c * (a % 2)});

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

	return 0;
}


Measured memory_bytes: 128
#include<iostream>

using namespace std;

int main()
{
	long long n, ans = 0, wk;
	while(cin >> n)
	{

		for(int i = 0; i < n; i++)
		{
			cin	>> wk;
			ans += wk;
		}

		cout << ans / n << endl;
	}
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, N) for (int i = 0; i < (int)N; i++)

char a[100][100];

int main () {
  int H, W;
  cin >> H >> W;

  REP(i,H)REP(j,W) {
    cin >> a[i][j];
  }

  REP(i,H+2) {
    REP(j,W+2) {
      if(i == 0 || i == H+1 || j == 0 || j == W+1) {
        cout << '#';
      } else {
        cout << a[i-1][j-1];
      }
    }
    cout << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long


int main()
{
	IOS;
	string n;
	cin >> n;
	if (n[n.size() - 1] == '3') {
		cout << "bon" << endl;
	}
	else if (n[n.size() - 1] == '0' || n[n.size() - 1] == '1' || n[n.size() - 1] == '6' || n[n.size() - 1] == '8') {
		cout << "pon" << endl;
	}
	else {
		cout << "hon" << endl;
	}

	return 0;
}

Measured memory_bytes: 3616