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

using namespace std;

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

    int h;
    while (cin >> h, h)
    {
        vector<vector<int>> v(h, vector<int>(5));
        for (int i = 0; i < h; i++)
        {
            for (int j = 0; j < 5; j++)
            {
                cin >> v[i][j];
            }
        }
        int res = 0;
        while (true)
        {
            bool update = false;
            for (int i = 0; i < h; i++)
            {
                if (v[i][0] != 0 && v[i][0] == v[i][1] && v[i][1] == v[i][2] && v[i][2] == v[i][3] && v[i][3] == v[i][4])
                {
                    res += 5 * v[i][0];
                    v[i][0] = v[i][1] = v[i][2] = v[i][3] = v[i][4] = 0;
                    update = true;
                    continue;
                }
                if (v[i][0] != 0 && v[i][0] == v[i][1] && v[i][1] == v[i][2] && v[i][2] == v[i][3])
                {
                    res += 4 * v[i][0];
                    v[i][0] = v[i][1] = v[i][2] = v[i][3] = 0;
                    update = true;
                    continue;
                }
                if (v[i][1] != 0 && v[i][1] == v[i][2] && v[i][2] == v[i][3] && v[i][3] == v[i][4])
                {
                    res += 4 * v[i][1];
                    v[i][1] = v[i][2] = v[i][3] = v[i][4] = 0;
                    update = true;
                    continue;
                }
                if (v[i][0] != 0 && v[i][0] == v[i][1] && v[i][1] == v[i][2])
                {
                    res += 3 * v[i][0];
                    v[i][0] = v[i][1] = v[i][2] = 0;
                    update = true;
                    continue;
                }
                if (v[i][1] != 0 && v[i][1] == v[i][2] && v[i][2] == v[i][3])
                {
                    res += 3 * v[i][1];
                    v[i][1] = v[i][2] = v[i][3] = 0;
                    update = true;
                    continue;
                }
                if (v[i][2] != 0 && v[i][2] == v[i][3] && v[i][3] == v[i][4])
                {
                    res += 3 * v[i][2];
                    v[i][2] = v[i][3] = v[i][4] = 0;
                    update = true;
                    continue;
                }
            }
            if (!update)
                break;
            for (int i = h - 2; i >= 0; i--)
            {
                for (int j = 0; j < 5; j++)
                {
                    if (v[i][j] == 0 || v[i + 1][j] != 0)
                        continue;
                    int sx = i;
                    while (sx <= h - 2 && v[sx + 1][j] == 0)
                    {
                        swap(v[sx][j], v[sx + 1][j]);
                        sx++;
                    }
                }
            }
        }
        cout << res << endl;
    }
}



Measured memory_bytes: 3156
#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
  int n,m,i,lmax,rmin,l,r;
  cin >> n >> m;
  cin >> lmax >> rmin;
  for(i=1;i<m;i++){
    cin >> l >> r;
    lmax=max(lmax,l);
    rmin=min(rmin,r);
  }
  
  cout << max(rmin-lmax+1,0) << endl;
}

Measured memory_bytes: 3608
import java.util.Scanner;
public class Main{
 public static void main(String[] args) {
   Scanner kbd = new Scanner(System.in);
   String n=kbd.next();
   if(n.equals("hi")||n.equals("hihi")||n.equals("hihihi")||n.equals("hihihihi")||n.equals("hihihihihi"))
   {
     System.out.println("Yes");
   }else{
     System.out.println("No");
   }

}
}


Measured memory_bytes: 22740
// F - LCS
#include <bits/stdc++.h>
using namespace std;

int main(){
	string S,T; cin>>S>>T;
	int N = S.size(), M = T.size();
	S = "*" + S; T = "*" + T;

	vector<vector<int>> dp(N+1, vector<int>(M+1));
	for(int s=1; s<=N; s++)
		for(int t=1; t<=M; t++)
			dp[s][t] = max(max(dp[s][t-1], dp[s-1][t]), dp[s-1][t-1] + (S[s]==T[t]));

	string ans;
	while(N>0 && M>0){
		if(dp[N][M]==dp[N-1][M]) N--;
		else if(dp[N][M]==dp[N][M-1]) M--;
		else{
			ans = S[N] + ans;
			N--; M--;
		}
	}
	cout<< ans <<endl;
}

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

using ll = long long;
using vl = vector<ll>;
using vi = vector<int>;

#define rng(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(n) for(int _ = 0, __ = (int)n; _ < __; _++)
#define stp(i, a, b, c) for (int i = (a); i < (b); i += (c))
#define FOR(x, cont) for (auto &x: cont)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define eb emplace_back
#define SZ(x) (int)(x).size()
#define pq(T,COMP) priority_queue<T, vector<T>, COMP>
auto bet = [](const ll x, const ll y, const ll i) {
    return x <= i && i <= y;
};
using pii = pair<int,int>;
using vb = vector<bool>;

vi get_prime(int n) {
    vi minp(n+1);
    vi p;
    for (int i = 2; i <= n; i++) {
        if (!minp[i]) {
            minp[i] = i;
            p.pb(i);
        }
        FOR(x, p) {
            if (x <= minp[i] && x * i <= n)
                minp[x * i] = x;
        }
    }
    return p;
}

const int mod = 1e9 + 7;

void add_mod(ll &x, const ll &y) {
    x += y;
    if (x >= mod) x -= mod;
}
void sub_mod(ll &x, const ll &y) {
    x -= y;
    if (x < 0) x += mod;
}


// AGC028 F2 Reachable Cells
// 理解 tourist 代码 https://agc028.contest.atcoder.jp/submissions/3399770
// 貌似只是用滚动数组优化了空间？
// L[i][j][k]:从(i,j)能走到的第k行的最左端是列的编号（k >= i）
// R[i][j][k]:.....................右..................
// L[i][j][k]:初始值为n
// R[i][j][k]:初始值为0
// 需要注意的是：并不是L[i][j][k]和R[i][j][k]之间所有的非'#'点都是可以到达的。
const int N = 1505;
int L[2][N][N], R[2][N][N];
int row[N][N];
int up[N][N]; // up[i][j]:从(i,j)向下最远可以到达第几行？

int main() {
#ifdef LOCAL
    freopen("main.in", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, m;
    cin >> n >> m;
    int x = m / n;
    while (m % x) --x;
    cout << x << endl;


    return 0;
}

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

using namespace std;

void solve() {
  int64_t N, A, B;
  cin >> N >> A >> B;
  if (A > B) swap(A, B);
  auto diff = B - A;
  if (diff % 2 == 0) {
    cout << (diff / 2) << endl;
  } else {
    cout << (min(A - 1, N - B) + 1 + diff / 2) << endl;
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}


Measured memory_bytes: 256
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n , m = f()
    failtime = m * 1900 + (n-m)*100
    succedtime = n * 100

    print(failtime*2**m)

solve()


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std ;
using ll = long long ;

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

  vector<ll> a(n) ;
  for (int i = 0; i < n ; i++) {
    cin >> a.at(i) ;
  }

  ll ans = 0 ;
  for (int i = 1; i < n; i++) {
    if ( a.at(i-1) > a.at(i) ) {
      ans = ans + a.at(i-1) - a.at(i) ;
      a.at(i) = a.at(i-1) ;
    }
  }

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

Measured memory_bytes: 4840
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vi;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

const int N = 250000;
const int M = 500;
const int MOD = 1e9 + 7;
const int alpha = 26;
const double PI = acos(-1);
ll n, k;
ll ans = 0;
ll a[N];
ll b[N];

signed main()
{
    #ifdef ONLINE_JUDGE
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
    #endif // ONLINE_JUDGE
    cin >> n;
    for (int i = 1; i < n; i++) cin >> k, a[k]++;
    for (int i = 1; i <= n; i++) cout << a[i] << "\n";
}


Measured memory_bytes: 5164
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
#define mst(a,b) memset((a),(b),sizeof(a))
#define rush() int T;scanf("%d",&T);while(T--)

typedef long long  ll;
const int maxn = 105;
const ll mod = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;

int n,m;
int a[maxn];
char s[maxn];

int main()
{
    while(~scanf("%d",&n))
    {
        int x1=n/10;
        int x2=n%10;
        if(x1==9||x2==9) puts("Yes");
        else puts("No");
    }
}


Measured memory_bytes: 128
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

char str[1000005];

void solve()
{
    int n;
    scanf("%d%s", &n, str);
    int Q;
    scanf("%d", &Q);
    int q;
    for(q=0; q<Q; q++) {
        int K;
        scanf("%d", &K);
        ll cnt0=0, cnt1=0, cnt01=0;
        ll ans=0;
        int i;
        for(i=0; i<n; i++) {
            if(i-K>=0) {
                if(str[i-K]=='D') {
                    cnt0--;
                    cnt01-=cnt1;
                }
                if(str[i-K]=='M') {
                    cnt1--;
                }
            }

            if(str[i]=='C') {
                ans+=cnt01;
            }
            if(str[i]=='M') {
                cnt1++;
                cnt01+=cnt0;
            }
            if(str[i]=='D') {
                cnt0++;
            }
        }
        printf("%lld\n", ans);
    }
    
    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T; scanf("%d", &T);
    while(T--) {
        solve();
    }
#endif
    return 0;
}


Measured memory_bytes: 1152
#include <iostream>
using namespace std;
int main(void){
  int n,i,j,b,l[200],ans=0;
  cin >> n;
  for (i=0;i<n*2;i++) cin >> l[i];
  for (i=0;i<n*2-1;i++) for (j=i+1;j<n*2;j++){
    if (l[i]>l[j]){
      b=l[i];
      l[i]=l[j];
      l[j]=b;
    }
  }
  for (i=0;i<n;i++) ans+=l[i*2];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
def wczytaj_liste(): 
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(int(element))
    return ostateczna_lista

def wczytaj_rzeczywiste():
    wczytana_lista = input()
    lista_znakow = wczytana_lista.split()
    ostateczna_lista = []
    for element in lista_znakow:
        ostateczna_lista.append(float(element))
    return ostateczna_lista

def rzuc_grosza_wiedzminowi_migusiem():
    N = wczytaj_liste()[0]
    prawdopodopienstwa = wczytaj_rzeczywiste()
    przed_rzutem = [1.0]
    for moneta in prawdopodopienstwa: 
        po_rzucie = []
        for i in range(len(przed_rzutem)):
            if i > 0: 
                po_rzucie.append(przed_rzutem[i]*(1-moneta)+przed_rzutem[i-1]*(moneta))
            else:
                po_rzucie.append(przed_rzutem[0]*(1-moneta))
        po_rzucie.append(przed_rzutem[-1]*moneta)
        przed_rzutem = po_rzucie
    odp = sum(przed_rzutem[N//2+1:])
    print(odp)
    
rzuc_grosza_wiedzminowi_migusiem()

Measured memory_bytes: 41980
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static readonly long Mod = 1000000000 + 7;

        static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var ABCXY = Sarray();
            var A = ABCXY[0];
            var B = ABCXY[1];
            var C = ABCXY[2];
            var X = ABCXY[3];
            var Y = ABCXY[4];
            //Aピザ、Bピザのみ
            var ab = A * X + B * Y;
            //Cピザのみ
            var c = Max(X, Y) * 2 * C;
            //AピザをCピザで作る
            var acb = 2 * X * C + Max((Y - X) * B, 0);
            //BピザをCピザで作る
            var abc = Max((X - Y) * A, 0) + 2 * Y * C;

            WriteLine(Min(Min(Min(ab, c), acb), abc));

            //Out.Flush();
        }
    }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define vi vector<int>
#define vl vector<ll>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())

#define sz(x) ((int)(x).size())
#define in(x) int x;cin>>x
#define bit(n) (1<<(n))

#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;++i)
#define FORVEC(i, v) for(int i = 0;i < sz(v);++i)

template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

#define fil0(i,n) cout<<swet(n)<<setfill('0')<<i<<resetiosflags(ios_base::floatfield)
#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 possible(n) cout<<((n)?"possible":"impossible")<<endl
#define Possible(n) cout<<((n)?"Possible":"Impossible")<<endl


int main(){
    int a;
    cin>>a;
    if(a<1200)cout<<"ABC";
    else if(a<2800)cout<<"ARC";
    else cout<<"AGC";
    cout<<endl;
    return 0;
}

Measured memory_bytes: 768
//   ┏━━┓┏━━┓┏┓┏┓┏┳━┳┓┏━━┓┏━┳┓┏━━┓     ┏┳┓┏┳┓┏━┳━┓┏━━┓┏━┓
//   ┃┏┓┃┃━━┫┃┗┛┃┃┃┃┃┃┃┏┓┃┃┃┃┃┗┃┃┛     ┃┏┛┃┃┃┃┃┃┃┃┃┏┓┃┃╋┃
//   ┃┣┫┃┣━━┃┃┏┓┃┃┃┃┃┃┃┣┫┃┃┃┃┃┏┃┃┓     ┃┗┓┃┃┃┃┃┃┃┃┃┣┫┃┃┓┫
//   ┗┛┗┛┗━━┛┗┛┗┛┗━┻━┛┗┛┗┛┗┻━┛┗━━┛     ┗┻┛┗━┛┗┻━┻┛┗┛┗┛┗┻┛
#include "bits/stdc++.h" 
using namespace std; 
#define mod 1e9 + 7 
#define FOR(a, c)  for(int a = 0; a < c; a++) 
#define FORL(a, b, c) for(int a = b; a < c; a++) 
#define FORR(a, b, c) for(int a = b ; a > c; a--) 
typedef long long int ll; 
typedef vector<int> vi; 
typedef pair<int, int> pi; 
#define PB push_back 
#define POB pop_back 
#define MP make_pair 
int main() 
{ 
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  double d,t,s;
  cin>>d>>t>>s;
  double ti=d/s;
  if(ti<=t){
    cout<< "Yes";
  }
  else{
    cout<< "No";
  }
  return 0;
}
// By Ashwani Kumar, Indian Institute Of Technology(IIT), Guwahati.
//   ╔══╗╔══╗╔══╗     ╔══╗╔╦╗╔╦═╦╗╔══╗╔╗╔╗╔══╗╔══╗╔══╗
//   ╚║║╝╚║║╝╚╗╔╝     ║╔═╣║║║║║║║║║╔╗║║╚╝║║╔╗║╚╗╔╝╚║║╝
//   ╔║║╗╔║║╗─║║─     ║╚╗║║║║║║║║║║╠╣║║╔╗║║╠╣║─║║─╔║║╗
//   ╚══╝╚══╝─╚╝─     ╚══╝╚═╝╚═╩═╝╚╝╚╝╚╝╚╝╚╝╚╝─╚╝─╚══╝

Measured memory_bytes: 3732
n = int(input())
a = sorted([int(i) for i in input().split()])
max_a = max(a)
cnt_d = [0] * (max_a + 1)

for ai in a:
    for multi in range(ai, max_a + 1, ai):
        cnt_d[multi] += 1

cnt_nd = 0
for ai in a:
    if cnt_d[ai] == 1:
        cnt_nd += 1
print(cnt_nd)

Measured memory_bytes: 31952
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int k,n,a[200050],b[200050];
	scanf("%d%d",&k,&n);
	for(int i=0;i<n;i++)
	  scanf("%d",&a[i]);
	  int maxn=0;
	  for(int i=1;i<n;i++)
	  {
	    b[i]=a[i]-a[i-1];
	    
		maxn=max(maxn,b[i]);}
	maxn=max(maxn,a[0]+k-a[n-1]);
	//printf("%d",maxn);
	printf("%d",k-maxn);
	
	
	
	
	
 } 

Measured memory_bytes: 1024
let m = 1000000007
let ( +^ ) x y = (x + y) mod m
let ( *^ ) x y = (x * y) mod m

let rec power ( * ) e m n =
  if n <= 0 then e
  else power ( * ) (if n land 1 = 0 then e else m * e) (m * m) (n lsr 1)

let () = Scanf.scanf "%d\n" @@ fun n ->
  let cs = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun c -> c in
  Array.sort (fun c c' -> compare c' c) cs;
  Printf.printf "%d\n" @@
  ( *^ ) (power ( *^ ) 1 4 (n - 1)) @@
  Array.fold_left ( +^ ) 0 @@
  Array.init n @@ fun i -> (i + 2) *^ cs.(i)

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define dump(x) cerr << #x " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define endl '\n'

#ifdef _DEBUG27_
    //#define STRESS 1
#endif

typedef long long llong;

const int INF = 2e9 + 999;
const llong LINF = 2e18 + 999;

void inv(bool e);
template<typename T> T sign(T a);
template<typename T> void die(T &a);
template<typename T> void umax(T &a, T b);
template<typename T> void umin(T &a, T b);

bool brute, alter;
int cnt_tests = 1;

// Improving atcoter rating

// Code below

int n;
vector<llong> arr;
llong k;

void inp() {
    cin >> n >> k;
    arr.resize(n);
    for (auto &x: arr) {
        cin >> x;
    }
}

void solve() {
    if (n == 1) {
        cout << (arr[0] == k ? "POSSIBLE" : "IMPOSSIBLE");
        return;
    }
    llong g = arr[0];
    for (auto &x: arr) {
        g = __gcd(g, x);
    }
    for (auto &x: arr) {
        if (x >= k && (x % g == k % g)) {
            cout << "POSSIBLE";
            return;
        }
    }
    cout << "IMPOSSIBLE";
}

void stress() {

}

void naive() {

}

void run();
int main() {
    #ifdef _DEBUG27_
        if (1)
            freopen("input.txt", "r", stdin);
    #else
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        if (0) {
            freopen("palindrome.in", "r", stdin);
            freopen("palindrome.out", "w", stdout);
        }
    #endif
    srand(time(0));
    #ifdef STRESS
        brute = true;
    #else
        brute = false;
    #endif

    for (int i = 0; (i < cnt_tests); i++) {
        run();
    }
    cerr << endl << "Time: " << clock() / 1000.0 << " ms";
    return 0;
}

void run() {
    if (!brute) {
        inp();
    }
    else {
        stress();
    }
    solve();
    cout << endl;
}

template<typename T>
void die(T &a) {
    cout << a;
    exit(0);
}

template<typename T>
T sign(T a) {
    if (a == 0)
        return 0;
    if (a < 0)
        return -1;
    return 1;
}

template<typename T>
void umax(T &a, T b) {
    if (b > a)
        a = b;
}

template<typename T>
void umin(T &a, T b) {
    if (b < a)
        a = b;
}

void inv(bool e) {
    if (!e) {
        vector<int> a;
        a[-1] += 1;
    }
}

/** CLEARING BUFFER

    cout << VAL << flush;

    OR

    printf(VAL);
    fflush(stdout);
*/


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

    static int A;
    static int B;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        A = sc.nextInt();
        B = sc.nextInt();

        solve();
    }

    public static void solve() {

        if (A <= 8 && B <= 8) {
            System.out.println("Yay!");
        } else {
            System.out.println(":(");
        }
    }
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  vector<int> L(n+1, -1e9), R(n+1, -1e9);
  rep(i, n) L[i+1] = max(L[i], a[i]);
  repr(i, n) R[i] = max(R[i+1], a[i]);
  rep(i, n) {
    cout << max(L[i], R[i+1]) << '\n';
  }
}

Measured memory_bytes: 3968
#include <iostream>
#define UNVISITED -1
#define _ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(15);
using namespace std;

typedef long long int64;
typedef pair<int, int> ii;

int main(){ _
    int K;  cin >> K;
    int even = K / 2, odd = K - even;
    int ans = even * odd;
    cout << ans << endl;
  return 0;
}


Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
int a[N];
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int t=0;
	bool f=0;
	for(int i=n-1;i>0;i--){
		if(a[i-1] > a[i]){
			if(a[i-1] - a[i] == 1) a[i-1]=a[i-1]-1;
			else {
				f=1;
				break;
			}
		}
	}
	if(f==1) printf("No");
	else printf("Yes");
    return 0;
}

Measured memory_bytes: 640
#[allow(unused_imports)]
use proconio::{fastout, input, marker::Chars, marker::Usize1};

fn chmin<T>(a: &mut T, b: T)
where
    T: std::cmp::PartialOrd,
{
    if *a > b {
        *a = b;
    }
}

fn solve(s: Vec<Vec<char>>) -> Option<usize> {
    let mut buck = Vec::new();
    for s in s {
        let mut h = 0;
        let mut min = 0;
        for c in s {
            match c {
                '(' => {
                    h += 1;
                }
                ')' => {
                    h -= 1;
                }
                _ => unreachable!(),
            }
            chmin(&mut min, h);
        }
        let min = -min as usize;
        while buck.len() <= min {
            buck.push(Vec::new());
        }
        buck[min].push(h as usize);
    }
    let mut h = 0;
    for (i, b) in buck.into_iter().enumerate() {
        if i > h {
            return None;
        }
        for b in b {
            h += b;
        }
    }
    Some(h)
}

fn is_up(s: &Vec<char>) -> bool {
    s.iter().filter(|&&c| c == '(').count() >= s.iter().filter(|&&c| c == ')').count()
}

#[fastout]
fn main() {
    input! {
        n: usize,
        s: [Chars; n],
    }
    let up = s.iter().filter(|&s| is_up(s)).cloned().collect::<Vec<_>>();
    let down = s
        .iter()
        .filter(|&s| !is_up(s))
        .cloned()
        .map(|s| {
            s.into_iter()
                .rev()
                .map(|c| match c {
                    '(' => ')',
                    ')' => '(',
                    _ => unreachable!(),
                })
                .collect::<Vec<_>>()
        })
        .collect::<Vec<_>>();
    println!(
        "{}",
        match (solve(up), solve(down)) {
            (Some(u), Some(d)) if u == d => "Yes",
            _ => "No",
        }
    );
}


Measured memory_bytes: 113584
use proconio::input;


fn main() {
    input! {
        a: usize,
        b: usize,
        m: usize,
        va: [i32; a],
        vb: [i32; b],
        x: [[i32; 3]; m]
    }

    let mut ans = va.iter().min().unwrap()
                  + vb.iter().min().unwrap();

    for xi in x {
        let ai = xi[0] as usize;
        let bi = xi[1] as usize;
        let c  = xi[2];
        ans = std::cmp::min(ans, va[ai-1] + vb[bi-1] - c);
    }

    println!("{}", ans);
}


Measured memory_bytes: 11160
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;

int main(){
	
	ll n,k; cin>>n>>k;
	vector<ll> a(n);
	for(auto &i:a) cin>>i;
	if(k<100){
		while(k--){
			vector<ll> b(n);
			for(ll i=0; i<n; i++){
				ll c = i-a.at(i);
				c = max<ll>(c,0);
				ll d = i + a.at(i)+1;
				b.at(c)++;
				if(d<n) b.at(d)--;
			}
			ll now{};
			for(ll i=0; i<n; i++){
				now += b.at(i);
				a.at(i) = now;
			}
		}
		for(ll i=0; i<n-1; i++){
			cout << a.at(i) << ' ';
		}
		cout << a.back() << endl;
	}
	else{
		for(ll i=0; i<n; i++){
			cout << n << endl;
		}
	}
	
	
}

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

const int MAXN = 1e5 + 1;

int n;
int a[MAXN];
int sol;

int main(){

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

    sol -= n;

    cout << sol;

}

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


#define M 1000000007
#define pb push_back
#define mp make_pair
#define s second
#define f first
#define mod 998244353
#define sz(v) (int)(v).size()

#define pii pair<int, int>
#define vi vector<int>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(0)

ll add(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a+b)%M;
	return (p+M)%M;
}

ll mul(ll a,ll b)
{
	a%=M;
	b%=M;
	ll p = (a*b)%M;
	return (p+M)%M;
}


int main()
{
	fastio;
	ll n,k,val;
	cin>>n>>k;
	val = n%k;
	cout<<min(val,k-val)<<endl;
    return 0;
}





Measured memory_bytes: 3624
package main

import (
  "fmt"
)

func main() {
  var n int 
  fmt.Scan(&n)
  a := make([]float64, n)
  for i := 0; i < n; i++ {
    fmt.Scan(&a[i])
  }
  denom := 0.0
  for _, x := range a {denom += 1 / x}
  fmt.Println(1 / denom)
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll gcd(ll a, ll b){//greatest common divider 最大公約数を求める
  if(b==0) return a;
  return gcd(b, a%b);
}

int main() {
  ll A, B;
  cin >> A >> B;
  if(A > B){//A < B としたい
    ll tmp = A;
    A = B;
    B = tmp;
  }
  ll gcd_ll = gcd(A,B);
  //cout << max_common << endl;
  
  long ans = 1;//1が公約数で，かつ答えの一つなのは明らかなので，1個で初期化
  for(long i=2;i<=sqrt(gcd_ll); i++){//素数とか考えずに，割れるものを割っていく
    if(gcd_ll % i == 0) ans++;
    while(gcd_ll % i == 0){
      gcd_ll = gcd_ll / i;      
    }
    if(gcd_ll == 1) break;
  }
  
  if(gcd_ll != 1) ans++; //gcd_llが√gcd_llの約数を持っている場合は1足す
  
  cout << ans << endl;
}

Measured memory_bytes: 256
n, x = map(int, input().split())
M = [int(input()) for i in range(n)]

rest_powder = x - sum(M)

max_make = 0
min_powder = min(M)
while True:
    if max_make*min_powder < rest_powder:
        max_make += 1
    elif max_make*min_powder == rest_powder:
        break
    else:
        max_make -= 1
        break

print(n + max_make)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
string a,last;
int ans;
int main()
{
	cin>>a;
	last.push_back(a[0]);
	ans++;
	for (int i=1;i<(int)a.size();)
	{
		ans++;
		if (i==(int)a.size()-1)
		{
			if (a.substr(i,1)==last) ans--;
			break;
		}
		if (a.substr(i,1)==last) last=a.substr(i,2),i+=2;
		else last=a.substr(i,1),i++;
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 3816
#include<bits/stdc++.h>
#define LiangJiaJun main
#define ll long long
using namespace std;
int n,k;
int g[200004];
int w33ha(){
    memset(g,0,sizeof(g));
    for(int i=1;i<=n;i++)g[i%k]++;
    ll ans=0;
    for(int i=0;i<k;i++){
        int a=i,b=((k-i)%k+k)%k,c;
        c=((k-b)%k+k)%k;
        if((c+a)%k==0){
            ll delta=1LL*g[a]*g[b]*g[c];
            ans+=delta;
        }
    }
    printf("%lld\n",ans);
    return 0;
}
int LiangJiaJun(){
    while(scanf("%d%d",&n,&k)!=EOF)w33ha();
    return 0;
}


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

#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
 
template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); }
template<typename T> T pow(T a,T b, long long m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }

const int N=1e5+5;

int n;
int vis[N];
pair<int, int> a[N];
priority_queue<pair<int, int>, vector<pair<int, int> > > pq;
priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > > pq2;

int work1()
{
	int ans=0, cur=0;
	while(pq.size() && pq2.size())
	{	
		while(pq.size() && vis[pq.top().second])
		{
			pq.pop();
		}
		if(pq.size())
		{
			pair<int, int> p=pq.top();
			pq.pop();
			int mov=max(0LL, p.first-cur);
			ans+=mov;
			cur+=mov;
			vis[p.second]=1;
		}
		while(pq2.size() && vis[pq2.top().second])
		{
			pq2.pop();
		}
		if(pq2.size())
		{
			pair<int, int> p=pq2.top();
			pq2.pop();
			int mov=max(0LL, cur-p.first);
			ans+=mov;
			cur-=mov;
			vis[p.second]=1;
		}
	}
	ans+=abs(cur);
	return ans;
}

int work2()
{
	memset(vis, 0, sizeof(vis));
	int ans=0, cur=0;
	while(pq.size() && pq2.size())
	{	
		while(pq2.size() && vis[pq2.top().second])
		{
			pq2.pop();
		}
		if(pq2.size())
		{
			pair<int, int> p=pq2.top();
			pq2.pop();
			int mov=max(0LL, cur-p.first);
			ans+=mov;
			cur-=mov;
			vis[p.second]=1;
		}
		while(pq.size() && vis[pq.top().second])
		{
			pq.pop();
		}
		if(pq.size())
		{
			pair<int, int> p=pq.top();
			pq.pop();
			int mov=max(0LL, p.first-cur);
			ans+=mov;
			cur+=mov;
			vis[p.second]=1;
		}	
	}
	ans+=abs(cur);
	return ans;
}

int32_t main()
{
    IOS;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
    	cin>>a[i].first>>a[i].second;
    	pq.push({a[i].first, i});
    	pq2.push({a[i].second, i});
    }
  	int ans=work1();
  	for(int i=1;i<=n;i++)
  	{
  		pq.push({a[i].first, i});
    	pq2.push({a[i].second, i});
  	}
  	ans=max(ans, work2());
  	cout<<ans;
    return 0;
} 

Measured memory_bytes: 10340
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;

const LL Linf=0x3f3f3f3f3f3f3f3fll;

int n,a[511][511];
LL dp[511][511],ndp[511][511],prex[511][511],prey[511][511];

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(i!=j)scanf("%d",a[i]+j);
	
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)
	{
		prex[i][j]=prex[i][j-1]+a[i][j];
		prey[i][j]=prey[i-1][j]+a[i][j];
	}
	
	memset(dp,0x3f,sizeof(dp));dp[0][0]=0;
	for(int i=2;i<=n;i++)
	{
		memset(ndp,0x3f,sizeof(ndp));
		for(int j=0;j<i;j++)for(int k=0;k<i;k++)if(dp[j][k]!=Linf)
		{
			if(i==n+1)continue;
			ndp[i-1][j]=min(ndp[i-1][j],dp[j][k]+prex[i][j]);
			ndp[j][k]=min(ndp[j][k],dp[j][k]+prex[i][k]+prey[i][i]-prey[j][i]);
		}
		memcpy(dp,ndp,sizeof(dp));
	}
	LL ans=Linf;
	for(int i=0;i<=n;i++)for(int j=0;j<=n;j++)ans=min(ans,dp[i][j]);
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 9344
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7+1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n,m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/

ll a[200][200];

int main()
{
	while (1) {
		ll w, h, s, t;
		cin >> n >> w >> h;
		if (n == 0) {
			return 0;
		} else {
			memset(a, 0, sizeof(a));
			vp v;
			REP(i, n)
			{
				ll a, b;
				cin >> a >> b;
				v.push_back(make_pair(a, b));
			}
			cin >> s >> t;
			REP(i, n)
			{
				ll x, y;
				x = v[i].first;
				y = v[i].second;
				REP(j, s)
				{
					REP(l, t)
					{
						a[100 + y - l][100 + x - j]++;
					}
				}
			}
			ll ma = 0;
			REP(i, 100 - s)
			{
				REP(j, 100 - t)
				{
					ma = max(ma, a[100 + j][100 + i]);
				}
			}
			cout << ma << endl;
		}
	}
}

Measured memory_bytes: 3424
N, M = map(int, input().split(' '))
A = [int(a) for a in input().split(' ')]
S = sum(A)
thre = S / (4 * M)

cnt = 0
for a in A:
    if a >= thre:
        cnt += 1

if cnt >= M:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
#define MOD (1000000007ll)
#define l_ength size
#define EPS (1e-10)

int main(void){
	int n,i;
	ll a[225816],ans=0ll;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> a[i];
	}
	if(a[0]){
		cout << "-1" << endl;
		return 0;
	}
	for(i=1; i<n; ++i){
		if(a[i] - a[i-1] > 1){
			ans = -1ll;
			break;
		}else if(a[i] > a[i-1]){
			++ans;
		}else{
			ans += a[i];
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = (1e+9)+7;

ll inverse(ll x){
    ll inv = 1;
    ll ex = MOD - 2;
    while(ex != 0){
        if(ex % 2){
            inv = (x * inv) % MOD;
            ex -= 1;
        }
        x = (x * x) % MOD;
        ex /= 2;
    }
    return inv;
}

ll pro(ll x){
    ll v = 1;
    for(int i=2;i<=x;i++){
        v = (v * i) % MOD;
    }
    return v;
}

int main(){
    int x,y;
    cin >> x >> y;
    double dx = (x * 2 - y) / 3.0;
    double dy = (y * 2 - x) / 3.0;
    if(dx != int(dx) || dy != int(dy) || dx < 0 || dy < 0){
        cout << 0 << endl;
        return 0;
    }

    ll upper = dx+dy;
    ll inv = (inverse(pro(dx)) * inverse(pro(dy)))%MOD;    
    ll pp = pro(upper);

    cout << ((pp * inv)%MOD) << endl;
}


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

using namespace std;

int N, A, B;
string S;

int main(void)
{
	cin >> N >> A >> B;
	cin >> S;
	
	int pass = 0, passb = 0;
	for(int i = 0; i < S.size();i++){
		if(S[i] == 'c') goto NG;
		if(S[i] == 'a'){
			if(pass >= A+B) goto NG;
		}
		else{
			if(pass >= A+B || passb >= B) goto NG;
			passb++;
		}
		pass++;
		cout << "Yes" << endl;
		continue;
		
		NG: cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 896
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef vector<ll> vel;
typedef vector<str> ves;
#define REP(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
#define rep(i, b) REP(i, 0, b)
const ll mod = 1000000007;
const double pi = 3.14159265358979;

ll expo(ll a, ll b){
    ll ex = 1;
    rep(i, b){
        ex *= a;
    }
    return ex;
}

ll fact(ll a){
    ll fc = 1;
    REP(i, 1, a+1){
        fc *= i;
    }
    return fc;
}

int main() {
    ll n;
    cin >> n;
    vel a(n), b(n);
    rep(i, n) {
        cin >> a[i] >> b[i];
    }
    bool ans = false;
    rep(i, n - 2) {
        if (a[i] == b[i]) {
            if (a[i+1] == b[i+1]) {
                if (a[i+2] == b[i+2]) {
                    ans = true;
                    break;
                }
            }
        }
    }
    if (ans) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3620
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

bc.sort(reverse=True, key=lambda x: x[1])

li = []
l = 0
i = 0
while i < m and l < n:
    b, c = bc[i]
    li += [c] * b
    i += 1
    l += b

a += li
a.sort(reverse=True)
ans = sum(a[:n])
print(ans)


Measured memory_bytes: 36036
S = int(input())
if (S // 100 > 12 or S // 100 == 0) and (S % 100 > 12 or S % 100 == 0):
  print('NA')
elif (S // 100 > 12 or S // 100 == 0) and 1 <= S % 100 <= 12:
  print('YYMM')
elif 1 <= S // 100 <= 12 and (S % 100 > 12 or S % 100 == 0):
  print('MMYY')
else:
  print('AMBIGUOUS')


Measured memory_bytes: 3060
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 全ての点を読み込む
		int n = sc.nextInt();
		long[][] points = new long[n][2];
		for (int i = 0; i < n; i++) {
			points[i][0] = sc.nextInt();
			points[i][1] = sc.nextInt();
		}
		// xの値でソート
		Arrays.sort(points, new Comparator<long[]>(){
			@Override
			public int compare(long[] p1, long[] p2) {
				return Long.compare(p1[0], p2[0]);
			}
		});
		// 初期の最大値
		double l = Float.MAX_VALUE;
		long sq = Long.MAX_VALUE;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++){
				long[] p1 = points[i];
				long[] p2 = points[j];
				if (p2[0] - p1[0] > l) break;
				long dx = p2[0] - p1[0];
				long dy = p2[1] - p1[1];
				long sq_tmp = dx * dx + dy * dy;
				if (sq_tmp < sq) {
					sq = sq_tmp;
					l = Math.sqrt(sq);
				}
			}
		}
		System.out.println(sq);
	}
}



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

class Main{
	static int bn_search(int[] X, int a) {
		int high = X.length, low = 0;
		while(high - low > 1) {
			int mid = (high + low) / 2;
			if(X[mid] == a) return mid;
			if(X[mid] > a) high = mid;
			else low = mid;
		}
		if(X[low] == a) return low;
		return -1;
	}
	public static void main(String args[]){
		Scanner sc=new Scanner(System.in);
		int N = sc.nextInt();
		int[] X = new int[N];
		int[] sorted_X = new int[N];
		for(int i = 0; i < N; i++) {
			X[i] = sc.nextInt();
			sorted_X[i] = X[i];
		}
		Arrays.sort(sorted_X);

		for(int i = 0; i < N; i++){
			int index = bn_search(sorted_X, X[i]);
			if(N/2 > index) System.out.println(sorted_X[N / 2]);
			else System.out.println(sorted_X[N / 2 - 1]);
		}
	}
}

Measured memory_bytes: 91396
<?php
  $temp = trim(fgets(STDIN));
  $temp = str_replace(array("\r\n", "\r", "\n"), "", $temp);
  $array = explode(" ", $temp);
  $numOfBill = $array[0];
  $total = $array[1];
  $exist = false;
 
  for($i = 0; $i <= $numOfBill; $i++){
    for($j = 0; $j <= $numOfBill - $i; $j++){
      $cnt1 = $i;
      $target = $total - 10000 * $i;
      $cnt2 = $j;
      $target = $target - 5000 * $j;
      $cnt3 = $numOfBill - $i - $j;
      if($target - 1000 * $cnt3 == 0){
        $exist = true;
        break 2;
      }
    }
  }
  if($exist){
    echo $cnt1. " ". $cnt2. " ". $cnt3;
  } else {
    echo "-1 -1 -1";
  }
?>

Measured memory_bytes: 3828
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const Arr = (input.trim()).split("\n");
const N1 = Number(Arr[0]);
const arr1 = Arr[1].split(" ").map(Number);
const arr2 = Arr[3].split(" ").map(Number);

const binarySearch = (function(arr, N) {
  return (key) => {   
    let mid;
    let left = 0;
    let right = N;
    if (key < arr[0] || arr[N-1] < key) return 0;
    while (left < right) {
      mid = Math.floor((left + right) / 2);
      if (key < arr[mid]) right = mid;
      else if (key > arr[mid]) left = mid + 1;
      else return 1;
    }
    return 0;
  }
})(arr1, N1);

(function main() {
const summing = (a, b) => a + b;
console.log(arr2.map(binarySearch).reduce((a, b) => a + b, 0));
})();


Measured memory_bytes: 34964
#include <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;

const int N = 1e3 + 10;
char mp[N][N];
int ans[N][N];
queue<int> que;


int main() {
	memset(ans, 0x3f, sizeof(ans));
	int n, m;
	cin >> n >> m;
	for(int i = 1; i <= n;i ++) scanf("%s", mp[i] + 1);
	for(int i = 1; i <=n;i ++)
	for(int j = 1; j <=m; j ++) if(mp[i][j] == '#') {
		que.push(i * m + j);
		ans[i][j] = 0;
	}	
	while(! que.empty()) {
		int cur = que.front();
		que.pop();
		int x = (cur - 1) / m;
		int y = (cur - 1) % m + 1;
		for(int dx = -1; dx <= 1; dx ++)
			for(int dy = -1; dy <= 1; dy ++) {
				if(dx && dy) continue;
				if(dx == 0 && dy == 0) continue;
				int nx = x + dx;
				int ny = y + dy;
				if(mp[nx][ny] == '.') {
					mp[nx][ny] = '#';
					ans[nx][ny] = min(ans[nx][ny], ans[x][y] + 1);
					que.push(nx * m + ny);
				}
			}
	}

	int res = 0;
	for(int i = 1; i <= n; i ++)
		for(int j = 1; j <=m; j ++) res = max(res, ans[i][j]);
	cout << res << endl;
}


Measured memory_bytes: 9344
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt(), b = sc.nextInt();
    int area = a*b;
    int cir = (a+b)*2;
    System.out.println(area + " " + cir);
    }
}


Measured memory_bytes: 26180
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = (1e9)+7;


int mem[51][51][51][51],used[51][51][51][51];

ll dfs(int a,int t,int g,int c,vector<string>&A,int idx=0){

  if(a<0||t<0||g<0||c<0) return 0;
  if(idx==(int)A.size()) return !a&&!t&&!g&&!c;  
  if(used[a][t][g][c]++)return mem[a][t][g][c];

  int res = 0;  
  string &s = A[idx];
   for(int i=0;i<(int)s.size();i++){
    int na=a,nt=t,ng=g,nc=c;
    if(s[i] == 'A')na--;
    if(s[i] == 'T')nt--;
    if(s[i] == 'G')ng--;
    if(s[i] == 'C')nc--;
    res=(res+dfs(na,nt,ng,nc,A,idx+1))%mod;
  }
  return mem[a][t][g][c] = res;
}
  


string getString(string &a,int &j){
  string res;
  while(isalpha(a[j])) res+=a[j++];
  return res;
}

int main(){
  int a,t,g,c;
  cin>>a>>t>>g>>c;
  int n;
  cin>>n;
  cin.ignore();  
  vector<string> A(n);  
  for(int i=0;i<n;i++)getline(cin,A[i]);


  vector<string> DNA[50];
  map<string,int> Idx;
  for(int i=n-1;i>=0;i--){
    int j = 0;
    string &a = A[i],name=getString(a,j);
    Idx[name] = i;
    assert(a[j] == ':');
    j++;
    while(j<a.size()&&DNA[i].size()<=200){
      assert(a[j++] == ' ');
      if(a[j] == '[')DNA[i].push_back(getString(a,++j)),j++;
      else {
	vector<string> &v =DNA[Idx[getString(a,j)]];
	for(int k=0;k<v.size();k++)DNA[i].push_back(v[k]);
      }
    }
  }

  ll ans = 0;
  for(int i=0;i<n;i++){
    if(DNA[i].size()>200)continue;
    memset(used,0,sizeof(used));
    ans =(ans+dfs(a,t,g,c,DNA[i]))%mod;
  }
  cout<<ans<<endl;
  return 0;
}

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




int main() {
/*
long long int n;
cin>>n;
 for(int i=1;i<=n;i++){st.insert(i);}

for(int i=1;i<=n;i++){
    long long int o;
   cin>>c[i];


}


long long int q;
cin>>q;

for(int i=0;i<q;i++){

   long long int x,y,z;
   cin>>x;
   if(x==1){

    cin>>y>>z;

    counter[y]+=z;


    if(counter[y]>c[y]){

               long long int p=counter[y]-c[y];
               counter[y]=c[y];

             auto  it = st.find (y);
                st.erase (it);

              auto reham=it++;


        for(auto j=reham ;j!=st.end();j++){
                if(p==0)break;

        if(c[*j]-counter[*j]>p){counter[*j]+=p; p=0;}
        else if(c[*j]-counter[*j]<p){

            counter[*j]=c[*j];
            p-=c[*j];
            auto w=st.find(*j);
            st.erase(w);
        }
       else if(c[*j]==counter[*j]) {


            auto w=st.find(*j);
            st.erase(w);
            p=0;
        }


        }








            }

        }













else { long long int r;
            cin>>r;

cout<<counter[r]<<endl;
    }








}
*/


/*
vector<int>index;
int n;
cin>>n;
string str;
cin>>str;
int counter=0,maxi=0;
for(int i=0;i<str.size();i++){

   if(str[i]=='G')counter++;

   else {



   }



for(int i=0;i<str.size();i++){
    if(str[i]=='S') index.push_back(i);
}













	return 0;
}*/
#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main()

{
/*

vector<int>index;
int n;
cin>>n;
string s;
cin>>s;
int maxi=0;
int counter=0;
int GS=0;
for(int i=0;i<s.size();i++){

    if(s[i]=='G')GS++;

}
if(GS==0){cout<<0; return 0;}
if(GS==n){cout<<n; return 0;}


bool reham=true;
int S=0;
for(int i=0;i<s.size();i++){

    if(s[i]=='G') counter++;
    else if(s[i]=='S' && reham==true && counter>0) {counter++; index.push_back(i+1); reham=false;}
    else {


        counter=0;
        reham=true;


    }
maxi=max(counter,maxi);
}

reham=true;
counter=0;
int j=0;

for(int i=0;i<s.size();i++){
        if(j==)

    if(s[j]=='G') counter++;
    else if(s[j]=='S' && reham==true && counter>0) {counter++; reham=false;}
    else {


        counter=0;
        reham=true;


    }
maxi=max(counter,maxi);


}



if(maxi>GS)cout<<GS;
else cout<<maxi;
    return 0;
}



*/



/*


   int res=0;
int i=1;
int n;
cin>>n;
int digits=0;
bool reham=true;
while(n>0){

   if(n>=(pow(10,i)-1)) {
if(i>1)digits--;
       // n=n-((pow(10,i)-1)-res);
        digits+=(pow(10,i)-1)-res;

   }
   i+=2;

   res=(pow(10,i-1)-1);

 if(n<(pow(10,i)-1)) {break;}

}
//cout<<digits<<endl;

if(n<pow(10,i)-1 && n>pow(10,i-1)-1 &&i%2!=0){digits+=(n-(pow(10,i-1)-1)); }
cout<<digits;







}
*/

int n,m;
cin>>n>>m;
if(n==m){cout<<1; return 0;}
int sum=1,counter=0;
while(sum<m){
sum--;
        sum+=n;

      counter++;



}

cout<<counter;

}





Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;

using namespace std;

const long long MOD = 998244353;

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

	double l;
	cin >> l;
	cout << std::setprecision(10) << l * l * l / 27 << "\n";

	return 0;
 }


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define MM <<" "<<
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setpercision(x)
using ll=long long;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using pl=pair<ll,ll>;
template<class T> inline bool chmin(T& a, T b){
    if(a>b){a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b){
    if(a<b){a=b;return true;}return false;}
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};

int main(){
    ll N,M;cin>>N>>M;
    pl info[M];
    rep(i,M)cin>>info[i].se>>info[i].fi;
    sort(info,info+M);
    ll now=info[0].fi,count=1;
    for(int i=1;i<M;i++){
        if(info[i].se<now)continue;
        else{
            now=info[i].fi;
            count++;
        }
    }
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;

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

ll n,a[300000];

ll calc(ll m,ll s,ll t) {
    ll M = a[t - 1] - a[m - 1];
    ll ma = a[m - 1] - a[s - 1];
    return abs(M - ma);
}

ll bs(ll s,ll t) {
    ll l = s + 1,r = t;

    while(r - l > 1) {
        ll mid = (r + l) / 2;
        if(calc(mid + 1,s,t) - calc(mid,s,t) > 0) {
            r = mid;
        }else {
            l = mid;
        }
    }
    if(calc(r,s,t) < calc(l,s,t)) {
        //cout << "a" << endl;
        return r;
    }
    //cerr << calc(r,s,t) << " " << calc(l,s,t) << endl;
    return l;;
}

int main() {
    cin >> n;
    rep(i,n) cin >> a[i+1];

    rep(i,n)a[i+1] += a[i];

    ll ans = 100000000000000;
    for(int i = 3;i < n;i++) {
        ll c = bs(1,i);
        ll d = bs(i,n+1);

        cerr << c << " " << i << " " << d << endl;
        
        ll s[4];
        s[0] = a[c - 1] - a[0];
        s[1] = a[i-1] - a[c - 1];
        s[2] = a[d - 1] - a[i - 1];
        s[3] = a[n] - a[d - 1];

        ll maxi = 0;
        rep(i,4) {
            FOR(j,i+1,4) {
                maxi = max(maxi,abs(s[j] - s[i]));
            }
        }
        ans = min(maxi,ans);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n); for(int i = 0;i < (n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
long double pi = acos(-1);
const int INF = 1001001001;


// 最小公倍数を求める
int euqlid (int a, int b){
  int temp;
  temp = a % b;
  if(temp == 0)return b;
  return euqlid(b,temp);
}
ll conbination(ll a,ll b){
  ll u = 1;
  ll d = 1;
  while(b != 0){
    u *= a;
    d *= b;
    a--;
    b--;
  }
  return u / d;
}
int strtoint(char s){
  return (int(s-'0'));
}
int fact(int n){
  if(n == 1)return 1;
  return n * fact(n-1);
  }


int main(){
  string s;
  cin >> s;
  int ans = 0;
  rep(i,3){
    if(s[i] == '1')ans ++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256