akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<algorithm>
#include<cctype>
#include<cstring>
using namespace std;
#define G getchar()
int read()
{
	int x=0; char ch=G;
	for (;!isdigit(ch);ch=G);
	for (;isdigit(ch);ch=G) x=(x<<3)+(x<<1)+(ch^48);
	return x;
}
#undef G
typedef long long ll;
const int MAXW=100;
int Mod;
int qpow(int x,int y){
	int res=1;
	for (;y;y>>=1,x=1LL*x*x%Mod)
		if (y&1) res=1LL*res*x%Mod;
	return res;
}
int fac[110],ifac[110];

int n,m,K,nm;
int dp[2][110][110]; bool dpcur;
inline void add(int &x,ll y){x=(x+y)%Mod;}
int p[110][10010];
int trans[110][110];
int main()
{
	n=read(),m=read(),K=read(),Mod=read(); nm=n*m;
	fac[0]=1; for (int i=1;i<=MAXW;i++) fac[i]=1LL*fac[i-1]*i%Mod;
	ifac[MAXW]=qpow(fac[MAXW],Mod-2); for (int i=MAXW;i;i--) ifac[i-1]=1LL*ifac[i]*i%Mod;
	for (int i=0;i<=K;i++){
		p[i][0]=1;
		for (int j=1;j<=nm;j++) p[i][j]=1LL*p[i][j-1]*i%Mod;
	}
	dp[dpcur][0][0]=1;
	for (int k=1;k<=K;k++){
		dpcur^=1; memset(dp[dpcur],0,sizeof dp[dpcur]);
		for (int u=0;u<=n;u++)
			for (int j=0;j<=m;j++)
				trans[u][j]=1LL*ifac[u]*p[k][u*(m-j)]%Mod*p[K-k+1][u*j]%Mod;
		for (int i=0;i<=n;i++)
			for (int j=0;j<=m;j++)
				for (int u=0;i+u<=n;u++){
					add(dp[dpcur][i+u][j],1LL*dp[dpcur^1][i][j]*trans[u][j]);
				}
		dpcur^=1; memset(dp[dpcur],0,sizeof dp[dpcur]);
		for (int i=0;i<=n;i++)
			for (int v=0;v<=m;v++)
				trans[i][v]=1LL*ifac[v]*p[k][v*(n-i)]%Mod*p[K-k+1][v*i]%Mod;
		for (int i=0;i<=n;i++)
			for (int j=0;j<=m;j++)
				for (int v=0;j+v<=m;v++){
					add(dp[dpcur][i][j+v],1LL*dp[dpcur^1][i][j]*trans[i][v]);
				}
		dpcur^=1; memset(dp[dpcur],0,sizeof dp[dpcur]);
		for (int u=0;u<=n;u++)
			for (int j=0;j<=m;j++)
				trans[u][j]=1LL*ifac[u]*p[k][u*(m-j)]%Mod*p[K-k][u*j]%Mod;
		for (int i=0;i<=n;i++)
			for (int j=0;j<=m;j++){
				for (int u=0;i+u<=n;u+=2){
					add(dp[dpcur][i+u][j],1LL*dp[dpcur^1][i][j]*trans[u][j]);
				}
				for (int u=1;i+u<=n;u+=2){
					add(dp[dpcur][i+u][j],-1LL*dp[dpcur^1][i][j]*trans[u][j]);
				}
			}
		dpcur^=1; memset(dp[dpcur],0,sizeof dp[dpcur]);
		for (int i=0;i<=n;i++)
			for (int v=0;v<=m;v++)
				trans[i][v]=1LL*ifac[v]*p[k][v*(n-i)]%Mod*p[K-k][v*i]%Mod;
		for (int i=0;i<=n;i++)
			for (int j=0;j<=m;j++){
				for (int v=0;j+v<=m;v+=2){
					add(dp[dpcur][i][j+v],1LL*dp[dpcur^1][i][j]*trans[i][v]);
				}
				for (int v=1;j+v<=m;v+=2){
					add(dp[dpcur][i][j+v],-1LL*dp[dpcur^1][i][j]*trans[i][v]);
				}
			}
	}
	int ans=1LL*dp[dpcur][n][m]*fac[n]%Mod*fac[m]%Mod;
	printf("%d\n",(ans+Mod)%Mod);
	return 0;
}

Measured memory_bytes: 4352
#include <cstdio>
#include <cstring>
#include <iostream>
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;
inline char nc() {
    return getchar();
    static char buf[100000], *l = buf, *r = buf;
    return l==r&&(r=(l=buf)+fread(buf,1,100000,stdin),l==r)?EOF:*l++;
}
template<class T> void read(T &x) {
    x = 0; int f = 1, ch = nc();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
    while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
    x *= f;
}
typedef long long LL;
const int mod = 1e9 + 7;
const int maxn = 2000 + 50;
int n, k;
int f[maxn][maxn][2];
inline int add(int x) {return x >= mod ? x - mod : x;}
LL power(LL x, LL y) {
    LL re = 1;
    while(y) {
        if(y & 1) re = re * x % mod;
        x = x * x % mod;
        y >>= 1;
    }
    return re;
}
int solve() {
    f[n][0][0] = f[n][1][1] = 1;
    for(int i = n; i > 1; --i) {
        for(int j = n; j >= 0; --j) {
            f[i][j][0] = add(f[i][j][0] + f[i][j + 1][0]);
            for(int t = 0; t < 2; ++t) {
                f[i - 1][j][0] = add(f[i - 1][j][0] + f[i][j][t]);
                f[i - 1][j + 1][1] = add(f[i - 1][j + 1][1] + f[i][j][t]);
            }
        }
    }
    return f[1][n - k][0] * power(2, max(n - k - 1, 0)) % mod;
}
int main() {
    read(n), read(k);
    printf("%d\n", solve());
    return 0;
}


Measured memory_bytes: 33024
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,ans{};
    cin>>n;
    vector<int> l(n);
    for(auto&i:l) cin>>i;
    sort(l.begin(),l.end());
    fr(k,n) fr(j,k) fr(i,j) if(l[i]<l[j] and l[j]<l[k] and l[k]<l[i]+l[j]) ++ans;
    cout<<ans<<'\n';
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; // [9,223,372,036,854,775,807 to -9.....808] 19 digits
typedef long double ld;
#define inc(i, a, b) for (long long int i = a; i <= b; i++)
#define dec(i, a, b) for (long long int i = a; i >= b; i--)
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(NULL);                \
    cout.tie(NULL);
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define lv vector<ll>
#define cv vector<char>
#define dv vector<ld>
#define rall(c) (c).rbegin(), (c).rend()
#define lpr pair<ll, ll>
#define mp make_pair
#define cin(c) \
    ll c;      \
    cin >> c;
#define lmap unordered_map<ll, ll>
#define vinp(a, n) \
    inc(i, 1, n)   \
    {              \
        cin(k);    \
        a.pb(k);   \
    }
#define LIM 1000000007
#define F first
#define S second
#define fr(i, n) inc(i, 0, n - 1)
#define fri(n, a) \
    inc(i, 0, n - 1) { cin >> a[i]; }
#define endl cout << "\n";
#define debug(p) cout << p;
#define umap unordered_map
#define uset unordered_set
#define fill(a, val, n) \
    inc(i, 0, n - 1) { a[i] = val; }
void i_love_Accepted()
{
    ll x,n;
    cin>>x>>n;
    if(n==0)
    {
        cout<<x;
        return;
    }
    ll k;
    uset<ll> p;
    fr(i,n)
    {
        cin>>k;
        p.insert(k);
    }
    ll ans,mi=INT_MAX;
    inc(i,-101,101)
    {
        if(p.find(i)==p.end())
        {
            if(abs(x-i)<mi)
            {
                mi=abs(x-i);
                ans=i;
            }
        }
    }
    cout<<ans;
}
int main()
{
    fast;
    ll t = 1;
    //cin >> t;
    while (t--)
    {
        i_love_Accepted();
        endl;
    }
}


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

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

  int n, m;
  string a[60], b[60];
  cin >> n >> m;
  rep(i, n) cin >> a[i];
  rep(i, m) cin >> b[i];

  rep(i, n-m+1) {
    rep(j, n-m+1) {
      bool ok = true;
      rep(k, m) {
        if (a[i+k].substr(j, m) != b[k]) {
          ok = false;
        }
      }
      if (ok) {
        puts("Yes");
        return 0;
      }
    }
  }
  puts("No");
}

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

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int sum=0;
		int arr[]=new int[2*n];
		for(int i=0;i<2*n;i++)
		{
			arr[i]=sc.nextInt();
			
		}
		Arrays.sort(arr);
		for(int j=0;j<2*n;j=j+2) {
			sum=sum+Math.min(arr[j], arr[j+1]);
			
		}
		System.out.println(sum);
sc.close();
	}

}


Measured memory_bytes: 35988
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int n, k;
  cin >> n >> k;
  
  vector<bool> s(n, false);
  
  for(int i = 0; i < k; i++){
    int d;
    cin >> d;
    vector<int> a(d);
    for(int j = 0; j < d; j++) cin >> a.at(j);
      
    for(int j = 0; j < d; j++){
      s.at(a.at(j) - 1) = true;
    }
  }
  
  int count = 0;
  for(int i = 0; i < n; i++){
    if(s.at(i) == false) count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstring>
#include <map>
#include <climits>
#include <bitset>

#define ll long long
const ll MOD = 1e9 + 7;
const ll INF = 1 << 29;

int main()
{
    ll K, S;
    std::cin >> K >> S;

    ll ans = 0;
    for (auto X=0; X<=K; ++X)
    {
        for (auto Y=0; Y<=K; ++Y)
        {
            ll Z = S - X - Y;
            if (Z < 0 || K < Z)
                continue;

//            std::cout << "X: " <<  X << " Y: " << Y << " Z: " << Z << std::endl;
            ans++;
        }
    }

    std::cout << ans << std::endl;
}


Measured memory_bytes: 256
import collections
import heapq


class Dijkstra:
    def __init__(self, n_nodes):
        self.n_nodes = n_nodes
        self.neighbors = collections.defaultdict(list)

    def add_edge(self, x, y, d):
        self.neighbors[x].append((y, d))
        self.neighbors[y].append((x, d))

    def compute_all(self, s):
        distances = [float('inf') for _ in range(self.n_nodes)]
        visited = [False for _ in range(self.n_nodes)]
        prev_nodes = [None for _ in range(self.n_nodes)]
        distances[s] = 0
        q = []
        for t in range(self.n_nodes):
            heapq.heappush(q, (distances[t], t))
        while q:
            dist_x, x = heapq.heappop(q)
            if visited[x]:
                continue
            visited[x] = True

            for y, d_xy in self.neighbors[x]:
                if visited[y]:
                    continue
                dist_y = dist_x + d_xy
                if dist_y < distances[y]:
                    distances[y] = dist_y
                    prev_nodes[y] = x
                    heapq.heappush(q, (dist_y, y))
        return distances, prev_nodes


n = int(input())
dijkstra = Dijkstra(n)
for _ in range(n - 1):
    a, b = map(int, input().split())
    dijkstra.add_edge(a - 1, b - 1, 1)
ds0, _ = dijkstra.compute_all(0)
ds1, _ = dijkstra.compute_all(n - 1)
count = 0
for d0, d1 in zip(ds0, ds1):
    if d0 <= d1:
        count += 1
if count > n // 2:
    print('Fennec')
else:
    print('Snuke')

Measured memory_bytes: 62848
import sys
input = sys.stdin.readline
from functools import lru_cache

T=int(input())
for tests in range(T):
    N,A,B,C,D=map(int,input().split())

    @lru_cache(maxsize=None)
    def calc(x):
        if x==1:
            return D

        ANS=x*D

        two=x//2*2
        if two//2<x:
            ANS=min(ANS,abs(two-x)*D+A+calc(two//2))
        if two//2+1<x:
            ANS=min(ANS,abs(two+2-x)*D+A+calc(two//2+1))

        three=x//3*3
        if three//3<x:
            ANS=min(ANS,abs(three-x)*D+B+calc(three//3))
        if three//3+1<x:
            ANS=min(ANS,abs(three+3-x)*D+B+calc(three//3+1))

        five=x//5*5
        if five//5<x:
            ANS=min(ANS,abs(five-x)*D+C+calc(five//5))
        if five//5+1<x:
            ANS=min(ANS,abs(five+5-x)*D+C+calc(five//5+1))

        return ANS

    print(calc(N))

Measured memory_bytes: 11872
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MAX = 100000;
const int INF = 1e9;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
#define PI 3.14159265358979323846264338327950L
#define MOD 1000000007
//setprecision(15)
#define MAX_T 100000
int AC[MAX_T+1];
int WA[MAX_T+1];
int main() {
	int N, M; cin >> N >> M;
	int p; string s;
	rep(i, M) {
		cin >> p >> s;
		if (AC[p] == 1) continue;
		if (s == "WA") WA[p]++;
		else AC[p]++;
	}
	int A = 0, W = 0;
	rep(i, MAX_T+1) {
		if (AC[i] == 1) {
			A++; W += WA[i];
		}
	}
	cout << A << " " << W << endl;
}

Measured memory_bytes: 4272
#include <stdio.h>
#define MAX 100000
#define SENTINEL 2000000000

struct Card
{
  char suit;
  int value;
};

struct Card L[MAX / 2 + 2], R[MAX / 2 + 2];

void merge(struct Card A[], int n, int left, int mid, int right)
{
  int i, j, k;
  int n1 = mid - left;
  int n2 = right - mid;
  for (i = 0; i < n1; i++)
  {
    L[i] = A[left + i];
  }
  for (i = 0; i < n2; i++)
  {
    R[i] = A[mid + i];
  }
  L[n1].value = R[n2].value = SENTINEL;
  i = j = 0;
  for (k = left; k < right; k++)
  {
    if (L[i].value <= R[j].value)
    {
      A[k] = L[i++];
    }
    else
    {
      A[k] = R[j++];
    }
  }
}

void mergeSort(struct Card A[], int n, int left, int right)
{
  int mid;
  if (left + 1 < right)
  {
    mid = (left + right) / 2;
    mergeSort(A, n, left, mid);
    mergeSort(A, n, mid, right);
    merge(A, n, left, mid, right);
  }
}

int partition(struct Card A[], int n, int p, int r)
{
  int i, j;
  struct Card t, x;
  x = A[r];
  i = p - 1;
  for (j = p; j < r; j++)
  {
    if (A[j].value <= x.value)
    {
      i++;
      t = A[i];
      A[i] = A[j];
      A[j] = t;
    }
  }
  t = A[i + 1];
  A[i + 1] = A[r];
  A[r] = t;
  return i + 1;
}

void quickSort(struct Card A[], int n, int p, int r)
{
  int q;
  if (p < r)
  {
    q = partition(A, n, p, r);
    quickSort(A, n, p, q - 1);
    quickSort(A, n, q + 1, r);
  }
}

int main()
{
  int n, v;
  struct Card A[MAX], B[MAX];
  char S[10];
  int stable = 1;

  scanf("%d", &n);
  for (int i = 0; i < n; i++)
  {
    scanf("%s %d", S, &v);
    A[i].suit = B[i].suit = S[0];
    A[i].value = B[i].value = v;
  }

  mergeSort(A, n, 0, n);
  quickSort(B, n, 0, n - 1);

  for (int i = 0; i < n; i++)
  {
    if (A[i].suit != B[i].suit)
    {
      stable = 0;
    }
  }

  if (stable == 1)
  {
    printf("Stable\n");
  }
  else
  {
    printf("Not stable\n");
  }
  for (int i = 0; i < n; i++)
  {
    printf("%c %d\n", B[i].suit, B[i].value);
  }

  return 0;
}


Measured memory_bytes: 4932
n, x = map(int, input().split())
a = list(map(int, input().split()))

DP = a[:]
ans = sum(DP)
for i in range(n-1):
    new = [0]*n
    for j in range(n):
        new[j] = min(DP[j], DP[j-1])
    DP=new
    ans = min(ans, sum(DP) + (i+1)*x)
print(ans)

Measured memory_bytes: 3188
#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;

int main() {
	int a, b;
	cin >> a >> b;
	int tmp = 1;
	int cnt = 0;
	while (tmp < b) {
		tmp--;
		tmp += a;
		cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<map>
#include<stack>
#include<cstdlib>
#include<cstring>
#include<algorithm>

using namespace std;

void func(int ts){
	int h,m,s;
	h = ts / (60*60);
	ts -= 60*60*h;
	m = ts / 60;
	ts -= 60*m;
	s = ts;
	
	printf("%02d:%02d:%02d\n", h, m, s);
}


int main(void){
	
	int h,m,s;
	while(scanf("%d %d %d", &h, &m, &s) && h != -1){
		int ts = (60*60*2)-(60*60*h+60*m+s);
		func(ts);
		func(ts*3);
	}
	
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
string to_string(const string& s) {
	return '"' + s + '"';
}
string to_string(const bool b) {
	return (b ? "true" : "false");
}
string to_string(const char* s) {
	return to_string((string)s);
}
string to_string(const char c) {
	string s = "'";
	s += c;
	s += "'";
	return s;
}
template<class T, class U>
string to_string(const pair<T, U>& p) {
	string s = "(";
	s += to_string(p.first);
	s += ", ";
	s += to_string(p.second);
	s += ")";
	return s;
}
template<class T>
string to_string(const T& a) {
	bool first = true;
	string s = "{";
	for (const auto& x : a) {
		if(!first){
			s += ", ";
		}
		first = false;
		s += to_string(x);
	}
	s += "}";
	return s;
}
void debug_out() {cerr << '\n';}
template<class Head, class... Tail>
void debug_out(Head head, Tail... tail) {
	cerr << ' ' << to_string(head);
	debug_out(tail...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "] = ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif
using ll = long long;
using ld = long double;
const int mod = 998244353;
const int inf = 1e9 + 100;
const ll inf64 = 7e18l;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(20);
	int n;
	cin >> n;
	cout << (n + 1) / 2 << '\n';
 	return 0;
}


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

int n, mnum = 0, num = 0;
int a[55] = {0};
vector<pair<int, int>> ans;

void solve();

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

void solve() {
  for(int i = 0; i < n; ++i)
    if(abs(mnum) < abs(a[i])) mnum = a[i], num = i;
  for(int i = 0; i < n; ++i)
    if(mnum != a[i]) {
      ans.push_back(make_pair(num, i));
      a[i] += mnum;
    }
  if(mnum > 0) {
    for(int i = 1; i < n; ++i)
      if(a[i - 1] > a[i]) {
        ans.push_back(make_pair(i - 1, i));
        a[i] += a[i - 1];
      }
  }
  else {
    for(int i = n - 1; i >= 1; --i)
      if(a[i - 1] > a[i]) {
        ans.push_back(make_pair(i, i - 1));
        a[i - 1] += a[i];
      }
  }
  cout << ans.size() << endl;
  for(int i = 0; i < ans.size(); ++i)
    cout << ans[i].first + 1 << " " << ans[i].second + 1
         << endl;
}


Measured memory_bytes: 256
lines=readlines()
shift!(lines)
x=y=t=0
for s=lines
	tt,tx,ty=map(x->parse(Int,x),split(s))
	if (tt-t)%2!=(abs(x-tx)+abs(y-ty))%2||tt-t<abs(x-tx)+abs(y-ty)
		println("No")
		exit()
	end
	x,y,t=tx,ty,tt
end
println("Yes")


Measured memory_bytes: 149808
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	a, b, c, k := scanInt(), scanInt(), scanInt(), scanInt()

	for a >= b && k > 0 {
		b *= 2
		k--
	}
	for b >= c && k > 0 {
		c *= 2
		k--
	}

	if a < b && b < c {
		fmt.Fprintln(wr, "Yes")
	} else {
		fmt.Fprintln(wr, "No")
	}
}


Measured memory_bytes: 1776
using System;

class Answer
{
  static void Main()
  {
    string[] str = Console.ReadLine().Split(' ');
    int a = int.Parse(str[0]);
    int b = int.Parse(str[1]);
    int c = int.Parse(str[2]);

    int num = a*100 + b*10 + c;

    if (num%4 == 0){
      Console.Write("YES");
    }else{
      Console.Write("NO");
    }
  }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
int GCD(int a,int b){return b?GCD(b,a%b):a;}
int LCM(int a,int b){return (a*b)/GCD(a,b);}
int abs(int x){return x>0?x:-x;}
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int main()
{
	int a, b;
	cin >> a >> b;
	int ans = 0;
	if (a > b){
		ans += a;
		a--;
	}
	else {
		ans += b;
		b--;
	}

	ans += max(a, b);

	cout << ans << endl;
}


Measured memory_bytes: 256
function Main(input){
    let arr = input.trim().split('\n');
    let count_AC = 0;
    let count_WA = 0;
    let count_TLE = 0;
    let count_RE = 0;
    for(let i=1; i <= Number(arr[0]); i++){
        if(arr[i] == 'AC')  count_AC++;
        if(arr[i] == 'WA')  count_WA++;
        if(arr[i] == 'TLE') count_TLE++;
        if(arr[i] == 'RE')  count_RE++;
    }
    console.log('AC' + ' x ' + count_AC)
    console.log('WA' + ' x ' + count_WA)
    console.log('TLE' + ' x ' + count_TLE);
    console.log('RE' + ' x ' + count_RE);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 37152
#include<iostream>
#include<algorithm>
#include <iostream> 
#include <algorithm> 
#include<string>
#include<queue>
#include<utility>
#include<fstream>
#include<queue>
#include<set>
#include<stack>
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 
 
typedef pair<int,int >P;
//////////////////////////
/////////////////////////
#define mx 100000
int main(){

 string a,b;
 cin>>a>>b;

    int n,m;
    cin>>n>>m;
string c;
    cin>>c;
    if(c==a)cout<<(n-1)<<" "<<m<<endl;
    else cout<<n<<" "<<(m-1)<<endl;
    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, acos, asin, atan, sqrt, tan, cos, pi
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


mod = 10 ** 9 + 7


n = I()
A = LI()
A.sort(reverse=True)
q = [-A[0]]
ret = 0
for i in range(1, n):
    ret += -heappop(q)
    heappush(q, -A[i])
    heappush(q, -A[i])

print(ret)




ret = 0



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    EACH(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
    REP(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
    REP(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

ll query(ll a, ll b) {
    cout << "? " << a+1 << " " << b+1 << endl;
    cout.flush();
    ll res; cin >> res;
    return res;
}
ll answer(const vector<ll>& ans) {
    cout << "!";
    EACH(a, ans) cout << " " << a+1;
    cout << endl;
    cout.flush();
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    int n; cin >> n;
    vector<vector<ll>> cand(n+1);
    // make cand
    FOR(i, 1, n) {
        cand[query(0, i)].pb(i);
    }
    // distribute
    vector<ll> left, right;
    REP(i, cand.size()) {
        if (cand[i].size() == 0) continue;
        if (i == 1) {
            right.pb(cand[i][0]);
            if (cand[i].size() == 2) {
                left.pb(cand[i][1]);
            }
        }
        else {
            int c1 = cand[i][0];
            bool is_r = query(c1, right.back()) == 1;
            if (is_r) right.pb(c1);
            else left.pb(c1);
            if (cand[i].size() == 2) {
                int c2 = cand[i][1];
                if (!is_r) right.pb(c2);
                else left.pb(c2);
            }
        }
    }
    // answer
    vector<ll> ans;
    RREP(i, left.size()) ans.pb(left[i]);
    ans.pb(0);
    REP(i, right.size()) ans.pb(right[i]);
    answer(ans);
}

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

int main() {
    int n, q, S[10010], T[510];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> S[i];
    cin >> q;
    for (int i = 0; i < q; i++) cin >> T[i];

    int ans = 0;
    for (int i = 0; i < q; i++) {
        int j = 0, key = T[i];
        S[n] = key;
        while (S[j] != key) j++;
        if (j < n) ans++;
    }

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


Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define i_7 (ll)(1E9+7)
#define i_5 (ll)(1E9+5)
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=(ll)1E12;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll * pos,ll val){*pos=max(*pos,val);}//Max(&dp[i][j],dp[i-1][j]);
void Min(ll * pos,ll val){*pos=min(*pos,val);}
void Add(ll * pos,ll val){*pos=mod(*pos+val);}
// long double EPS=1E-8;
////////////////////////////////////////

bool comp(l_l a,l_l b){
    if(a.first<b.first)return true;
    else if(a.first==b.first&&a.second>b.second)return true;
    else return false;
}

bool comp2(l_l a,l_l b){
    if(a.second>b.second)return true;
    else return false;
}


int main() {
    ll n,k;cin>>n>>k;
    l_l a[n];rep(i,0,n-1)cin>>a[i].first>>a[i].second;
    sort(a,a+n,comp);
    vector<l_l>b,c;
    rep(i,0,n-1){
        if(i==0){
            b.pb(a[i]);
        }else if(a[i-1].first==a[i].first){
            c.pb(a[i]);
        }else{
            b.pb(a[i]);
        }
    }
    sort(b.begin(),b.end(),comp2);sort(c.begin(),c.end(),comp2);
    ll bs=b.size(),cs=c.size();
   // rep(i,0,bs-1)cout<<b[i].first<<" "<<b[i].second<<endl;cout<<endl;
   // rep(i,0,cs-1)cout<<c[i].first<<" "<<c[i].second<<endl;cout<<endl;
    ll x[bs],y[cs];
    if(b.size()){
        x[0]=b[0].second;
        rep(i,1,bs-1)x[i]=x[i-1]+b[i].second;
    }
    if(c.size()){
        y[0]=c[0].second;
        rep(i,1,cs-1)y[i]=y[i-1]+c[i].second;
    }
    ll ans=0;
  //  rep(i,0,bs-1)cout<<x[i]<<" ";cout<<endl;
  //  rep(i,0,cs-1)cout<<y[i]<<" ";cout<<endl;
    for(ll i=1;i<=bs&&i<=k;i++){
        if(i+cs<k)continue;
        ll sum=i*i;
        if(k-i-1<0)sum+=x[i-1];
        else sum+=x[i-1]+y[k-i-1];
    //cout<<i<<" "<<sum<<endl;
        Max(&ans,sum);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 4336
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  long long N, c = 0;

  std::cin >> N;

  for (long long x = 1; ; x ++) {
    long long l = N / (x + 1) + 1, r = N / x;

    if (r == 0)
      break;

    if (l > r)
      break;

    long long Nl = N % l, Nr = N % r;

    if (r - l == 0) {
      if (x == N % l) {
        long long z = l;

        c += z;
      }
    }
    else {
      long long d = (Nl - Nr) / (r - l);

      if ((x - Nr) % d == 0) {
        long long z = r - (x - Nr) / d;
        
        c += z;
      }
    }
  }
  
  std::cout << c << std::endl;

  return 0;
}


Measured memory_bytes: 888
const gcd = (m, n) => {
  while (n > 0) {
    const r = m % n
    m = n
    n = r
  }
  return m
}

const Main = (input) => {
  const tmp = parseInt(input.trim())

  let result = 0

  for (let i = 1; i <= tmp; ++i) {
    for (let j = 1; j <= tmp; ++j) {
      for (let k = 1; k <= tmp; ++k) {
        result += gcd(gcd(i, j), k)
      }
    }
  }

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))

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

using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> ii;

const int N = 500 + 5;
int n, m, q, c, a[N][N];

int main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> n >> m >> q;
    for(int i = 1; i <= m; i++) {
        int l, r;
        cin >> l >> r;
        a[l][r]++;
    }
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= n; j++)
            a[i][j] = a[i][j] + a[i][j - 1] + a[i - 1][j] - a[i - 1][j - 1];
    }
    while(q--) {
        int l, r;
        cin >> l >> r;
        cout << a[n][r] - a[l - 1][r] << "\n";
    }
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long int n,q;
  cin >>n >>q;
  string s;
  cin >> s;
  long long int l[q],r[q],ans[n],re[n+1];
  for(int i=0;i<q;i++)cin >> l[i] >> r[i];
  for(int i=0;i<n;i++){
    ans[i]=0;
    re[i]=0;
  }
  re[n]=0;
  for(int i=0;i<n-1;i++){
    if(s[i]=='A' && s[i+1]=='C')ans[i+1]=1;
  }
  for(int i=0;i<n;i++){
    re[i+1]=re[i]+ans[i];
  }
  for(int i=0;i<q;i++){
    if (s[l[i]]=='A' && s[l[i]]=='C')cout << re[r[i]]-re[l[i]]+1<<endl;
    else cout << re[r[i]]-re[l[i]] <<endl;
  }
}

Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(int i=(s);i<(t);++i)
#define per(i,s,t) for(int i=((t)-1);i>=s;--i)
#define repb(i,s,t) for(int i=(s);i<=(t);++i)
#define lepb(i,s,t) for(int i=(s);i>=(t);--i)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)x.size())
#define mst(a,b) memset(a,b,sizeof(a))
#define dd(x) cout<<#x<<'='<<x<<' '
#define de(x) cout<<#x<<'='<<x<<'\n'
#define fi first
#define se second
#define sq(x) ((x)*(x))
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;

const int inf = 0x3f3f3f3f;
const ll inff = 4557430888798830399ll;
const db eps = 1e-10;
const db pi = acos(-1.0);
const ll mod = 1e9+7;

ll fpow(ll b,ll p){ll r=1;for(;p;p>>=1,(b*=b)%=mod)if(p&1)(r*=b)%=mod;return r;}

#define maxn 100005
ll A[maxn],F[maxn],S;int n;

int main()
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	S=0;mst(F,0);mst(A,0);
	cin>>n;
	repb(i,1,n)cin>>A[i];
	repb(i,1,n)F[i]=fpow(i,mod-2);
	repb(i,1,n)(F[i]+=F[i-1])%=mod;
	repb(i,1,n)(S+=A[i]*(F[i]+F[n-i+1]-F[1]))%=mod;
	repb(i,1,n)(S*=i)%=mod;
	cout<<S<<endl;
}

Measured memory_bytes: 1792
N = int(input())
a = [int(x) for x in input().split()]

sum_a = sum(a)
min_sub = 100*100
min_t = 100
for i in range(N):
  sum_a_i = sum(a[:i])
  sum_b_i = sum_a - sum_a_i
  if abs(sum_b_i - sum_a_i) < min_sub:
    min_sub = abs(sum_b_i - sum_a_i)
    min_t = i
    
print(min_sub)

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main(){
  long long int H;
long long int W;
  cin>>H>>W;
  if(H!=1&&W!=1){
  if((H*W)%2==0){
  cout<<H*W/2;
  }
  else{
  cout<<(H*W)/2+1;
  }
  }
  else {
  cout<<1;
  }
}

Measured memory_bytes: 3596
import sys
input = sys.stdin.readline

l1=[]
l2=[]
for _ in range(5):
    m = int(input())
    if m % 10 == 0:
        l1.append(m)
    else:
        l2.append([m, int(str(m)[-1])])

l2 = sorted(l2, key=lambda x: x[1], reverse=True)
ans = sum(l1)
for i in range(len(l2)):
    if i+1 != len(l2):
        ans += l2[i][0]+10-l2[i][1]
    else:
        ans += l2[i][0]

print(ans)

Measured memory_bytes: 3188
main = do
  s <- getContents
  let primes = 2 : filter (\n -> n > 1 && foldr (\x acc -> x * x > n || (n `mod` x /= 0 && acc)) True primes) [3, 5..999999]
  mapM_ (\n -> print $ length $ takeWhile (<= n) primes) . map read . lines $ s

Measured memory_bytes: 10228
import qualified Data.ByteString.Char8 as BS
import Data.List 

main = do 
  s <- getLine
  print $ maximum $ map length $ filter isACGT $ sublists s

sublists :: [a] -> [[a]]
sublists xs =
  concat $ map noEmptyTails $ inits xs

noEmptyTails :: [a] -> [[a]]
noEmptyTails [] = [[]]
noEmptyTails [x] = [[x]]
noEmptyTails (x:xs) = (x:xs):(noEmptyTails xs)

isACGT :: String -> Bool
isACGT s = all (\c -> c `elem` "ATCG") s

Measured memory_bytes: 508
n,i;
ea[2<<17],eb[2<<17],next[2<<17],first[1<<17];
long M,dp1[1<<17],dp2[1<<17],R[2<<17];
/*dfs1(u,p,i)
{
	dp1[u]=1;
	for(i=first[u];i;i=next[i])eb[i]-p?dfs1(eb[i],u),dp1[u]=dp1[u]*-~dp1[eb[i]]%M:0;
}*/
dfs1(u,p,i,I)
{
	dp1[u]=1;
	for(i=first[u];I=eb[i];i=next[i])I-p?dfs1(I,u),dp1[u]=dp1[u]*-~dp1[I]%M:0;
}
/*dfs2(u,p,x,i)
{
	i=first[u];
	dp2[u]=dp1[u]*x%M;
	make(i,p,x);
	for(;i;i=next[i])
	{
		if(eb[i]!=p)dfs2(eb[i],u,L[i]*R[next[i]]%M+1);
	}
}
make(i,p,x,t)
{
	if(i)
	{
		L[i]=x;
		t=eb[i]-p?-~dp1[eb[i]]:1;
		make(x=next[i],p,t%M*x%M);
		R[i]=R[x]*t%M;
	}
}*/
/*
dfs2(u,p,x,i)
{
	i=first[u];
	dp2[u]=dp1[u]*x%M;
	make(i,p);
	for(;i;i=next[i])eb[i]-p?dfs2(eb[i],u,R[next[i]]*x%M+1),x=x%M*-~dp1[eb[i]]%M:0;
}
*/
/**/
dfs2(u,p,x,i,I)
{
	//dp2[u]=dp1[u]*x%M;
	//for(make(i=first[u],p);I=eb[i];i=next[i])I-p?dfs2(I,u,R[next[i]]*x%M+1,0,0),x=x*-~dp1[I]%M:0;
	for(make(i=first[u],p);I=eb[i];I-p?dfs2(I,u,R[i]*x%M+1,0,0),x=x*-~dp1[I]%M:0)i=next[i];
	dp2[u]=x%M;
}
/**/
make(i,p)
{
	i?make(next[i],p),R[i]=R[next[i]]*(eb[i]-p?-~dp1[eb[i]]:1)%M:0;
}
main(u,v)
{
	/*for(scanf("%d%d",&n,&M);~scanf("%d%d",&u,&v);)
	{
		i++;
		ea[i]=u;
		eb[i]=v;
		i++;
		ea[i]=v;
		eb[i]=u;
	}*/
	//for(;~scanf("%d%d",&u,&v);)i++?ea[i]=eb[i+1]=u,ea[i+1]=eb[i]=v,i++:(n=u,M=v);
	
	for(;~scanf("%d%d",&u,&v);i++)i++?ea[i-1]=eb[i]=u,ea[i]=eb[i-1]=v:(n=u,M=v);
	//for(;~scanf("%d%d",&u,&v);)i++?ea[i-1]=eb[i]=u,eb[i-1]=ea[i++]=v:(n=u,M=v);
	for(;--i;first[ea[i]]=i)next[i]=first[ea[i]];
	
	dfs1(*R=1,0);
	dfs2(1,0,1);
	for(;i++<n;)printf("%d\n",dp2[i]);
}

Measured memory_bytes: 13824
// https://atcoder.jp/contests/abc154/tasks/abc154_d

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

const ll INF = 1e18;

void solve() {
  ll N, K;
  cin >> N >> K;

  V<double> ps(N);
  rep(i, N) cin >> ps[i];

  V<double> es(N);
  rep(i, N) { es[i] = (ps[i] + 1) / 2; }

  double res = 0;
  double cur = 0;

  rep(i, N) {
    cur += es[i];

    if (i - (K - 1) >= 0) {
      cur -= es[i - K];
    }

    chmax(res, cur);
  }

  cout << fixed << setprecision(10) << res << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

void print_ints(vector<ll> v) {
  rep(i, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


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

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  
  if(a==b && b!=c)cout << "Yes" << endl;
  else if(b==c && a!=b)cout << "Yes" << endl;
  else if(a==c && c!=b)cout << "Yes" << endl;
  else
  cout << "No" << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
//#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 1e9 + 7;
const int N = 1700000;
string s;
int a[N], b[N];
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int c;
    srand(time(NULL));
    for (int i = 1; i <= n; i++){
        a[i] = s[i - 1] - 'A';
       // a[i] = rand() % 2;
       b[i] = a[i];
       c = k;
       a[i] =  (a[i] ^ ((n - i) % 2));
    }
    if (n % 2 == 0){
        int p = 1;
        while(p <= n && k){
            k--;
            if (a[p] == 1){
                a[p] = 0;
            } else{
                p++;
            }
        }
        for (int i = 1; i <= n; i++){
            a[i] = a[i + p - 1];
        }
    } else{
        int p = 1;
        while(p <= n && k){
            k--;
            if (a[p] == 0){
                a[p] = 1;
            } else{
                p++;
            }
        }
        for (int i = 1; i <= n; i++){
            a[i] = a[i + p - 1];
        }
        a[1] ^= (k % 2);
    }
    for (int i = 1; i <= n; i++){
        if ( (a[i] ^ ((n - i) % 2)) == 1)
        cout << "B"; else cout << "A";
    }
}


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

#define sl(x) scanf("%lld",&x)

#define pl(x) printf("%lld\n",x) 

using namespace std;

const int N = 1e6+5;

const int mod = 998244353;

const int INF = 0x3f3f3f3f;

typedef long long ll;

ll inv(ll b)

{

	if(b == 1)

	return 1;

	return (mod-mod/b)*inv(mod%b)%mod;

}

ll fac[N];

ll C(ll n,ll m)

{

	ll t = (fac[m]*fac[n-m])%mod;

	return (fac[n]*inv(t))%mod;

}

ll ans[N][2];

int main()

{

	ll n,i,a,b,k;

	fac[0] = 1;

	fac[1] = 1;

	for(i = 2;i <= 3e5+5;i++)

	fac[i] = (fac[i-1]*i)%mod;

	sl(n);sl(a);sl(b);sl(k);

	ll cnt = 0;

	for(i = 0;i <= n;i++)

	{

		if(k-(i*a) >= 0 && (k-a*i)%b == 0 && (k-a*i)/b <= n)

		{

			ans[cnt][0] = i;

			ans[cnt++][1] = (k-a*i)/b;

		}

	}

	ll res=0;

	for(i = 0;i < cnt;i++)

	{

		res = (res+C(n,ans[i][0])*C(n,ans[i][1])%mod)%mod;

	}

	pl(res);
	
	return 0;
	system("pause");
}


Measured memory_bytes: 8448
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)
#define rrep(i,x) for(int i=(int)x-1;i>=0;--i)
#define rrep1(i,x) for(int i=(int)x;i>=1;--i)

using ll=long long;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int, int>;
using vpii=vector<pii>;

template<class T,class U>ostream&operator<<(ostream&os,const pair<T,U>p){os<<"("<<p.fst<<", "<<p.scd<<")";return os;}
template<class T>ostream&operator<<(ostream&os,const vector<T>v){rep(i,v.size()){if(i)os<<", ";os<<v[i];}return os;}
template<typename T>T&max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T&min(T&a,T&b){if(a < b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a < b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a > b){a=b;return true;}return false;}
constexpr ll TEN(ll n){return n==0?1:10ll*TEN(n-1);}

constexpr ll inf = TEN(9)+5;
constexpr ll linf = 3*TEN(18);

//#define int long long

const int mod = 998244353;

struct Chien{
  static const int MAX=1<<18;
  int n,dat[2*MAX-1],laz[2*MAX-1];
  Chien(){}
  Chien(int n_){init(n_);}
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    for(int i=0;i<2*n-1;i++) dat[i]=laz[i]=0;
  }
  inline void eval(int len,int k){
    if(k*2+1<n*2-1){
      (laz[k*2+1]+=laz[k])%=mod;
      (laz[k*2+2]+=laz[k])%=mod;;
    }
    (dat[k]+=laz[k]*len)%=mod;
    laz[k]=0;
  }
  int update(int a,int b,int x,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return (dat[k]+(ll)laz[k]*(r-l)%mod)%mod;
    if(a<=l&&r<=b) return (dat[k]+(ll)((laz[k]+=x)%=mod)*(r-l))%mod;
    eval(r-l,k);
    return dat[k]=(update(a,b,x,k*2+1,l,(l+r)/2)+update(a,b,x,k*2+2,(l+r)/2,r))%mod;
  }
  int query(int a,int b,int k,int l,int r){
    eval(r-l,k);
    if(r<=a||b<=l) return 0;
    if(a<=l&&r<=b) return dat[k];
    int vl=query(a,b,k*2+1,l,(l+r)/2);
    int vr=query(a,b,k*2+2,(l+r)/2,r);
    return (vl+vr)%mod;
  }
  int update(int a,int b,int x){
    return update(a,b,x,0,0,n);
  }
  int query(int a,int b){
    return query(a,b,0,0,n);
  }
};
signed main()
{
    int N, K; cin >> N >> K;

    Chien st(200020);

    vpii interval(K);

    rep(i, K) {
        cin >> interval[i].fst >> interval[i].scd;
    }

    st.update(0, 1, 1);
    rep(cur, N) {
        rep(i, K) {
            int v = st.query(cur, cur + 1);
            st.update(cur + interval[i].fst, cur + interval[i].scd + 1, v);
            //printf("dp[[%d, %d]] += dp[%d]\n", interval[i].fst, interval[i].scd, cur);
        }
    }

    cout << st.query(N - 1, N) << endl;
}


Measured memory_bytes: 7736
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <queue>
long long int a[500050];
using namespace std;
int main()
{
	int n;
	cin >> n;

	for (int i=1;i<=n;i++)
	{
		cin >> a[i];
	}
	sort(a+1,a+n+1);
	double ans = a[1]+a[2];
	long long int k=2;
	for (int i=3;i<=n;i++)
	{
		ans += 1.0*k*a[i];
		k*=2;
	}
	ans /= k*1.0;
	cout << ans;
	
//	cout << ans;
	
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <sstream>
#include <stdexcept>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define FOR(i, a, done) for (int i = (a); i < (done); ++i)
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define debug(a) cout << (a) << endl
namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;
template <class T>
bool chmax(T &a, const T &b)
{
	if (a < b)
	{
		a = b;
		return 1;
	}
	return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
	if (a > b)
	{
		a = b;
		return 1;
	}
	return 0;
}

ll M = 1000000007;

void solve()
{
	ll x;
	cin>>x;
	ll cnt=x/11;
	ll num=cnt*11;
	cnt*=2;
	if(num<x){
		cnt+=2;
		num+=11;
	}
	if(num-5>=x){
		cnt--;
	}
	cout<<cnt<<endl;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	return 0;
}


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

#define pb push_back
#define F first
#define S second
#define MAX 1e9
#define MIN -1e9
#define INF 1e18
#define MOD 1000000007
#define int long long
#define FOR(x, n) for(int i=x; i<n; i++)
#define print(x) cout << "[" << #x << ":" << x << "] "; 
#define println(x) cout << "[" << #x << ":" << x << "]\n"; 

int dx[8] = { -1, 0, 0, 1, -1, -1, 1, 1 }; 
int dy[8] = { 0, 1, -1, 0, -1, 1, -1, 1 };  
double PI = acos(-1); 

int32_t main(){
	ios::sync_with_stdio(0); 
    cin.tie(0); 
	#ifndef ONLINE_JUDGE
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	#endif
	int n; cin >> n;
	int dp[n+1];
	memset(dp, 0, sizeof(dp));
	dp[0] = 1;
	for(int i=3; i<=n; i++){
		dp[i] = dp[i-3] + dp[i-1];
		if(dp[i] >= MOD)
			dp[i] %= MOD;
	}
	cout << dp[n] << "\n";
	return 0;
}

Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
ll INF = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
ll N,K;
ll x[100100];
int main(){
    cin >> N >> K;
    for(ll i = 0; i < N; i++){
        cin >> x[i];
    }
    ll ans = MOD;
    ll L = 0;
    for(ll i = 0; i < N-K+1; i++){
        L = min(abs(x[i]), abs(x[i+K-1])) + x[i+K-1]-x[i];
        ans = min(ans, L);

    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define bit(k) (1LL<<(k))
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template <typename T1, typename T2> ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {os << "{" <<p.first << ", " << p.second << "}";return os;}
struct fast_ios{ fast_ios(){cin.tie(0);ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; }fast_ios_;
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; }

// #ifdef DEBUG
#define dump(x) cerr<<#x<<": "<<x<<endl;
// #else
// #define dump(x)
// #endif

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const long double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

int main() {
    ll D, T, S;
    cin >> D >> T >> S;
    dump(D);
    cout << ((D + S - 1) / S <= T ? "Yes" :"No") << endl;
}


Measured memory_bytes: 3656