akhauriyash/Code-Regression huggingface dataset:
//============================================================================
// Name        : c
// Date        : Tue Feb 19 22:22:47 CST 2019
// Author      : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include "bits/stdc++.h"
using namespace std;

#define pb push_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define mst(x, y) memset(x, y, sizeof(x))
#define pvar(x) cout << #x << ": "
#define fora(e, c) for (auto &e : c)
#define fori(i, a, b) for (int i = a; i < b; ++i)
#define ford(i, a, b) for (int i = a; i > b; --i)
#define output(v) cout << (v) << '\n'
#define prt(x, a, n) { cout << x[a]; if (a < n - 1) cout << " "; }
#define pvi(x, v) if(v) pvar(x); fora(a, x) cout << a << " "; cout << "\n"
#define par(x, s, n, v) if(v) pvar(x); fori(y, s, n) prt(x, y, n) cout << "\n"

#ifndef __has_trace
#define trace(...)
#endif
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

void amax(int& a, int b) {
    a = max(a, b);
}

void solve() {
    int n; cin >> n;
    vi aa(n, 0), bb(n, 0), cc(n, 0);
    fori (i, 0, n) {
        cin >> aa[i] >> bb[i] >> cc[i];
    }

    vvi dp(n, vi(3, 0));
    dp[0][0] = aa[0];
    dp[0][1] = bb[0];
    dp[0][2] = cc[0];
    fori (i, 0, n) {
        if (i + 1 < n) {
            amax(dp[i+1][0], dp[i][1] + aa[i+1]);
            amax(dp[i+1][0], dp[i][2] + aa[i+1]);

            amax(dp[i+1][1], dp[i][0] + bb[i+1]);
            amax(dp[i+1][1], dp[i][2] + bb[i+1]);

            amax(dp[i+1][2], dp[i][0] + cc[i+1]);
            amax(dp[i+1][2], dp[i][1] + cc[i+1]);
        }
    }
    output(max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2]));

}

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



Measured memory_bytes: 6912
#include<stdio.h>
#include<math.h>


int main (){



int i, j, N, K,count;
double kakuritu=0.0;

scanf("%d", &N);
scanf("%d", &K);

for(i=1; i<=N ; i++){
count=0;
j = i;
while(j < K){
j *=2;
count++;
}
kakuritu+=1.0/((double) N * pow(2,count));
}

printf("%.10lf\n",kakuritu);
return 0;

}

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

int main() {
  int N;
  string S;
  cin >> N >> S;
  
  int ans = 1;
  int renzoku = 0;
  for (int i = 1; i < N; i++) {
    if (S[i] != S[i-1]) {
      ans++;
    }
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
// K - Stones  https://atcoder.jp/contests/dp/tasks/dp_k
/* 入力例
2 4
2 3
// →出力 First
*/
#include <bits/stdc++.h>
using namespace std;

int N, K;
int a[100], mina;
int memdp[100001];
int dp(int n) {
    if(memdp[n] > -10) {
        return memdp[n];
    } else if(n < mina) {
        memdp[n] = -1;
        return memdp[n];
    } else {
        int maxdp = -10;
        for(int i = 0; i < N; i++) {
            int target = n - a[i];
            if(target >= 0) {
                if(maxdp < (dp(target) * (-1))) {
                    maxdp = dp(target) * (-1);
                }
            }
        }
        memdp[n] = maxdp;
        return memdp[n];
    }
}

int main(void) {
    cin >> N >> K;
    mina = INT_MAX;
    for(int i = 0; i < N; i++) {
        cin >> a[i];
        if(a[i] < mina)
            mina = a[i];
    }
    for(int i = 0; i <= 100000; i++) {
        memdp[i] = -10;
    }
    if(dp(K) == 1)
        cout << "First" << endl;
    else
        cout << "Second" << endl;
    return 0;
}


Measured memory_bytes: 5376
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)

	N := getInt()

	ans := int64(math.Ceil((-1 + math.Sqrt(1+8*float64(N))) / 2))
	if N == 0 {
		ans = 1
	}
	/*
		ans2 := 0

		for i := 1; ; i++ {
			if i*(i+1) >= 2*N {
				ans2 = i
				break
			}
		}
	*/
	out(ans)
}


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

#define int long long int
#define mp make_pair
using namespace std;

int32_t main() {
    string s;
    cin >> s;
    int n = s.length();
    string s1 = "keyence";
    if(s[0] == 'k') {
        int j = 1;
        for (int i = 1; i < n; ++i) {
            if (s[i] == s1[j]){
                j++;
            }
            else{
                break;
            }
        }
        int j1 = s1.length() - 1;
        int i = n-1;
        int c = 0;
        while(j1 >= j){
            if(s[i] != s1[j1]){
                c = 1;
                break;
            }
            i--;
            j1--;
        }
        if(c != 1){
            printf("YES");
            return 0;
        }
    }
    for (int i = 1; i <= n-7; ++i) {
        int c = 0;
        int k = 0;
        for (int j = i; j < n; ++j) {
            if(s[i] != s1[k]){
                c = 1;
                break;
            }
            k++;
        }
        if(c != 1){
            printf("YES");
            return 0;
        }
    }
    printf("NO");
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>

using namespace std;

vector<vector<int> > v;
int arr[100000];

int gcd(int a, int b){
  int g = a;
  while(a != b){
    if(a > b){
      g = a - b;
      a = b;
      b = g;
    }
    else {
      g = b - a;
      b = a;
      a = g;
    }

  }
  return g;
}


int main(){
  int a,b,c,x,y,n,m,k;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> arr[i];
  }
  for(int i = 1; i < n; i++){
    if(arr[i]>arr[i-1] && arr[i]%arr[i-1]==0) arr[i] = arr[i-1];
    else if(arr[i-1]>arr[i] && arr[i-1]%arr[i]== 0) arr[i-1] = arr[i];
    else arr[i] = gcd(arr[i-1], arr[i]);
  }
  cout << arr[n-1] << endl;
}
/*
int main(){
  int a,b,c,x,y,n,m,k;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> arr[i];
  }
  int mini = 1000000001;
  for(int i = 0; i < n ; i++){
    for(int j = i+1 ; j < n; j++){
      if(arr[i] > arr[j]){
        if(mini > arr[i]%arr[j]){
          if(arr[i]%arr[j] != 0) mini = arr[i]%arr[j];
          else if(mini > arr[j]) mini = arr[j];
        }
      }
      else if(mini > arr[j]%arr[i]){
        if(arr[j]%arr[i] != 0) mini = arr[j]%arr[i];
        else if(mini > arr[i]) mini = arr[i];
      }
//      cout << arr[i] << " " << arr[j] << " ";
//      cout <<mini << endl;
    }
  }
  for(int i = 0 ; i < n ; i++){
    if(arr[i]%mini != 0 && arr[i]%mini < mini){
      mini = arr[i]%mini;
    }
  }
  cout << mini << endl;
}
*/


Measured memory_bytes: 640
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        m: i32,
        q: usize,
        abcd: [(usize,usize,i32,i32);q],
    }
    let mut val = vec![1i32; n + 1];

    println!("{:?}", dfs(&mut val, 1, m, &abcd));
}

fn dfs(buf: &mut Vec<i32>, d: usize, ub: i32, abcd: &Vec<(usize, usize, i32, i32)>) -> i32 {
    let mut sum = 0;
    if d == buf.len() {
        for &(a, b, c, d) in abcd {
            if buf[b] - buf[a] == c {
                sum += d;
            }
        }
    } else {
        for i in buf[d - 1]..ub + 1 {
            buf[d] = i as i32;
            sum = std::cmp::max(sum, dfs(buf, d + 1, ub, abcd));
        }
    }
    sum
}


Measured memory_bytes: 2084
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
signed main(){
  ll n,cnt=0,v=1;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  for(int i=0;i<n;i++){
    if(a[i]==v){
      v++;
    }else{
      cnt++;
    }
  }
  if(cnt==n) cout << "-1\n";
  else cout << cnt << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
 
int main(){
    double x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    // cout << sqrt(pow((x2-x1),2) + pow((y2-y1),2)) << endl;
    // cout << sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1)) << endl;
    printf("%lf\n",sqrt(pow((x2-x1),2) + pow((y2-y1),2)));
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string S;cin >> S;
    int N[S.length()];
    for(int i = 0;i < S.length();i++){
        N[i] = S[i] - '0';
    }
    int ans = abs(753 -  (N[0] * 100 + N[1] * 10 + N[2]));
    for(int i = 1;i < S.length() - 2;i++){
        if(ans >  abs(753 -  (N[i] * 100 + N[i + 1] * 10 + N[i + 2]))){
            ans = abs(753 -  (N[i] * 100 + N[i + 1] * 10 + N[i + 2]));
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import numpy as np

N = int(input())
arr = np.array([int(i) for i in input().split()])

ans = 0

for i in range(60):
    c1 = np.count_nonzero(arr & 1)
    ans += 2 ** i * c1 * (N-c1)
    arr >>= 1


print(ans%1000000007)

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

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

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;

int main(){
  int w, h, n;
  cin >> w >> h >> n;
  vector<vector<bool>>board(h, vector<bool>(w, false));
  rep(i, 0, n){
    int x, y, a;
    cin >> x >> y >> a;
    if(a==1){
      rep(j, 0, h){
        rep(k, 0, x){
          board[j][k]=true;
        }
      }
    }
    if(a==2){
      rep(j, 0, h){
        rep(k, x, w){
          board[j][k]=true;
        }
      }
    }
    if(a==3){
      rep(j, 0, y){
        rep(k, 0, w){
          board[j][k]=true;
        }
      }
    }
    if(a==4){
      rep(j, y, h){
        rep(k, 0, w){
          board[j][k]=true;
        }
      }
    }
  }
  int ans = 0;
  rep(i, 0, h)rep(j, 0, w)if(board[i][j]==false)ans++;
  cout << ans << endl;
}

Measured memory_bytes: 3644
#include<stdio.h>

int main(){
	long k,i,j;
	scanf("%ld",&k);
	
	long long int a[k],b[k],c[k];
	long long int max,min;
	int flag;
	
	for(i=0;i<k;i++){
		scanf("%lld",&a[i]);
	}
	
	if(a[k-1]!=2){
		printf("-1\n");
		return 0;
	}
	
	b[k-1]=1;
	c[k-1]=1;
	
	for(i=k-2;i>=0;i--){
		flag=0;
		max = a[i+1]*(c[i+1]+1)-1; 
		min = a[i+1]*b[i+1];
		if(min - (min%a[i]) + a[i] <= max || min%a[i] == 0){
			flag=1;
		}
		if(flag==0){
			printf("-1");
			return 0;
		}
		b[i]=(a[i+1]*b[i+1])/a[i];
		if((a[i+1]*b[i+1])%a[i]>0){
			b[i]++;
		}
		c[i]=(a[i+1]*(c[i+1]+1)-1)/a[i];
	}
	printf("%lld %lld\n",a[0]*b[0],a[0]*(c[0]+1)-1);
	return 0;
}

Measured memory_bytes: 2560
from collections import deque

A, B = [-1, 0, 0, 1], [0, -1, 1, 0]


h, w = map(int, input().split())

GRID = []
black = 0
for _ in range(h):
    s = input()
    black += s.count("#")
    GRID.append("#" + s + "#")
GRID = ["#" * (w + 2)] + GRID + ["#" * (w + 2)]


DISTANCE = [[0] * (w + 2) for _ in range(h + 2)]

DISTANCE[1][1] = 1
QUEUE = deque([(1, 1)])
while QUEUE:
    i, j = QUEUE.popleft()
    for a, b in zip(A, B):
        if GRID[i + a][j + b] == "#":
            continue
        if DISTANCE[i + a][j + b] != 0:
            continue
        DISTANCE[i + a][j + b] = DISTANCE[i][j] + 1
        QUEUE.append((i + a, j + b))


if DISTANCE[h][w] == 0:
    print(-1)
else:
    print(h * w - DISTANCE[h][w] - black)


Measured memory_bytes: 3316
// Author - Sumit

#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define int ll
#define ps push
#define pb push_back
#define INF 1000000005
#define MOD 1000000007
#define mp make_pair
#define rep(i,a,b) for (int i = a; i < b; i++)
#define repd(i,a,b) for (int i = a; i >= b; i--)
#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define F first
#define S second
#define mii map<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define vpii vector<pair<int,int>>
#define itr :: iterator it
#define WL(t) while(t --)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define debug(x) cout << x << endl;
#define debug2(x,y) cout << x << " " << y << endl;
#define debug3(x,y,z) cout << x << " " << y << " " << z << endl;

void solve(){
    int n,k;
    cin>>n>>k;
    int a[n];
    rep(i,0,n) cin>>a[i];   
    int ar[n];
    // memset(ar,INF,sizeof(ar));
    ar[0]=0;
    ar[1]=abs(a[1]-a[0]);

    rep(i,2,n){
        // ar[i] = min(ar[i-1]+abs(a[i]-a[i-1]),ar[i-2]+abs(a[i]-a[i-2]));
        ar[i] = INF;
        rep(j,1,k+1){
            if((i-j)>=0){
                // cout<<(i-j)<<" ";
                ar[i] = min(ar[i],ar[i-j]+abs(a[i]-a[i-j]));
            }
        }
    }
    // cout<<endl;
    // for(auto x:ar){
    //     cout<<x<<" ";
    // }cout<<endl;
    debug(ar[n-1]);
}

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


    int t=1;
    // cin>>t;
    WL(t){
        solve();
    }    
}

Measured memory_bytes: 1792
// 2018, Sayutin Dmitry.

#include <bits/stdc++.h>

using std::cin;
using std::cout;
using std::cerr;

using std::vector;
using std::map;
using std::array;
using std::set;
using std::string;

using std::pair;
using std::make_pair;

using std::tuple;
using std::make_tuple;
using std::get;

using std::min;
using std::abs;
using std::max;

using std::unique;
using std::sort;
using std::generate;
using std::reverse;
using std::min_element;
using std::max_element;

#ifdef LOCAL
#define LASSERT(X) assert(X)
#else
#define LASSERT(X) {}
#endif

template <typename T>
T input() {
    T res;
    cin >> res;
    LASSERT(cin);
    return res;
}

template <typename IT>
void input_seq(IT b, IT e) {
    std::generate(b, e, input<typename std::remove_reference<decltype(*b)>::type>);
}

#define SZ(vec)         int((vec).size())
#define ALL(data)       data.begin(),data.end()
#define RALL(data)      data.rbegin(),data.rend()
#define TYPEMAX(type)   std::numeric_limits<type>::max()
#define TYPEMIN(type)   std::numeric_limits<type>::min()

#define pb push_back
#define eb emplace_back

int main() {
    std::iostream::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    // code here
    int n = input<int>();
    int x = input<int>();

    vector<int> a(n);
    input_seq(ALL(a));
    sort(ALL(a));

    int ans = 0;
    while (ans < n and x >= a[ans]) {
        x -= a[ans];
        ++ans;
    }

    if (ans == n and x != 0)
        --ans;
    cout << ans << "\n";
    
    return 0;
}


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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key)  x = x->left;
    else x = x->right;
  }
    z->parent = y;

    if(y == NIL) root = z;
    else if(z->key < y->key) y->left = z;
    else y->right = z;
}

void inorder(Node u){
  if(u != NIL){
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
  }
}

void preorder(Node u){
  if(u != NIL){
    printf(" %d",u->key);
    if(u->left != NIL)preorder(u->left);
    if(u->right != NIL)preorder(u->right);
  }
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } 
    else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}

Measured memory_bytes: 24040
#coding: utf-8
l, r = map(int,input().split())
l_mod, r_mod = map(lambda x: x % 2019, [l, r])
ans = 2019
#ans_i = 0
#ans_j = 0

if r - l <= 2019:
    R = r
    L = l
else:
    R = r_mod + 2019
    L = l_mod

for i in range(L,R):
    for j in range(i+1,R+1):
        #print(i,j)
        if (j*i) % 2019 < ans:
            ans = (j*i) % 2019
            #ans_i = i
            #ans_j = j
print(ans)


Measured memory_bytes: 3060
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	mi := int(1 << uint(31))
	for i := 0; i < n; i++ {
		var a, b int
		fmt.Scan(&a, &b)
		c := a + b
		if c < mi {
			mi = c
		}
	}
	fmt.Println(mi)
}


Measured memory_bytes: 7552
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  int n;
  cin >> n;
  vector<pair<int,int>> a(n); 
  rep(i,n){
    int b,c;
    cin >> b >> c;
    a.at(i)=make_pair(b,c);
  }
  double ans=1,sum=0;
  sort(a.begin(),a.end());
  do{
    for(int i=0;i<n-1;i++){
      double q=a.at(i).first,r=a.at(i).second;
      double b=a.at(i+1).first,c=a.at(i+1).second;
      sum+=sqrt((q-b)*(q-b)+(r-c)*(r-c));
    }
  }while (next_permutation(a.begin(),a.end()));
  for(int i=1;i<=n;i++){
    ans*=i;
  }
  printf("%.10lf",sum/ans);
}

Measured memory_bytes: 3852
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, begin, end) for (ll i = (begin); i < (end); i++)
#define REP(i, n) FOR(i, 0, n)
#define IFOR(i, begin, end) for (ll i = (begin)-1; i >= (end); i--)
#define IREP(i, n) IFOR(i, n, 0)
#define SORT(a) sort(a.begin(), a.end())
#define ISORT(a) sort(a.begin(), a.end(), greater<ll>())
#define REVERSE(a) reverse(a.begin(), a.end())
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v)                                          \
  cout << #v << "=(" << v[0];                              \
  FOR(i_debug, 1, v.size()) { cout << "," << v[i_debug]; } \
  cout << ")" << endl;
#define mdebug(m)                                                           \
  cout << #m << "=" << endl;                                                \
  REP(i_debug, m.size())                                                    \
  {                                                                         \
    REP(j_debug, m[i_debug].size()) { cout << m[i_debug][j_debug] << ","; } \
    cout << endl;                                                           \
  }
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)

#define ll long long
// #define f first
// #define s second
#define mp make_pair
#define pb push_back
#define INF 1000000000000000000

using vec = vector<ll>;
using mat = vector<vec>;
using Pii = pair<ll, ll>;
using PiP = pair<ll, Pii>;
using PPi = pair<Pii, ll>;
using bvec = vector<bool>;
using Pvec = vector<Pii>;

template <typename T>
void readv(vector<T> &a) { REP(i, a.size())
                           cin >> a[i]; }
void readv_m1(vector<int> &a)
{
  REP(i, a.size())
  {
    cin >> a[i];
    a[i]--;
  }
}

ll mod = 1000000007;

int main()
{
  ll A, B;
  cin >> A >> B;

  cout << A * B << endl;
  return 0;
}

Measured memory_bytes: 3592
// AtCoder Regular Contest 099
// Problem F - Eating Symbols Hard
#include <cstdio>
#include <cstring>
#include <iostream>
using std::cin; using std::cout; using std::endl;
#include <algorithm>
using std::sort;
#include <vector>
using std::vector;
#include <queue>
using std::queue; using std::priority_queue;
#include <map>
using std::map;
#include <utility>
using std::pair;
typedef pair<int, int> pii;
typedef long long LL;
#define pass printf("%s : Line.%d\n", __FUNCTION__, __LINE__);
const int maxN = 250000 + 233; // 2.5e5
int n;
char opt[maxN];
int d[maxN], df; LL h1[maxN], hf1, h2[maxN], hf2;
//const LL P = 1e9 + 7;
bool isp(LL x) {
	for(int i = 2; i*i <= x; ++i)
		if(x % i == 0) return false;
	return true;
}
const LL p1 = 1000000007;
const LL p2 = 1000000123;
const LL b1 = 199;
const LL b2 = 211;
LL buc1[maxN*2], buc2[maxN*2];
LL *pow1 = &buc1[maxN], *pow2 = &buc2[maxN];
LL inv(LL x, LL p1) {
	return x == 1 ? x : (p1 - (p1 / x) * inv(p1 % x, p1)) % p1;
}
LL inc(LL &a, LL b1, LL p1) { return (a += b1) >= p1 ? a -= p1 : a; }
LL dec(LL &a, LL b1, LL p1) { return (a -= b1) < 0 ? a += p1 : a; }
map<pii, int> M;

void init() {
	pow1[0] = 1; pow2[0] = 1;
	pow1[1] = b1; pow1[-1] = inv(b1, p1); pow2[1] = b2; pow2[-1] = inv(b2, p2);
	for(int i = 1; i <= n; ++i) pow1[i] = pow1[i-1] * b1 % p1, pow2[i] = pow2[i-1] * b2 % p2;
	for(int i = -1; i >= -n; --i) pow1[i] = pow1[i+1]* pow1[-1] % p1, pow2[i] = pow2[i+1]* pow2[-1] % p2;
	hf1 = hf2 = df = 0;
	for(int i = 1; i <= n; ++i) {
		switch(opt[i]) {
			case '+':
				inc(hf1, pow1[df], p1);
				inc(hf2, pow2[df], p2);
				break;
			case '-':
				dec(hf1, pow1[df], p1);
				dec(hf2, pow2[df], p2);
				break;
			case '>':
				++df;
				break;
			case '<':
				--df;
				break;
		}
	}
}

int main() {
//	for(int i = (int)1e9; ; ++i) if(isp(i)) printf("%d\n", i), getchar();
//	printf("%.3lfMB\n", sizeof(buc1)*6/1000.0/1000.0);
	scanf("%d%s", &n, opt + 1);
	init();
	LL cnt = 0;
	M.clear();
	h1[0] = h2[0] = d[0] = 0;
	M[pii((h1[0] + hf1 * pow1[d[0]]) % p1, (h2[0] + hf2 * pow2[d[0]]) % p2)] = 1;
	for(int i = 1; i <= n; ++i) {
		d[i] = d[i-1]; h1[i] = h1[i-1]; h2[i] = h2[i-1];
		switch(opt[i]) {
			case '+':
				inc(h1[i], pow1[d[i]], p1);
				inc(h2[i], pow2[d[i]], p2);
				break;
			case '-':
				dec(h1[i], pow1[d[i]], p1);
				dec(h2[i], pow2[d[i]], p2);
				break;
			case '>':
				++d[i];
				break;
			case '<':
				--d[i];
				break;
		}
//		printf("[%d]: d = %d, h = {%lld, %lld}\n", i, d[i], h1[i], h2[i]);
		pii c(h1[i], h2[i]), ins((h1[i] + hf1 * pow1[d[i]]) % p1, (h2[i] + hf2 * pow2[d[i]]) % p2);
		if(M.find(c) != M.end()) cnt += M[c]/*, printf("i = %d, cnt += %d\n", i, M[c])*/;
		if(M.find(ins) == M.end()) M[ins] = 1; else ++M[ins];
	}
	printf("%lld\n", cnt);
	return 0;
}

Measured memory_bytes: 28800
//If you are reading this then you are at wrong place.
#include<bits/stdc++.h>
#define mod 1000000007
#define lli long long int
using namespace std;
bool prime [1000001];
void debug(lli a){cout<<a<<endl;}
lli sieve(lli a){memset(prime,true,sizeof(prime));lli p,i;for(p=2;p*p<=a;p++){if(prime[p]==true){for(i=p*2;i<=a;i+=p)prime[i]=false;}}return 0;}
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli find_max(lli __a,lli __b){return __a^((__a^__b) & -(__a<__b));}
lli add(lli __a,lli __b,lli MOD){lli x = (__a+__b)%MOD; return x; }
lli mul(lli a,lli b,lli MOD){lli x = (a*b)%MOD; return x; }
lli sub(lli a,lli b,lli MOD){lli x = (a-b+MOD)%MOD; return x; }
lli div(lli a,lli b,lli MOD){lli x = a;lli y = powermod(b,MOD-2,MOD);lli res = (x*y)%MOD;return res;}
int v1[100001]={0};
int level1[100001]={0};
int v2[100001]={0};
int level2[100001]={0};
vector<int>answer[100001];
int bfs1(int s)
{
	queue<long long int>q;
	q.push(s);
	level1[s]=0;
	v1[s]=1;
	long long int i;
	while(!q.empty())
	{
		long long int p=q.front();
		q.pop();
		for(i=0;i<answer[p].size();i++)
		{
			if(v1[answer[p].at(i)]==0)
			{
				level1[answer[p].at(i)]=level1[p]+1;
				q.push(answer[p].at(i));
				v1[answer[p].at(i)]=1;	
			}	
		}	
	}	
}
int bfs2(int s)
{
	queue<long long int>q;
	q.push(s);
	level2[s]=0;
	v2[s]=1;
	long long int i;
	while(!q.empty())
	{
		long long int p=q.front();
		q.pop();
		for(i=0;i<answer[p].size();i++)
		{
			if(v2[answer[p].at(i)]==0)
			{
				level2[answer[p].at(i)]=level2[p]+1;
				q.push(answer[p].at(i));
				v2[answer[p].at(i)]=1;	
			}	
		}	
	}	
}

int main()
{
	//ifstream cin("testcase.txt");
	//ofstream cout("output.txt");	
	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);	
	cout.precision(20);
	lli t,i,j;
	//cin>>t;
	//memset(dp, -1, sizeof dp);
	t=1;
	lli counter1=0;
	while(t--)
	{
		counter1++;
		int n;
		cin>>n;
		int x,y;
		for(i=0;i<n-1;i++)
		{
			cin>>x>>y;
			answer[x].push_back(y);
			answer[y].push_back(x);
		}
		bfs1(1);
		bfs2(n);
		int ans1=0;
		int ans2=0;
		for(i=1;i<=n;i++)
		{
			if(level1[i]<=level2[i])
				ans1++;
			else
				ans2++;
		}
		if(ans1>ans2)
		{
			cout<<"Fennec"<<endl;
			return 0;
		}
		cout<<"Snuke"<<endl;
		
		//cout<<"Case #"<<counter1<<" ";
		//cout<<endl;	
	}	
}


Measured memory_bytes: 7748
c = [[]]*3

for i in range(3):
    c[i] = list(map(int, input().split()))


arr = [0]*3
sum = 0
for i in range(3):
    arr[0] += c[i][i]
for i in range(3):
    if i + 1 < 3:
        arr[1] += c[i][i+1]
    else:
        arr[1] += c[i][0]
for i in range(3):
    if i + 2 < 3:
        arr[2] += c[i][i+2]
    else:
        arr[2] += c[i][i-1]

if arr[0] != arr[1] or arr[0] != arr[2]:
    print("No")
    exit(0)

print("Yes")
exit(0)


Measured memory_bytes: 3064
h,w=map(int,input().split())
A=[list(map(int,input().split())) for i in range(h)]
B=[list(map(int,input().split())) for i in range(h)]
C=[[0]*w for i in range(h)]
for i in range(h):
    for j in range(w):
        C[i][j]=abs(A[i][j]-B[i][j])
        
dp=[[0]*w for i in range(h)]
m=80
dp[0][0] = (1<<m+C[0][0]) | (1<<m-C[0][0])

for i in range(h):
    for j in range(w):
        if i>=1:
            dp[i][j] |= (dp[i-1][j]<<m+C[i][j]) | (dp[i-1][j]<<m-C[i][j])
        if j>=1:
            dp[i][j] |= (dp[i][j-1]<<m+C[i][j]) | (dp[i][j-1]<<m-C[i][j])
            
b=list(bin(dp[h-1][w-1]))[::-1]
ans=float("inf")

for i in range(len(b)):
    if b[i]=="1":
        ans=min(ans,abs(m*(h+w-1)-i))

print(ans)

Measured memory_bytes: 56028
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;i++)
	{
		int x;
		cin>>x;
		sum+=x;
		sum%=2;
	}
	if(sum)cout<<"NO"<<endl;else cout<<"YES"<<endl;
	return 0;
}

Measured memory_bytes: 256
n,m=(int(i) for i in input().split())
l=[None,None,None]
answer='unknown'
for i in range(m):
  a,b=(int(i) for i in input().split())
  if l[n-a]==None:
    l[n-a]=b
  elif l[n-a]!=b:
    answer='-1'
    break
if l[0]==None:
  l[0]=0
for i in range(3):
  if l[i]==None:
    if i!=n-1:
      l[i]=0
    else:
      l[i]=1
r=l[2]*10**2+l[1]*10+l[0]
if len(str(r))!=n:
  answer='-1'
if answer=='-1':
  print('-1')
else:
  print(r)

Measured memory_bytes: 3064
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>

int main()
{
  char a[6];
  int i=0;
  
  for(i=0;i<6;i++)
  {
  scanf("%c",&a[i]);
  }
  i=0;
  if((a[2]==a[3])&&(a[4]==a[5]))
  {
    i=1;
  }
  
  if(i==0)
  {
    printf("No\n");
  }
  else if(i==1)
  {
    printf("Yes\n");
  }
  
  return 0;
  
}

Measured memory_bytes: 128
import numpy as np
H, W = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))

B = []
cnt = 1
for a in A:
  for i in range(a):
    B.append(cnt)
  cnt += 1
B = np.array(B)
B = np.ndarray.reshape(B,[H,W])
for i in range(H):
  for j in range(W):
#    print (i,j,W-j)
    print (B[i][j] if i % 2 == 0 else B[i][W-j-1], end = " ")
  print ()
  

Measured memory_bytes: 13272
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<cmath>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<algorithm>
#include<bitset>
#include<complex>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
using namespace std;
int k;
string s;
int main()
{
	cin>>k;
	cin>>s;
	if (s.length()>k)
	{
		for (int i=0;i<k;++i)
			printf("%c",s[i]);
		cout<<"...";
		return 0;
	}
	cout<<s;
	return 0;
}

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

using namespace std;

#define vi vector<int>
#define pb push_back
#define ll long long
#define qi queue<int>
#define vll vector<long long>
#define si set<int>
#define mi map<int,int>
#define mod %
#define pow ^
#define frt(i,a,b) for(int i=a;i<b;i++)
#define fre(i,a,b) for(int i=a;i<=b;i++)
#define pair_int pair<int,int>
#define pair_ll pair<ll,ll>
#define pq priority_queue
#define N 200007


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

   int n,k;
   cin >> n >> k;

   ll a[n+1];
   for (int i = 0; i < n; ++i)
   {
   	  cin >> a[i+1];
   }

   ll dp[n+1];
   dp[0]=0;
   dp[1]=0;
   dp[2]=abs(a[2]-a[1]);

   for(int i=2;i<=n;i++)
   {
   	  ll mn = -1;
   	  for(int j=i-1;j>0 && j>=i-k;j--)
   	  {
   	  	 if(mn==-1)
   	  	 	mn = dp[j]+abs(a[j]-a[i]);
   	  	 else
   	  	 	mn = min(mn,dp[j]+abs(a[j]-a[i]));
   	  }
   	  dp[i] = mn;
   }
   cout << dp[n] << endl;



   return 0;
}


  


Measured memory_bytes: 1792
s = input()

words = {}

for i in s:
  if words.get(i):
    words[i] += 1
  else:
    words[i] = 1
  
if len(words.keys()) == 2 and list(words.values())[0] == list(words.values())[1] == 2:
   print('Yes')
else:
   print('No')

Measured memory_bytes: 3060
import numpy as np

_,*_t=[list(map(int,i.split())) for i in open(0)]
n=_[0]
m=_[1]
x=_[2]
table=np.array(_t)
value=9000000


def boolAchieve(nums):
  for i in range(1,m+1):
    if nums[i]<x:
      return False
  return True


tmp=np.sum(table,axis=0)
if not boolAchieve(tmp):
  print(-1)
  exit()


for i in range(1,2 ** n):
  #numpyで書いてみた
  slist=np.right_shift(i,np.arange(n))
  blist=np.bitwise_and(slist,1).tolist()
  selects=list(map(bool,blist))
  #元のコード
  #selects=[bool((i >> j) & 1) for j in range(n)]

  picks=np.sum(table[selects,:],axis=0)
  if not boolAchieve(picks):
    continue
  value=min(value,picks[0])

  
print(value)

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

int main ()
{
    int len, i,cnt=0;
    char sign[5];
    for(i=1; i<=4; i++)
    {
        scanf("%c", &sign[i]);
        if(sign[i]=='+')
            cnt++;
        else
            cnt--;
    }

    printf("%d\n",cnt);
    return 0;
}


Measured memory_bytes: 128
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define yes(n) cout << ((n) ? "yes" : "no"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!": ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define VSUM(V) accumulate(ALL(V), 0)
#define MID(a,b,c) (a) < (b) && (b) < (c)
#define MIDe(a,b,c) (a) <= (b) && (b) <= (c)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define IN4(a,b,c,d) cin >> a >> b >> c >> d
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b != 0 ? gcd(b, a % b) : a;} //最大公約数
int lcm(int a, int b){return a * b / gcd(a, b);}
string toStrUp(string str){char diff = 'A'-'a';REP(i,str.size()) str[i] += diff;return str;}
string gCh(string str, int key){return str.substr(key,1);}

signed main() {
  RAPID;
  // デフォルト変数定義
  int n=0,m=0,a=0,b=0,c=0,d=0,x=0,y=0,z=0;
  string s="",t="";
  //

  // ここから
  IN(n);
  Vi A(n);
  VIN(A)
  bool light = false;
  int tag = 1;
  REP(i,n){
    tag = A[tag-1];
    c++;
    if(tag==2) {light=true;break;}
  }
  if(light) OUT(c);
  else OUT(-1);
}

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

class SLEqual
    {
        static void Main()
    {
        var a = Console.ReadLine();
        int b = int.Parse(a.Split(' ')[0]);
        int c = int.Parse(a.Split(' ')[1]);
            if(b<c)
                Console.WriteLine("a < b");
            else if (b > c)
                Console.WriteLine("a > b");
            else 
                Console.WriteLine("a == b");

        }
    }

Measured memory_bytes: 5288
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdio>
using namespace std;

#define int long long

signed main() {
    int n, m; cin >> n >> m;
    vector<int> cnt(n, 0);
    for(int i = 0; i < m; i++) {
        int a, b; cin >> a >> b;
        cnt[a - 1]++;
        cnt[b - 1]++;
    }
    for(int i = 0; i < n; i++) {
        cout << cnt[i] << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main(){
	int N;
	while(cin >> N){
		vector<long long> A(N), B(N);
		long long res = 0;
		for(int i=0;i<N;i++) cin >> A[i] >> B[i];
		for(int i=N-1;i>=0;i--){
			long long rest = (A[i]+res)%B[i];
			if(rest > 0) res += B[i] - rest;
		}
		cout << res << endl;
	}
}


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

int no[10] = {};

bool isOK(int n){
    while(n > 0){
        if(no[n%10] == 1){
            return false;
        }
        n /= 10;
    }
    return true;
}

int main(){
    int n, k;
    cin >> n >> k;

    int t;
    for(int i = 0;i < k;i++){
        cin >> t;
        no[t] = 1;
    }

    int i = n;
    while(1){
        if(isOK(i)){
            cout << i << endl;
            return 0;
        }else{
            i++;
        }
    }

    return 0;
}



Measured memory_bytes: 256
import java.util.*;
import java.io.*;
class Main{
    int gcd(int p, int q){
	return q==0?p:gcd(q,p%q);
    }

    void ruun(){
	Scanner sc = new Scanner(System.in);
	int x, y, z;
	while(sc.hasNext()){
	    x = sc.nextInt();
	    y= sc.nextInt();
	    z = gcd(Math.max(x,y), Math.min(x,y));
	    System.out.println(z+" "+x/z*y);
	}
    }

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

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

using namespace std;
using ll = long long;
int main()
{
    ll k;
    ll a,b;
    cin>>k;
    cin>>a>>b;
    ll flag = 0;
for(ll i=a;i<=b;i++){
    if(i%k==0){
        flag=1;
        break;
    }

}
if(flag==1)cout<<"OK";
else{
    cout<<"NG";
}


    return 0;
}


Measured memory_bytes: 3632
//#include <fsociety>
#include <cmath>
#include <deque>
#include <algorithm>
#include <iterator>
#include <list>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <unordered_set>
#include <stack>
#include <string>
#include <vector>
#include <iostream>
//end of libraries ;
#define INF 9999999999
#define N 300003
#define F first
#define S second
#define pb push_back
#define ll long long
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
int n , a[N] ,sum , k;
int main(){
fcin;
	cin>>k>>n;
	for(int i = 0 ; i < n ; i++){
		cin>>a[i];
	}
	sort(a,a+n);
	int cmax = 0;
	for(int i = 0 ; i < n-1 ; i++){
		sum += (a[i+1] - a[i]);
		cmax = max(cmax,a[i+1]-a[i]);
	}
	if(cmax >  k + a[0] - a[n-1]) {
		sum -= cmax;
		sum+=k + a[0] - a[n-1];
	}
	cout<<sum<<"\n";
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	ll n;
	cin >> n;
	ll a[n+1], b[n+1], c[n+1];
	rep(i, 1, n+1){
		cin >> a[i] >> b[i] >> c[i];
	}
	ll dp[n+1][3];
	rep(i, 0, 3){dp[0][i] = 0;}
	
	rep(i, 0, n){
		dp[i+1][0] = max(dp[i][1]+a[i+1], dp[i][2]+a[i+1]);
		dp[i+1][1] = max(dp[i][2]+b[i+1], dp[i][0]+b[i+1]);
		dp[i+1][2] = max(dp[i][0]+c[i+1], dp[i][1]+c[i+1]);
	}
	print(max(dp[n][0], max(dp[n][1], dp[n][2])))
	return 0;
}

Measured memory_bytes: 4992
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	long n = sc.nextLong();
    long a = sc.nextLong();
    long b = sc.nextLong();
    long kakeru = n / (a + b);
    long amari = n % (a + b);
    if(amari > a){
      System.out.println(kakeru * a + a);
    }
    else
    {
      System.out.println(kakeru * a + amari);
    }
    
    
    
    //HashMap<String,Integer> map = new HashMap<String,Integer>();
    //LinkedList<String> array = new LinkedList<String>();
    //int max = 1;
    /*
    for(int i = 0; i < n; i++){
      String s = sc.next();
      int tmp = 1;
      if(map.containsKey(s)){
        tmp = map.get(s)+1;
      }
      map.put(s, tmp);
      
      if(tmp == max){
        array.add(s);
      } 
      else if(tmp > max){
        max = tmp;
        array.clear();
        array.add(s);
      }
    }
    */
    //array.sort(Comparator.naturalOrder());
    //for(String value : array)
	//{
      //System.out.println(value);
	//}
  }
}

Measured memory_bytes: 23764
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
min_cost = min(A, B, C, D, E)
#print(min_cost)

if N % min_cost == 0:
    g_num = N // min_cost
else:
    g_num = N // min_cost + 1

print(5 + g_num - 1)

Measured memory_bytes: 3064
package main

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

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N := sc.nextInt()
	A := sc.nextIntSlice(N)
	S := make([]int, N+1)
	S[0] = 0
	for i := 0; i < N; i++ {
		S[i+1] = A[i] + S[i]
	}
	ans := int(1e+10)
	for i := 1; i < N; i++ {
		rest := S[N] - S[i]
		diff := abs(rest - S[i])
		if diff < ans {
			ans = diff
		}
	}

	fmt.Fprintln(wtr, ans)
	wtr.Flush()
}


Measured memory_bytes: 5248
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX 10000

int main(){
    int n;
    double a,b,c,d[MAX+1];
    
    cin >> n >> a >> b >> c;
    for(int i = 0 ; i < n ; i++){
        cin >> d[i];
    }
    sort(d,d+n);
    
    int k = 1;
    double max;
    max = (d[n-1]+c)/(a+k*b);
    for(int i = n - 1 ;i > 1; i--){
        double sum = d[i];
        for(int j = i-1 ; j > 0 ; j--){
            if(max < (c+sum+d[j])/(a+(k+1)*b)){
                k++;
                sum += d[j];
                max = (c+sum)/(a+k*b);
            }
            else goto end;
        }
    }
    end:
    int ans = (int)max;
    cout << ans << endl;
    
    
    return 0;
}

Measured memory_bytes: 1252
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

int main() {
	ll a, b;

	cin >> a >> b;

	if (a == b) {
		cout << "Draw" << endl;
	}
	else if ((a != 1 && b != 1 && a > b) || a == 1) {
		cout << "Alice" << endl;
	}
	else {
		cout << "Bob" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long int ll;
void solve()
{
	int n;cin>>n;
	string s;cin>>s;
	if(s.size()<=n)cout << s;
	else{
		string s1;
		for(int i=0;i<n;i++){
			s1+=s[i];
		}
		s1=s1+"...";
		cout << s1;
	}
}
int main(){
	//freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
	solve();
	return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;

#define DE 1
#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define ALL(s) (s).begin(),(s).end()
#define REP(i,n) for (int i = 0; i < (int)(n); ++i)
#define EACH(i,s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl

template<class T1, class T2> ostream& operator<<(ostream &s, pair<T1,T2> P){return s<<'<'<<P.first<<", "<<P.second<<'>';}
template<class T> ostream& operator<<(ostream &s, vector<T> P) {s<<"{ ";for(int i=0;i<P.size();++i){if(i>0)s<<", ";s<<P[i];}return s<<" }"<<endl;}
template<class T1, class T2> ostream& operator<<(ostream &s, map<T1,T2> P) {s<<"{ ";for(__typeof__(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<'<'<<it->first<<"->"<<it->second<<'>';}return s<<" }"<<endl;}



int A, B, K;

vector<int> tovec(long long a, int n) {
    vector<int> res;
    while (true) {
        if (a < n) {
            res.push_back(a);
            break;
        }
        else {
            res.push_back((int)(a%n));
            a /= n;
        }
    }
    return res;
}

long long tonum(vector<int> P, int n) {
    long long res = 0LL;
    reverse(ALL(P));
    for (int i = 0; i < P.size(); ++i) {
        res *= (long long)(n);
        res += (long long)(P[i]);
    }
    return res;
}

vint sub(vint va, vint vb, int bit) {
    int n = va.size();
    vint res(n, 0);
    int b = 0;
    for (int i = 0; i < n-1; ++i) {
        if (bit & (1<<i)) {
            if (va[i]-b >= vb[i]) return vint();
            res[i] = va[i] + 10 - vb[i] - b;
            b = 0;
        }
        else {
            if (va[i]-b >= vb[i]) {
                res[i] = va[i] - vb[i] - b;
                b = 0;
            }
            else {
                res[i] = va[i] + 10 - vb[i] - b;
                b = 1;
            }
        }
    }
    return res;
}

int main() {
    while (cin >> A >> B >> K) {
        int res = -1;
        vint va = tovec(A, 10), vb = tovec(B, 10);
        while (va.size() < 10) va.PB(0);
        while (vb.size() < 10) vb.PB(0);
        
        //COUT(va); COUT(vb);
        
        for (int bit = 0; bit < (1<<10); ++bit) {
            if (__builtin_popcount(bit) > K) continue;
            vint vt = sub(va, vb, bit);
            
            //cout << bitset<5>(bit) << " : " << vt;
            
            int t = tonum(vt, 10);
            res = max(res, t);
        }
         
        cout << res << endl;
    }
    
    return 0;
}


Measured memory_bytes: 1224
#include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define ALL(a) a.begin(), a.end()
typedef long long ll;
#define MOD 1000000007
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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

  ll N,K; cin>>N>>K;
  vector<ll> arr(N); rep(i,N)arr[i]=0;
  rep(i,K) {
    ll d; cin>>d;
    rep(j,d) {
      ll A; cin>>A;
      ++arr[A-1];
    }
  }
  ll res = 0;
  rep(i,N) {
    if(arr[i]==0)++res;
  }
  cout<<res<<endl;

  return 0;
}


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

int main()
{
  int a,b,c,d,e,k;
  bool judge;
  
  scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&k);
  
  if((e-a)>k){
    judge=false;
  /*}else if((c-b)>k){
    judge=false;
  }else if((d-c)>k){
    judge=false;
  }else if((e-d)>k){
    judge=false;
  */}else{
    judge=true;
  }
  
  if(judge==true){
    printf("Yay!\n");
  }else{
    printf(":(\n");
  }
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b,c;
    char d,e;
  	string s;
  	cin>>a;
  if(a>=1200&&a<2800)
    cout<<"ARC"<<endl;
 else if(a>=2800)
   cout<<"AGC"<<endl;
 else
   cout<<"ABC"<<endl;
 /* else if(a==23)
    cout<<"Christmas Eve Eve"<<endl;
  else
    cout<<"Christmas Eve Eve Eve"<<endl;
  */

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

int main(void) {
    double a, b, x;
    scanf("%lf%lf%lf", &a, &b, &x);
    if(x <= a*a*b/2) {
        printf("%.6f\n", 90 - (atan((2*x)/(a*b*b)) * 180 / (atan(1.0) * 4)));
    } else {
        printf("%.6f\n", 90 - (atan((a*a*a)/(2*(a*a*b-x))) * 180 / (atan(1.0) * 4)));
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(){
  unsigned long long int H;
  cin >> H;
  unsigned long long int count = 0;
  while(true){
      if(H == 1)
      break;
        H /= 2;
        count++;
  }
  unsigned long long int a = 1;
  unsigned long long int c = 1;
  for(int i = 0;i < count;i++){
    a *= 2;
    c += a;
  }
  cout << c << endl;
}

Measured memory_bytes: 256