akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

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

int main(){
  string n;
  cin >> n;
  if(n[0]==n[2])cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

int main()
{
  int n;
  cin >> n;
  
  string s[n];
  string t;
  rep(i,n)
  {
    cin >> t;
    sort(t.begin(),t.end());
    s[i] = t;
  }
  
  sort(s,s+n);
  
  ll x[n] = {0};
  for(int i = 1; i < n; i++)
  {
    if(s[i] == s[i-1])
    {
      x[i] += x[i-1] + 1;
    }else
    {
      x[i] = 0;
    }
  }
  
  ll ans = 0;
  for(int i = 0; i < n; i++)
  {
    ans += x[i];
  }
  
  cout << ans << endl; 
  
}


Measured memory_bytes: 7472
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxN=705;
int n,m,tot,g[maxN][maxN],col[maxN];
int now[maxN][2],bel[maxN],f[maxN][maxN*2];
int dfs(int x){
  bel[x]=tot;
  now[tot][col[x]]++;
  for(int i=1;i<=n;++i)if(i!=x&&!g[x][i]){
    int v=i;
    if(col[v]+col[x]==1)continue;
    if(col[v]==col[x])return 0;
    col[v]=col[x]^1;
    if(!dfs(v))return 0;
  }
  return 1;
}
int main(){
 // freopen("aa.in","r",stdin);
  int i,j;
  scanf("%d%d",&n,&m);
  for(i=1;i<=m;++i){
    int x,y;
    scanf("%d%d",&x,&y);
    g[x][y]=g[y][x]=1;
  }
  memset(col,-1,sizeof(col));
  for(i=1;i<=n;++i)if(col[i]==-1){
    ++tot;col[i]=1;
    if(!dfs(i))return puts("-1"),0;
  }
  f[0][n]=1;
  for(i=0;i<tot;++i){
    //printf("blk %d : %d %d\n",i+1,now[i+1][0],now[i+1][1]);
    int d=now[i+1][0]-now[i+1][1];
    for(j=-n;j<=n;++j)if(f[i][j+n]){
      f[i+1][j-d+n]=1;
      f[i+1][j+d+n]=1;
    }
  }
  for(i=0;!f[tot][i+n]&&!f[tot][-i+n];++i);
  //printf("delta %d\n",i);
  assert((n-i)%2==0);
  int x=(n-i)/2;
  int y=x+i;
  int ans=x*y;
  //printf("ans1 : %d\n",ans);
  for(i=1;i<=n;++i){
    for(j=i+1;j<=n;++j){
      if(!g[i][j]&&bel[i]==bel[j]&&col[i]+col[j]==1)--ans;
    }
  }
  printf("%d\n",m-ans);
  return 0;
}

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

#if DEBUG && !ONLINE_JUDGE
  #include "header.h"
#else
  #define debug(args...)
#endif

typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long lli;
typedef long double ld;

#define pb push_back
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x).size()
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define rep(i,a,b) for(auto i=(a);i<b;i++)

#define INF (int)1e9
#define EPS 1e-9
#define MOD 1000000007
void preprocess(void) {
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int n, k, s; cin>>n>>k>>s;
  if(s != (int)1e9) {
    rep(i,0,k) cout<<s<<" ";
    rep(i,k,n) cout<<(int)1e9<<" ";
    cout<<endl;
  }
  else {
    rep(i,0,k) cout<<s<<" ";
    rep(i,k,n) cout<<1<<" ";
    cout<<endl;
  }
}



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

#define rep(i, a) for (int i = 0; i < (a); ++i)
#define REP(i, a, b) for (int i = a; i < (b); ++i)
#define REV(i, a, b) for (int i = a; i > (b); --i)
#define debug(a) cerr << #a << " " << a << endl
#define debug2(a, b) cerr << #a << " " << a << ", " << #b << " " << b << endl

using namespace std;
using ll = long long;
using P = pair<int, int>;

// auto mod int
const int mod = 1000000007;
#pragma GCC diagnostic ignored "-Wshadow"
struct mint {
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};
istream& operator>>(istream& is, const mint& a) {return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) {return os << a.x;}
#pragma GCC diagnostic warning "-Wshadow"

void Main() {
  int n; cin>>n;
  int k; cin>>k;
  vector<ll> left(n+2,0), right(n+2, 0);
  rep(i, n+1) left[i+1] = left[i] + i;
  rep(i, n+1) right[i+1] = right[i] + n - i;
  mint ans = 0;
  REP(i, k, n+2) ans += right[i] - left[i] + 1;
  cout << ans << endl;
}

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


Measured memory_bytes: 6368
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	var X int
	fmt.Sscanf(scanner.Text(), "%d", &X)

	var ans string
	switch X {
	case 3, 5, 7:
		ans = "YES"
	default:
		ans = "NO"
	}
	fmt.Println(ans)
}


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

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            string T = Console.ReadLine();
            bool IDflag = true, lengthflag = false;
            if (S.Length + 1 == T.Length) lengthflag = true;
            for(int i = 0; i < S.Length; i++)
            {
                if (S[i] != T[i]) IDflag = false;
            }
            if (lengthflag && IDflag) Console.WriteLine("Yes");
            else Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 25784
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define Sort(a) sort(a.begin(), a.end())
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
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;}

int main(){
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> s(h);
    vi f(h, false);
    rep(i, h) {
        cin >> s[i];
        rep(j, w) {
            if(s[i].at(j) == '#') {
                f[i] = true;
            }
        }
    }
    bool ff = false;
    int flag_0 = 0;
    int cnt = 0;
    vector<vector<int>> a(h, vector<int>(w, 0));
    rep(i, h) {
        bool flag = false;
        if(f[i]) cnt++;
        rep(j, w) {
            if(!f[i]) {
                flag_0++;
                if(k == 0) {
                    a[i][j] = a[i-1][j];
                    continue;
                }
                break;
            }
            if(s[i].at(j) == '#') {
                k--;
                if(!flag){
                    flag = true;
                }
                else {
                    cnt++;    
                }
            }
            a[i][j] = cnt;
            if(flag_0 != 0) {
                rep(m, flag_0) {
                    a[i-m-1][j] = a[i][j];
                    ff = true;
                }
            }
        }
        if(ff) {
            flag_0 = 0;
            ff = false;
        }
    }
    rep(i, h) {
        rep(j, w) {
            cout << a[i][j];
            if(j != w-1) {
                cout << " ";
            }
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <cstdio>
#include <map>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <assert.h>
#include <string.h>

using namespace std;

typedef long long ll;

int A, B;
char S[15];
int main() {
  scanf("%d %d", &A, &B);
  scanf("%s", S);
  int N = strlen(S);
  bool valid = N == A + B + 1;
  for (int i = 0; valid && i < N; i++) {
    if (i == A) {
      valid = valid && (S[i] == '-');
    } else {
      valid = valid && S[i] >= '0' && S[i] <= '9';
    }
  }
  if (valid) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define Endl '\n'
typedef long long int lli;
/*
created on: 19/4/2020
*/
void solve();
lli ans;
int main(int argc, char const *argv[]){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
void solve(){
  long double R;
  cin>>R;
  cout<<2*3.14159*R<<Endl;
}


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

//解説放送見て回答

int main(){
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
    }

    for(int i = 0; i < n; i++){
        if(n <= k + (k - 1) * (i - 1)){
            put(i);
            return 0;
        }
    }
}

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


int main(){
  long long n;
  int ans;
  cin >> n;

  for(long long a=1;a*a<=n;a++){
    if(n%a==0){
      ans = n/a;
    }

  }

  cout << to_string(ans).size() <<endl;

}

Measured memory_bytes: 256
# coding: utf-8

N = int(input())
cuisine = list(map(int, input().split()))
satis = list(map(int, input().split()))
bonus = list(map(int, input().split()))

sum = 0;

for i in range(N):
    sum += satis[i]
    num = cuisine[i]
    try:
        if(cuisine[i+1]==num+1):
            sum+=bonus[num-1]
    except:
        pass

print(sum)

Measured memory_bytes: 38256
while True:
  H,W = list(map(int,input().split()))
  if (H,W) == (0,0):
    break
  x,y = (0,0)
  log = [(x,y)]
  # floor[y][x] == floor[H][W]
  floor = [list(input()) for i in range(H)]

  while True:
    if floor[y][x] == ".":
      print(x,y)
      break
    elif floor[y][x] == ">":
      log.append((x,y))
      x += 1
    elif floor[y][x] == "<":
      log.append((x,y))
      x -= 1
    elif floor[y][x] == "^":
      log.append((x,y))
      y -= 1
    elif floor[y][x] == "v":
      log.append((x,y))
      y += 1
    #
    if (x,y) in log:
      print("LOOP")
      break

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

int main() {
    int a, b, c, cnt = 0;
    cin >> a >> b >> c;

    if (a == 7) cnt++;
    if (b == 7) cnt++;
    if (c == 7) cnt++;

    if (cnt == 1) cout << "YES" << endl;
    else cout << "NO" << endl;

    return 0;
}

Measured memory_bytes: 256
import math
import sys
input = sys.stdin.readline


def main():
    sc = Scan()
    l, r = sc.intarr()
    if r - l >= 2019:
        print('0')
        exit()
    minimum = 2019
    for i in range(l, r):
        for j in range(i+1, r+1):
            num = (i*j) % 2019
            if num < minimum:
                minimum = num
                if minimum == 0:
                    print('0')
                    exit()
    print(minimum)


class Scan():

    def intarr(self):
        line = input()
        array = line.split(' ')
        num_array = [int(n) for n in array]
        return num_array

    def strarr(self):
        line = input()
        array = line.split(' ')
        array[-1] = array[-1].strip('\n')
        return array


main()


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

using namespace std;

#define INF 1000000000
#define INFLL 0x3f3f3f3f3f3f3f3fLL 
#define EPS 10e-9
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define st first
#define nd second
#define sz(v) int(v.size())
#define all(X) (X).begin(), (X).end()
#define FOR(I, A, B) for(int I = A; I < B; I++)
#define RFOR(I, A, B) for(int I = A; I >= B; I--)

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef vector<iii> viii;
typedef vector<ll> vll;

int n;
long double PD[305][305][305];
long double prob[305][305][305] = {0};
bool visited[305][305][305] = {false};

long double pd(int q1, int q2, int q3){
	if(q1 == 0 && q2 == 0 && q3 == 0){
		return 0;
	}
	int q0 = n - (q1 + q2 + q3);
	int sum = q1 + q2 + q3;
	long double &ans = PD[q1][q2][q3];
	if(visited[q1][q2][q3]){
		return ans;
	}
	ans = 0;
	if(q1 > 0){
		long double p = (long double)q1/sum;
		ans += ((long double)q1/n)*(pd(q1-1, q2, q3));
	}
	if(q2 > 0){
		long double p = (long double)q1/sum;
		ans += ((long double)q2/n)*(pd(q1+1, q2-1, q3));
	}
	if(q3 > 0){
		long double p = (long double)q1/sum;
		ans += ((long double)q3/n)*(pd(q1, q2+1, q3-1));
	}
	ans += 1;
	if(q0 > 0){
		long double p = (long double)q0/n;
		ans /= (1.0-p);
	}
	visited[q1][q2][q3] = true;
	return ans;
}

int main(){
	scanf("%d", &n);
	int a[305];
	int n1, n2, n3;
	n1 = n2 = n3 = 0;
	FOR(i, 0, n){
		int aux;
		scanf("%d", &aux);
		if(aux == 1) n1++;
		if(aux == 2) n2++;
		if(aux == 3) n3++;
	}
	prob[n1][n2][n3] = 1;

	printf("%.10Lf\n", pd(n1, n2, n3));

	return 0;
}

Measured memory_bytes: 469248
#include <bits/stdc++.h>
using namespace std;
int main () {
    string S;
    cin >> S;
    int a, c;
    a = c = 0;
    bool f = 1;
    for (int i = 0; i < S.length(); i++) {
        if (S[i] >= 'a' && S[i] <= 'z') {

        }
        else {
            if (S[i] == 'A') {
                if (i == 0) {
                    a++;
                }
                else {
                    f = 0;
                }
            }
            else if (S[i] == 'C') {
                if (i >= 2 && i <= S.length()-2) {
                    c++;
                }
                else {
                    f = 0;
                }
            }
            else {
                f = 0;
            }
        }
    }
    if (f && a == 1 && c == 1) {
        puts("AC");
    }
    else {
        puts("WA");
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 101010101000;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

int main(){
  int n;
  cin>>n;
  vector<ll> a(n);
  rep(i,n) cin>>a[i];
  int x=1;
  rep(i,n){
    if(a[i]==x) x++;
  }
  if(x>1) cout<<n-(x-1);
  else cout<<-1;
}


Measured memory_bytes: 4812
#include <bits/stdc++.h>
using namespace std;
#define ft              first
#define sd              second
#define ll  		long long
#define pb              push_back
#define mkp           make_pair
#define pll             pair<ll,ll>
#define vll             vector<int>
#define mll             map<ll,ll>
#define pqg             priority_queue<ll>
#define pqs             priority_queue<ll,vll,greater<ll>>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod          1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define MAXN   10000001
void online_judge()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
#endif
}

void ISO()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}


int main() {

	ISO();
	//online_judge();

	string s;
	cin >> s;
	ll sum = 0;
	for(auto x : s)
	{
		sum += (ll)(x - 48);
	}
	if(sum % 9 == 0)
	{
		cout <<"Yes\n";
	}
	else
	{
		cout <<"No\n";
	}


	//cerr << "Time elapsed: " << clock() / 1000 << " ms" << endl;
	return 0;
}

Measured memory_bytes: 3728
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <iomanip>
#include <cassert>

using namespace std;
typedef long long ll;

int main(){
   int A,B;
   cin >> A >> B;
   cout << ((B-1)+(A-1-1))/(A-1) << endl;
   return 0;
}


Measured memory_bytes: 3624
#C
import copy

n = int(input())
A = list()

for num in range(n):
    A.append(int(input()))
    
sorted_A = copy.copy(A)
sorted_A.sort()

for num in A:
    if num == sorted_A[-1]:
        print(sorted_A[-2])
    else:
        print(sorted_A[-1])

Measured memory_bytes: 14560
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i = x; i < n; i++)
#define MAX 100
#define INF 1000000001

int n;
vector<int> adj[114514];
int d[2][114514];

// char X[100][100];
// int dp[1000000001];

void dfs(int peek, int current, int depth, int w) {
    // int i;
    
    d[w][peek] = depth;
    
    REP(i,0,adj[peek].size()) {
        if (adj[peek][i] == current) continue;
        
        dfs(adj[peek][i],peek,depth+1,w);
    }
}

bool processed[2][114514];

void bfs(int s,int w) {
    queue<int> q;
    q.push(s);
    // int dist = 0;
    d[w][s] = 0;
    
    // processed[w][s] = true;
    
    while(!q.empty()) {
        int a = q.front(); q.pop();
        if (processed[w][a]) continue;
        processed[w][a] = true;
        for (auto u: adj[a]) {
            
            
            d[w][u] = d[w][a] + 1;
            q.push(u);
  
        }
        
        // dist++;
    }
}

int main(void){
    cin >> n;
    REP(i,0,n-1) {
        int a,b;
        cin >> a >> b;
        
        a--; 
        b--;
        
        // cout << a << b << endl;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    
    
    REP(i,0,n-1) {
        d[0][i] = INF;
        d[1][i] = INF;
    }
    
    bfs(0,0);
    bfs(n-1,1);


    int c1 = 0;
    int c2 = 0;
    for (int i = 0; i < n; i++) {
        if (d[0][i] <= d[1][i]) {
            c1++;
        } else {
            c2++;
        }
    }
    
    if (c1 > c2) {
        puts("Fennec");
    } else {
        puts("Snuke");
    }
    
    return 0;

}

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

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


Measured memory_bytes: 3708
using System;
using System.Collections.Generic;//list用
using System.Text;//StringBuilder用
using System.Collections;//ハッシュテーブル用
using System.Linq;

class Program
{
    //Hashtable ht = new Hashtable();
    static List<int> s = new List<int>();
    static List<int>[] sl;
    static double result;
    static int N,K;
    //StringBuilder strresult= new StringBuilder("");//Append(str ○○)関数で文字を追加していく



    static void Main()
    {
        //Modular mo = new Modular(0);//素数で割った余りを出せで使う。()内が初期値。★使い方：Modular型で宣言すると、その時点でのその素数で割った余りを保持する変数になる（powべき乗、Fac累乗、nCr組み合わせも関数として存在）
        //Node<> no = new Node<>();//UnionFind★Find関数で根っこの値を返す（根っこの値が一緒なら同グループ）、Unite関数で二つの木をくっつける
        //Permutation<> pe = new Permutation<>();//配列＆リストを並べ替えた場合の全ケースを出力★All関数でリスト形式で返す。
        //Treap<> tr = new Treap<>();//平衡二分木★Insert()関数で挿入、FindIndex()関数で該当する大きさの物が入るべき配列番号を返す。
        //PriorityQueue<int,int> pr = new PriorityQueue<int,int>();//優先度付キュー★Add(key,value)で格納、Dequeue()で取りだし。keyが小さいものから取り出す。
Read1();
      int a=0;
      for(int i=0;i<N;i++){
      if(i%2==0){a++;}
      }
      result=(double)a/N;
        

        Console.WriteLine(result.ToString());
    }


    static void Read1()//1項
    {
        string tmp = Console.ReadLine();
        N = int.Parse(tmp);
    }

    static void Read2()//複数項（項目数Ｎ）
    {
        string[] tmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < N; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read3()//1行複数項
    {
        string[] tmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < tmp.Length; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read4()//NK１行
    {
        string[] tmp = Console.ReadLine().Split(' ');
        N = int.Parse(tmp[0]);
        K = int.Parse(tmp[1]);
    }
    static void Read5()//N行K項
    {
        sl = new List<int>[N];
        for (int i = 0; i < N; i++) {
            sl[i] = new List<int>();
            string[] tmp = Console.ReadLine().Split(' ');
            for (int j = 0; j < K; j++) {
                sl[i].Add(int.Parse(tmp[j]));
            }
        }

    }
}

Measured memory_bytes: 11092
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
public class Main {
	public static void main(String[] args)throws IOException {
		FastReader sc = new FastReader();
		PrintWriter pw = new PrintWriter(System.out);
		int x = sc.nextInt();
		int count = 0;
		int tmp = x;
		x = 0;
		while (x != 360) {
			x = x + tmp;
			if (x > 360) {
				x = x - 360;
			}
			//System.out.println(x);
			count++;
		}
		System.out.println(count);





	}
}





class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new
		                        InputStreamReader(System.in));
	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException  e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

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

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return str;
	}
}

Measured memory_bytes: 32652
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
const double PI  = 3.1415926535897932384626433832795028841971;
const int    INF = 100000000;
const double EPS = 1e-10;
const int    MOD = 1000000007;
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
string s[50], ss[50];

void solve(){
	rep(i,n){
		ss[i] = "";
		cin >> s[i];
		rep(j,s[i].size()){
			if(j == 0){
				ss[i].push_back(s[i][j]);
				continue;
			}
			if(s[i][j-1]=='a'||s[i][j-1]=='i'||s[i][j-1]=='u'||s[i][j-1]=='e'||s[i][j-1]=='o'){
				ss[i].push_back(s[i][j]);
			}
		}
	}
	int ans = 0;
	sort(ss,ss+n);
	for(int i = 1; i < n; i++) if(ss[i] == ss[i-1]){
		cout << -1 << endl;
		return;
	}
	for(int i = 1; i < n; i++){
		int cnt = 0;
		for(int j = 0; j < ss[i].size(); j++){
			if(ss[i][j] != ss[i-1][j]) break;
			cnt++;
		}
		ans = max(ans,cnt);
	}
	cout << ans+1 << endl;
}

int main(){
	while(cin >> n){
		if(n == 0) break;
		solve();
	}
}

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

typedef long long LL;

int main()
{
	LL a,b,c;
	scanf("%lld %lld.%lld",&a,&b,&c);
	a*=(b*100+c);
	printf("%lld\n",a/100);
	return 0;
}

Measured memory_bytes: 3808
X = int(input())
A = [400, 600, 800, 1000, 1200, 1400, 1600, 1800]
B = [8, 7, 6, 5, 4, 3, 2, 1]
if X < A[1]:
    print(B[0])
elif X < A[2]:
    print(B[1])
elif X < A[3]:
    print(B[2])
elif X < A[4]:
    print(B[3])
elif X < A[5]:
    print(B[4])
elif X < A[6]:
    print(B[5])
elif X < A[7]:
    print(B[6])
else:
    print(B[7])


Measured memory_bytes: 9208
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (int i=0;i<N;i++)

//変数
string a[3];

//解法
void solve() {

	cout << a[0][0] << a[1][1] << a[2][2];

	return;
}

int main() {
	//入力
	cin >> a[0] >> a[1] >> a[2];
	solve();
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n, d int
	fmt.Scanf("%d", &n)
	slice := []int{}
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &d)
		slice = append(slice, d)
	}

	total := 0
	fm := 0
	l := len(slice) - 1
	for i := 0; i < l; i++ {
		t1 := slice[i] + fm
		t2 := slice[i+1]
		if t1 > t2 {
			fm = t1 - t2
			total = total + fm
		} else {
			fm = 0
		}
	}
	fmt.Println(total)

}


Measured memory_bytes: 9900
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) > (b) ? (b) : (a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;

#define INF INT_MAX/3
#define MAX_N 1000
ll a,b,c;
void solve(){
   cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>a>>b>>c;
  if(a+b>=c) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
int main(){
  solve();
  return 0;
}


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

int main(){
  int n,m;
  cin>>n>>m;
  vector<int> a(n);
  rep(i,n)cin>>a[i];
  int s1=0;
  rep(i,n)s1+=a[i];
  int c1=0;
  rep(i,n)if(a[i]*4*m>=s1)c1++;
  rep(i,n)if(a[i]*4*m>=s1&&c1>=m){
      cout<<"Yes";
      return 0;
  }
  cout<<"No";
  return 0;
}

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

int main () {
  string s,t;
  int a,b;
  cin>>s>>t;
  cin >>a>>b;
  string cho;
  cin>>cho;
  if (cho == s){
    a =a-1;
  }else if(cho ==t){
    b=b-1;
  }
  cout << a <<" " <<b<<endl;

}


Measured memory_bytes: 256
package main

import(
  "fmt"
)

func main(){
  var n int
  var d int
  fmt.Scan( &n )
  array := make( []int , 0 , n )
  for i := 0 ; i < n ; i++ {
    fmt.Scan(&d)
    array = append( array , d)
  }

  endFlg := false
  count := 0
  for {
    for i := 0 ; i < n ; i++ {
        check := array[i]
        if check % 2 == 0 {
          array[i] = check / 2
        }else{
          endFlg = true
          break
        }
    }

    if endFlg {
      break
    }else{
      count++
    }
  }

  fmt.Print(count)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template < typename T > using oset = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
// find_by_order(k) (k+1)th largest element
// order_of_key(k) no of elements <=k

typedef long long ll;
typedef long double ld;
#define endl '\n'
#define rep(i,n)  for(ll i = 0; i < (n); ++i)
#define repA(i, a, n)  for(ll i = a; i <= (n); ++i)
#define repD(i, a, n)  for(ll i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define ff first
#define ss second
#define pb push_back
typedef vector<ll> vll;
typedef vector<pair<ll,ll>> vpl;
const ld PI = 4*atan((ld)1);
const ll INF = LLONG_MAX;
const ll mod = 1e9+7;

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    ll tt=1;
        // cin >> tt;
    repA(qq,1,tt){
        ll n; cin >> n;
        vll a(n),suf(n);
        rep(i,n){
            cin >> a[i];
        }
        suf[n-1] = a[n-1];
        repD(i,n-2,0){
            suf[i] = suf[i+1]+a[i];
        }
        ll ans =0;
        rep(i,n-1){
            // cout << a[i] << " " << suf[i] << endl;
            ans += a[i]*(suf[i+1]%mod);
            ans %=mod;
        }

        cout << ans << endl;
    }
}


Measured memory_bytes: 6348
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
using namespace std;
ll power(ll a,ll n)
{
          ll result=1;
          while(n>0)
          {
               if(n&1)
                    result=result*a;
               a=a*a;
               n=n>>1;
          }
          return result;
}
ll lcm(ll a,ll b)
{
          return ((a*b)/__gcd(a,b));
}
bool ispow2(ll n)
{
          return (ceil(log2(n))==floor(log2(n)));
}
bool isprime(ll n)
{
          if(n==1)
               return false;
          else if(n==2)
               return true;
          else
          {
               for(ll i=2;i*i<=n;++i)
               {
                    if(n%i==0)
                         return false;
               }
               return true;
          }
}

ll ncr(ll n,ll r)
{
    if(r > n - r)
          r = n - r;
    ll ans = 1;
    ll i;

    for(i = 1; i <= r; i++)
     {
        ans *= n - r + i;
        ans /= i;
    }

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

          int t=1;
          //cin>>t;
          while(t--)
          {
                         int n;
                         cin>>n;
                         if(n>=400 && n<=599)
                              cout<<8;
                         else if(n>=600 && n<=799)
                              cout<<7;
                         else if(n>=800 && n<=999)
                              cout<<6;
                         else if(n>=1000 && n<=1199)
                              cout<<5;
                         else if(n>=1200 && n<=1399)
                              cout<<4;
                         else if(n>=1400 && n<=1599)
                              cout<<3;
                         else if(n>=1600 && n<=1799)
                              cout<<2;
                         else if(n>=1800 && n<=1999)
                              cout<<1;
          }

          return 0;
}


Measured memory_bytes: 3692
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define F first
#define S second

using namespace std;
typedef pair<int,int> P;

const int MOD=1000000007;
int INF=100100100100100;

signed main(){
  int w,a[2];
  cin>>w>>a[0]>>a[1];
  sort(a,a+2);
  cout<<max((int)0,a[1]-a[0]-w)<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using  namespace  std;
int  main (){
int  d[10];
for(int  i = 1;  i<= 4;  i++)d[i] = 0;
for(int  i = 0;  i<6;  i++){
int  z;
scanf("%d" , &z );
d[z]++;
}
if(d[1]<= 2 && d[2]<= 2 && d[3]<= 2 && d[4]<= 2) printf("YES\n");
else printf("NO\n" );
}

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

namespace test01
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = U.GetLineLongParse();
            var N = line[0]; // 店の数
            var M = line[1]; // 栄養ドリンクの本数

            List<MiseInfo> miseInfos = new List<MiseInfo>();
            for (int i = 0; i < N; i++)
            {
                var line2 = U.GetLineLongParse();
                miseInfos.Add(new MiseInfo() { price = line2[0], cnt = line2[1] });
            }

            long ans = 0;
            long c = M;
            miseInfos = miseInfos.OrderBy(e => e.price).ToList();
            foreach (var miseInfo in miseInfos)
            {
                var price = miseInfo.price;
                var cnt = miseInfo.cnt;
                if (cnt == c)
                {
                    ans = ans + price * cnt;
                    break;
                }
                else if (cnt < c)
                {
                    ans = ans + price * cnt;
                    c = c - cnt;
                }
                else
                {
                    ans = ans + price * c;
                    c = c - cnt;
                }

                if (c <= 0) { break; }
            }

            Console.WriteLine(ans);
            
        }

        class MiseInfo
        {
            public long price { get; set; }
            public long cnt { get; set; }
        }

        class U
        {
            public static string GetLine() { return Console.ReadLine(); }

            public static List<int> GetLineIntParse() { return Console.ReadLine().Split().Select(e => int.Parse(e)).ToList(); }

            public static List<long> GetLineLongParse() { return Console.ReadLine().Split().Select(e => long.Parse(e)).ToList(); }
        }
    }
}


Measured memory_bytes: 28212
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) FOR(i,0,n)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define vint vector<int>
#define vdouble vector<double>
#define vstring vector<string>
using namespace std;

#include<map>
#include<set>
#include<queue>

typedef long long ll;
typedef unsigned long long ull;

const int MAX_N = 1000000;
// const int INFTY = (1 << 21); // 2097152
const ll INFTY = (1LL << 60);

class Edge{
public:
	int from, to; ll cost;
	Edge(int from = 0, int to = 0, ll cost = 0) :
			from(from), to(to), cost(cost){}

	bool operator < (const Edge &e) const{
		return cost < e.cost;
	}
	bool operator >(const Edge &e) const{
		return cost > e.cost;
	}

};

class Node{
public:
	vector<Edge> edges;
    ll dist;

	Node(){
		dist = INFTY;
	}
};

class Graph{
public:
	vector<Node> nodes;
	Graph(int n) {
		rep(i, n) { Node n;  nodes.push_back(n); }
	}
	Node& operator[](int i){
		return nodes[i];
	}
};

class Data{

public:
    ll dist;
	Edge *edge;
	Data(ll dist, Edge *edge) {
		this->dist = dist;
		this->edge = edge;
	}

	bool operator < (const Data &d) const{
		return dist < d.dist;
	}
	bool operator >(const Data &d) const{
		return dist > d.dist;
	}
};

Graph G(0);
int N, E;

ll prim(){

    priority_queue<Data, vector<Data>, greater<Data>> pq;
    Edge e0 = Edge(-1, 0, 0);
    Data d0 = Data(0, &e0);
    pq.push(d0);

    while(!pq.empty()){
        Data d = pq.top(); pq.pop();
        Edge &e = *d.edge;
        Node &n = G[e.to];
        if(n.dist != INFTY) continue;
        n.dist = e.cost;
        // cerr << n.dist << endl;

        for(auto &ee: n.edges){
            pq.push(Data(ee.cost, &ee));
        }
    }

    ll ret = 0;
    rep(i, N) ret += G[i].dist;
    return ret;
}

int main() {
	cin >> N >> E;
	G = Graph(N);

    rep(i, E){
        int from, to;
        ll dist;
        cin >> from >> to >> dist;
        G[from].edges.push_back(Edge(from, to, dist));
        G[to].edges.push_back(Edge(to, from, dist));
    }

	cout << prim() << endl;
}

Measured memory_bytes: 12420
import java.util.*;
import java.io.*;

public class Main {
	static FastReader f = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);
	

	public static void main(String[] args) {
		//int t = f.nextInt();
		//while(t-- > 0)
			solve();
		out.close();
	}

	static void solve() {
		String s = f.next();
		if(s.charAt(s.length()-1) == 's') {
			out.println(s+"es");
		} else {
			out.println(s+'s');
		}
	}

	static class FastReader {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st;

		String next() {
			while(st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch(IOException ioe) {
					ioe.printStackTrace();
				}
			}
			return st.nextToken();
		}

		String nextLine() {
			String s = "";
			try {
				s = br.readLine();
			} catch(IOException ioe) {
				ioe.printStackTrace();
			}

			return s;
		}

		int  nextInt() {
			return Integer.parseInt(next());
		}
	}
}

Measured memory_bytes: 36452
import java.util.*;

public class Main {
    public static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int p = sc.nextInt();
            
            if (n==0&&m==0&&p==0) break;
            
            int r = 0;
            int sum = 0;
            for (int i = 1; i <=n; i++) {
                int tmp = sc.nextInt();
                sum += tmp;
                if (i == m) {
                    r = tmp;
                }
            }
            
            if (r > 0) {
                sum *= (100-p);
                sum /= r;
                System.out.println(sum);
            } else {
                System.out.println(0);
            }
        }
    }
}

Measured memory_bytes: 37136
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		
		int n=Integer.parseInt(in.next()),q=Integer.parseInt(in.next());
		myqueue A[]=new myqueue[n];
		for(int i=0;i<n;i++)A[i]=new myqueue();
		
		for(int i=0;i<q;i++){
			int query=Integer.parseInt(in.next());
			
			switch(query){
			case 0:
				int t1=Integer.parseInt(in.next()),x=Integer.parseInt(in.next());
				A[t1].que.add(x);
				break;
				
			case 1:
				int t2=Integer.parseInt(in.next());
				if(!A[t2].que.isEmpty())out.println(A[t2].que.peek());
				break;
				
			case 2:
				int t3=Integer.parseInt(in.next());
				if(!A[t3].que.isEmpty())A[t3].que.remove();
				break;
			}
		}
		out.flush();
	}

}

class myqueue{
	Queue<Integer> que;
	
	myqueue(){
		que=new ArrayDeque<>();
	}
}



Measured memory_bytes: 109500
while True :
    n = int(input())
    if n == 0 :
        break
    
  
    L = [0] * n
    for i in range(n) :
        tmp = list(map(int, input().split()))
        for j in range(n) :
            L[j] += tmp[j]
        tmp.append(sum(tmp))
        for j in range(n+1) :
            print(str(tmp[j]).rjust(5), end = "")
        print()
    L.append(sum(L))
    for j in range(n+1) :
        print(str(L[j]).rjust(5), end = "")
    print()


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

namespace ABC109A
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            int[] ints = ConsoleInput.IntArray();
            int A = ints[0];
            int B = ints[1];
            if (A % 2 == 0 | B % 2 == 0)
            {
                Console.WriteLine("No");
                return;
            }
            Console.WriteLine("Yes");
        }
    }
    
    
    internal static class ConsoleInput
    {
        public static string String()
        {
            return Console.ReadLine();
        }

        public static int Int()
        {
            return int.Parse(Console.ReadLine());
        }

        public static int[] IntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        public static long Long()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] LongArray()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] DoubleArray()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }
    }
}

Measured memory_bytes: 13396
X, N = map(int, input().split(' '))
found = False
goal = 0
challenge_plus = X
challenge_minus = X
# そもそもNが0ならXが正解
# Xを基準に大きい方向、小さい方向の両方向へ1づつ数値をずらしていき、
# p_listにヒットしない整数が合ったときに正解となる。
# 同時に大小ヒットした場合は小さいほうが正解

if(N == 0):
  goal = X
  found = True
else:
  p_list = list(map(int, input().split(' ')))
  max_p = max(p_list)
  min_p = min(p_list)
  #print(X,N)
  #print(p_list)
  #print(max_p, min_p)
  
  if not(X in p_list):
    goal = X
    found = True
  else:
    for i in range(102):
      tmp_break = False
      challenge_plus += 1
      challenge_minus -= 1
      #print("比較対象は{0}, {1}".format(challenge_plus, challenge_minus))
      if not (challenge_plus in p_list):
        goal = challenge_plus
        found = True
        tmp_break = True
      
      if not(challenge_minus in p_list):
        goal = challenge_minus
        found = True
        break
        
      if(tmp_break):
        break

if(found):
  print(goal)
else:
  challenge_plus += 1
  challenge_minus -= 1
  #print("foundが最後までfalseだった例. {0}, {1}".format(challenge_plus, challenge_minus))
  #dist_plus = abs(challenge_plus - X)
  #dist_minus = abs(challenge_minus - X)
  if(dist_plus < dist_minus):
    print(challenge_plus)
  else:
    print(challenge_minus)

Measured memory_bytes: 9248
#define _GLIBCXX_DEBUG
#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,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> l_l;
typedef pair<int,int> i_i;
const ll MOD=1e9+7;
const int INF=1<<30;

ll gcd(ll a,ll b){
  if(a%b==0)
    return b;
  return gcd(b,a%b);
}

ll lcm(ll a,ll b){
  return a/gcd(a,b)*b;
}

int main(){
  cout << fixed << setprecision(15);
  ll N; cin >> N;
  ll M; cin >> M;
  vector<ll> v(N);
  ll x; cin >> x;
  ll sum=1;
  while(x%2==0){
    x/=2;
    sum=sum*2;
  }
  v[0]=x;
  for(int i=1;i<N;i++){
    double y;
    cin >> y;
    if((int)(y/sum)!=(y/sum)||(int)(y/sum)%2==0){
      cout << 0 << endl;
      return 0;
    }
    else{
      v[i]=(y/sum);
    }
  }
  ll LCM=1;
  rep(i,N){
    LCM=lcm(LCM,v[i]);
    if(LCM>M){
      cout << 0 << endl;
      return 0;
    }
  }
  ll LCM0=LCM*(sum/2);
  if(LCM0<=M){
    ll ans=(M-LCM0)/(LCM0*2)+1;
    cout << ans << endl;
  }
  else{
    cout << 0 << endl;
  }
  
} 

Measured memory_bytes: 1024
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N, X;
  cin >> N >> X;
  vector<ll> m(N);
  ll res = X;
  for (int i = 0; i < N; i++) {
    cin >> m[i];
    res -= m[i];
  }
  sort(m.begin(), m.end());
  ll ans = N + res / m[0];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
cards = readlines.map(&:split)
  cards.shift

  picture = ["S","H","C","D"]
  number = [*1..13]

  for pic in picture
    newarray = []
    newarray = number - (cards.select{|sel| sel[0] == pic}.map{|a,b| b.to_i})
    if newarray.count > 0
      for put in newarray
        puts("#{pic} #{put}")
      end
    end
  end


Measured memory_bytes: 6864
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int clz(int x) { return 31 - __builtin_clz(x); }
int clz(ll x) { return 63 - __builtin_clzll(x); }
int ctz(int x) { return __builtin_ctz(x); }
int ctz(ll x) { return __builtin_ctzll(x); }

class compare {
public:
	bool operator()(tuple<ll, ll> a, tuple<ll, ll> b) {
		return (get<1>(a) > get<1>(b));
	}
};

double dp[2][3001];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	vd p(n);
	rep(i,n)cin>>p[i];
	dp[0][0]=1;
	bool pn=false;
	rep(i,n){
		pn=!pn;
		rep(j,3000)dp[pn][j]=0;
		rep(j,3000){
			if(dp[!pn][j]==0)continue;
			dp[pn][j+1]+=dp[!pn][j]*p[i];
			dp[pn][j]+=dp[!pn][j]*(1-p[i]);
		}
	}
	double ans=0;
	int mn=(n+1)/2;
	range(i,mn,n+1)ans+=dp[pn][i];
	fcout(11);
	cout<<ans<<endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

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

    int N;
    cin >> N;
    vector<int> b(N);
    vector<int> ans;
    for (int i = 0; i < N; i++)
    {
        cin >> b[i];
    }

    for (int i = 0; i < N; i++)
    {
        for (int j = b.size() - 1; j >= 0; j--)
        {
            if (b[j] == j + 1)
            {
                ans.push_back(b[j]);
                b.erase(b.begin() + j);
                break;
            }
        }
    }

    if (b.size() == 0)
    {
        for (int i = ans.size() - 1; i >= 0; i--)
        {
            cout << ans[i] << endl;
        }
    }
    else
    {
        cout << -1 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
N,W = map(int, input().split())
dp = [0 for i in range(W+1)]
for i in range(N):
	a,b = map(int,input().split())
	for j in range(b,W+1):
		x = a + dp[j-b]
		if x >= dp[j]:
			dp[j] = x

print(max(dp))



Measured memory_bytes: 5928
#include<bits/stdc++.h>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
typedef long long ll;
const int maxn=5e5+5;
using namespace std;
int q[maxn],p[maxn],k,i,j,n,inf,y,a[maxn],d[maxn];
int l[maxn],r[maxn],tree[maxn<<2],now;
struct ar{int x,y;};
bool operator <(ar a,ar b){
	return a.y==b.y?a.x<b.x:a.y<b.y;
}
set<ar>w;
inline int read(){
	int n=0;char c=getchar();
	for(;c<'0'||c>'9';c=getchar());
	for(;c>='0'&&c<='9';c=getchar()) n=n*10+c-48;
	return n;
}
void find(int k,int l,int r,int a,int b){
	if (now<=tree[k]) return;
	if (l==a&&r==b) {
		now=tree[k];
		return;
	}
	int m=(l+r)>>1;
	if (b<=m) find(k<<1,l,m,a,b);else
	if (a>m) find(k<<1|1,m+1,r,a,b);else
	find(k<<1,l,m,a,m),find(k<<1|1,m+1,r,m+1,b);
}
void ins(int k,int l,int r,int x){
	tree[k]=min(tree[k],y);
	if (l==r)return;
	int m=(l+r)>>1;
	if (x<=m) ins(k<<1,l,m,x);else
	ins(k<<1|1,m+1,r,x);
}
int main(){
	n=read(),k=read();
	fo(i,1,n) p[i]=read(),q[p[i]]=i;
	memset(tree,127/3,sizeof(tree));
	inf=tree[0];
	fd(i,n,1){
		int x=q[i];
		now=inf,find(1,1,n,max(1,x-k+1),x);
		if (now!=inf) l[x]=q[now],d[l[x]]++;
		now=inf,find(1,1,n,x,min(x+k-1,n));
		if (now!=inf) r[x]=q[now],d[r[x]]++;
		y=i,ins(1,1,n,x);
	}
	fo(i,1,n) w.insert((ar){i,d[i]});
	fo(i,1,n) {
		ar now=*w.begin();
		w.erase(w.begin());
		a[i]=now.x;
		if (i==n) continue;
		if (l[now.x]) {
			int x=l[now.x];
			w.erase(w.find((ar){x,d[x]}));
			d[x]--;
			w.insert((ar){x,d[x]});
		}
		if (r[now.x]) {
			int x=r[now.x];
			w.erase(w.find((ar){x,d[x]}));
			d[x]--;
			w.insert((ar){x,d[x]});
		}
	}
	fo(i,1,n) p[a[i]]=i;
	fo(i,1,n) printf("%d\n",p[i]);
}

Measured memory_bytes: 46592