akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define M 1000000007
#define N 998244353
#define ll long long
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vll vector<long long>
#define INF 1000000000
 
ll modInverse(ll a, ll m);
ll gcd(ll a, ll b);
ll power(ll x, unsigned ll y, unsigned ll m);
ll logint(ll x,ll y);
 
 
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b%a, a);
}
 
ll power(ll x, unsigned ll y, unsigned ll m)
{
    if (y == 0)
        return 1;
    ll p = power(x, y/2, m) % m;
    p = (p * p) % m;
 
    return (y%2 == 0)? p : (x * p) % m;
}
 
ll modInverse(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;
 
    if (m == 1)
      return 0;
 
    while (a > 1)
    {
        // q is quotient
        ll q = a / m;
        ll t = m;
 
        // m is remainder now, process same as
        // Euclid's algo
        m = a % m, a = t;
        t = y;
 
        // Update y and x
        y = x - q * y;
        x = t;
    }
 
    // Make x positive
    if (x < 0)
       x += m0;
 
    return x;
}
 
void pairsort(ll a[],ll b[], ll n)
{
    pair<ll, ll> pairt[n];
 
    // Storing the respective array
    // elements in pairs.
    for (ll i = 0; i < n; i++)
    {
        pairt[i].first = a[i];
        pairt[i].second = b[i];
    }
 
    // Sorting the pair array.
    sort(pairt, pairt + n);
 
    // Modifying original arrays
    for (ll i = 0; i < n; i++)
    {
        a[i] = pairt[i].first;
        b[i] = pairt[i].second;
    }
}
 
ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<x;i++)
    {
        if(x<=a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}
bool dp[1001][1001];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
 
    /*
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    */
    ll n;
    cin>>n;
    ll ar[n];
    REP(i, 0, n){
        cin>>ar[i];
    }
   ll ans[n];
   ans[0] = 0;
   REP(i, 1, n){
       if(ar[i] <= ar[i-1]){
           ans[i] = ans[i-1]+1;
       }
       else{
           ans[i] = 0;
       }
   }
   cout<<*max_element(ans, ans+n);
}

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

using namespace std;
typedef long long ll;

int main(void)
{
	int N;
	cin >> N;
	vector<int> d(N);

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

	int sum = 0;

	for (int i = 0; i < N; i++) {
		for (int j = i+1; j < N;j++)
		{
			sum +=d[i] * d[j];
		}
	}

	cout << sum << endl;
}

Measured memory_bytes: 256
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
N, Q = map(int, input().split())
events = []
for i in range(N):
    s, t, x = map(int, input().split())
    events.append((s - x, 0, x))
    events.append((t - x, 1, x))

for i in range(Q):
    d = int(input())
    events.append((d, 2, i))

events = sorted(events)

q = [INF]
cnt = defaultdict(int)
ans = [INF] * Q
for a, b, c in events:
    if b == 0:
        heapq.heappush(q, c)
        cnt[c] += 1
    if b == 1:
        cnt[c] -= 1
    if b == 2:
        while len(q) > 1 and cnt[q[0]] == 0:
            heapq.heappop(q)
        if q[0] == INF:
            ans[c] = -1
        else:
            ans[c] = q[0]
for i in range(Q):
    print(ans[i])

Measured memory_bytes: 203304
import sys
sys.setrecursionlimit(10**6)

N,M = map(int, raw_input().split())
E = [[] for _ in range(N)]
for _ in range(M):
    A,B = map(int, raw_input().split())
    E[A-1] += [B-1]
    E[B-1] += [A-1]
U = [False]*N
ans = []
def BT(p, ans):
    global U
    for e in E[p]:
        if not U[e]:
            U[e] = True
            ans += [e]
            BT(e, ans)
            break
U[0] = True
for i in range(2):
    ans += [[]]
    BT(0, ans[i])
print len(ans[0])+1+len(ans[1])
print " ".join([str(x+1) for x in ans[0]][::-1]+["1"]+[str(x+1) for x in ans[1]])


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

int euclidean_gcd(int a, int b) {
  if(a < b) return euclidean_gcd(b, a);
  int r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  int N;
  scanf("%d", &N);
  int a[N];
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i]);
  }

  int hold = a[0];

  for(int i = 0; i < N; ++i){
    hold = euclidean_gcd(hold,a[i]);
  }

  cout << hold << endl;

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
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; }

vector<pair<ll, int>> factorize(ll n){
    vector<pair<ll, int>> res;
    for (ll i = 2; i*i <= n; ++i){
        if (n%i) continue;
        res.emplace_back(i, 0);
        while (n%i == 0){
            n /= i;
            res.back().second++;
        }
    }
    if(n != 1) res.emplace_back(n, 1);
    return res;
}

const int MAX = 1e6+5;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    int maxn = 0, minn = MAX;
    rep(i,n){
        cin >> a[i];
        maxn = max(maxn, a[i]);
        minn = min(minn, a[i]);
    }

    vector<int> d(maxn+1);
    for(int i = 1; i <= maxn; i++){
        for(int j = i; j <= maxn; j += i){
            d[j]++;
        }
    }

    vector<int> dd(maxn+1);
    bool ok = false;
    for(int i = 0; i < n; i++){
        int x = a[i];
        if (x == 1 || dd[x] > 1) continue;
        for(int j = x; j <= maxn; j += x) dd[j]++;
        if (d[x] != 2){
            vector<pair<ll, int>> res = factorize(x);
            for(int j = 0; j < res.size(); j++){
                int xx = res[j].first;
                if (dd[xx] > 1) continue;
                dd[xx]++;
                for(int k = xx*2; k <= maxn; k += xx){
                    if (x % k != 0) dd[k]++;
                }
            }
        }
    }
    int cnt = 0;
    rep(i,n){
        cnt = max(cnt, dd[a[i]]);
    }

    if (cnt < 2){
        cout << "pairwise coprime" << endl;
        return 0;
    }

    int g = a[0];
    for(int i = 1; i < n; i++){
        g = __gcd(g, a[i]);
    }

    if (g == 1){
        cout << "setwise coprime" << endl;
        return 0;
    }

    cout << "not coprime" << endl;
    return 0;
}

Measured memory_bytes: 14664
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <deque>
#include <numeric>
#include <utility>
#define sign(a) ((a>0)-(a<0))
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define LL long long
#define INF (LL)(1LL<<60)
#define all(a) a.begin(), a.end()
#define gr greater<LL>()

using namespace std;

const long long MOD = 1000000007;

#define NFRAC 500000

vector<LL> fac(NFRAC+1);
vector<LL> ifac(NFRAC+1);

LL mpow(LL x, LL n){
    LL ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % MOD;
        x = x*x % MOD;
        n = n >> 1;
    }
    return ans;
}

LL comb(LL a, LL b){
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    LL tmp = ifac[a-b]* ifac[b] % MOD;
    return tmp * fac[a] % MOD;
}

void init(){
    fac[0] = 1;
    ifac[0] = 1;
    for(LL i = 0; i<NFRAC+1; i++){
        fac[i+1] = fac[i]*(i+1) % MOD;
        ifac[i+1] = ifac[i]*mpow(i+1, MOD-2) % MOD;
    }
}

void solve(long long N, long long M){
    map<LL, LL> cnts;
    LL tmp=M;
    for(int i=2; i<=sqrt(M); i++){
        while(tmp%i==0){
            tmp/=i;
            cnts[i]++;
        }
    }
    if(tmp!=1)cnts[tmp]++;

    init();

    LL ans=1;
    for(auto kv:cnts){
        ans = (ans*comb(N-1+kv.second, kv.second))%MOD;
    }
    cout << ans << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    solve(N, M);
    return 0;
}


Measured memory_bytes: 8064
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


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;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n,w;
  cin>>n>>w;
  vector<ll> weight(n),value(n);
  rep(i,n) cin>>weight[i]>>value[i];
  ll dp[n+1][w+1];
  rep(j,w+1) dp[0][j]=0;
  rep(i,n){
    rep(j,w+1){
      if(j-weight[i]>=0) dp[i+1][j]=max(dp[i][j-weight[i]]+value[i],dp[i][j]);
      else dp[i+1][j]=dp[i][j];
    }
  }
  cout<<dp[n][w]<<endl;
  
}

Measured memory_bytes: 79232
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Numerics;
using System.Reflection.Metadata;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;

namespace AtCoder
{
	public class Program
	{
		static void Main()
		{
			var nm = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
			int n = nm[0];
			int m = nm[1];

			var ab = new (int a, int b)[m];
			for (int i = 0; i < m; i++) {
				var abtemp = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
				ab[i] = (abtemp[0] - 1, abtemp[1] - 1);
			}

			var parents = new int[n];
			var counts = new int[n];
			for (int i = 0; i < n; i++) {
				parents[i] = i;
				counts[i] = 1;
			}

			int Find(int v)
			{
				while (v != parents[v]) {
					v = parents[v];
				}

				return v;
			}

			void Union(int x, int y)
			{
				int px = Find(x);
				int py = Find(y);
				if (px == py) {
					return;
				}

				if (counts[px] < counts[py]) {
					parents[px] = py;
					counts[py] += counts[px];
				} else {
					parents[py] = px;
					counts[px] += counts[py];
				}
			}

			long Count(int v)
			{
				return counts[Find(v)];
			}

			var ans = new long[m];
			var temp = (long)n * (n - 1) / 2;
			ans[m - 1] = temp;
			for (int i = m - 1; i > 0; i--) {
				int a = ab[i].a;
				int b = ab[i].b;
				if (Find(a) != Find(b)) {
					temp -= Count(a) * Count(b);
					Union(a, b);
				}
				
				ans[i - 1] = temp;
			}

			Console.WriteLine(string.Join(Environment.NewLine, ans));
		}
	}
}


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

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

  int ans = 0; int highest = 0;
  for(int i=0; i<N; i++){
    int H; cin >> H;
    if(H >= highest){
      highest = H; ans++;
    }
  }
  cout << ans << endl;
} 

Measured memory_bytes: 256
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
time=0
if a<0:
    a=(-1)*a
    time=a*c+d+b*e
elif a==0:
    time=d+b*e
else:
    b=b-a
    time=b*e
print(time)



Measured memory_bytes: 5588
s = input()
n = len(s)
count = 0
f = 0

test1 = ['0'] * n 
test2 = ['0'] * n


for i in range(n):
    if i % 2 == 0:
        test1[i] = '0'
        test2[i] = '1'
    else:
        test1[i] = '1'
        test2[i] = '0'



if len(s) == 1:
    print(count)
    f = 1
else:
    c0 = 0
    c1 = 0
    for i in range(n):
        if s[i] == '0':
            c0 += 1
        else:
            c1 += 1
    
    if c0 >= c1:
        if s[0] == '1' and s[-1] == '0':
            
            if n % 2 == 0:
                for i in range(n):
                    if test2[i] != s[i]:
                        count += 1
            else:
                for i in range(n):
                    if test1[i] != s[i]:
                        count += 1
        else:
            
            if s[0] == '0':
                for i in range(n):
                    if test1[i] != s[i]:
                        count += 1
                        
            else:
                for i in range(n):
                    if test2[i] != s[i]:
                        count += 1
    else:
        if s[0] == '0' and s[-1] == '1':
            
            if n % 2 == 0:
                for i in range(n):
                    if test1[i] != s[i]:
                        count += 1
            else:
                for i in range(n):
                    if test2[i] != s[i]:
                        count += 1
        else:
            if s[0] == '1':
                for i in range(n):
                    if test2[i] != s[i]:
                        count += 1
            else:
                for i in range(n):
                    if test1[i] != s[i]:
                        count += 1


if f == 0:
    print(count)

Measured memory_bytes: 4852
#include<algorithm>//everybody dies in their nightmares
#include<iostream>
#include<cstring>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<string>
#include<vector>
#include<sstream>
#include<cmath>
#include<unordered_set>
#include<unordered_map>
#define f(i,a,b) for(register int i=a;i<=b;++i)
#define ff(i,a,b) for(register int i=a;i>=b;--i)
#define debug(x) cerr << #x << " : " << x << " " << endl
using namespace std;
typedef long long ll;
const ll mod = 1000;
ll oula(ll x) { ll res = x;f(i, 2, x / i) { if (x % i == 0) { res = res / i * (i - 1);while (x % i == 0) x /= i; } }if (x > 1) res = res / x * (x - 1);return res; }
ll quickmod(ll a, ll n) { ll s = 1;while (n) { if (n & 1) { s = s * a % mod; }a = (a*a) % mod;n = n / 2; }return s; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
void ex_gcd(ll a, ll b, ll &x, ll &y, ll &d) { if (!b) { d = a, x = 1, y = 0; } else { ex_gcd(b, a % b, y, x, d);y -= x * (a / b); } }
ll inv(ll t, ll p) { ll d, x, y;ex_gcd(t, p, x, y, d);return d == 1 ? (x % p + p) % p : -1; }
bool isPrime(long long x) { if (x <= 1)return false;if (x == 2)return true;if (x % 2 == 0)return false;long long i, m;m = sqrt(x);f(i, 2, m) { if (x % i == 0)return false; }return true; }

const int N = 2e5 + 5;

int t;
int a[105];
int main()
{
	int n;
	while (cin >> n)
	{
		ll sum = 0;
		f(i, 1, n)
		{
			scanf("%d", &a[i]);
			sum += a[i];
		}
		ll sum2 = sum;
		sum2 /= n;
		sum =ceil(sum*1.0/n);
		
		//debug(sum);
		ll ans = 0;
		ll ans2 = 0;
		//sum = 14;
		//debug(sum);
		f(i, 1, n)
		{
			ans += (a[i] - sum)*(a[i] - sum);
			ans2 += (a[i] - sum2)*(a[i] - sum2);;
		}
		ans = min(ans, ans2);
		cout << ans << endl;
	}
	return 0;
}

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

int MaxProfit(vector<int> A){
	int start_number = 0;
	int profit = A[1] - A[0];
	while(1){
		int i;
		for(i = start_number + 1; i < A.size(); i++){
			if(A[i] - A[start_number] < 0){
				start_number = i;
				break;
			}
			if(A[i] - A[start_number] > profit){
				profit = A[i] - A[start_number];
			}
		}
		if(i >= A.size() - 1) break;
	}
	return profit;
}

int main(){
	int n;
	cin >> n;
	vector<int> A;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		A.push_back(a);
	}
	cout << MaxProfit(A) << endl;
	return 0;
}

Measured memory_bytes: 2852
N = int(input())
listD = []
for i in range(N):
  listD.append(list(map(int,input().split()))	)

  
###################################################
count = 0
flag = False
for j in range(N):
  if listD[j][0] == listD[j][1]:
    count += 1
    if count >= 3:
      print("Yes")
      flag = True
      break
  else:
    count = 0
if flag == False:
  print("No")
  
  
  
  

Measured memory_bytes: 9180
#include <cstdio>
#include <string>
#include <string.h>

using namespace std;

void counter(char s[], int cnt[]) {
  for (int i=0; i<26; i++) {
    cnt[i] = 0;
  }
  for (int i=0; i<strlen(s); i++) {
    cnt[s[i]-'a'] += 1;
  }
}

int main() {

  int n;
  scanf("%d", &n);

  int cnt0[26];
  for (int i=0; i<26; i++) {
    cnt0[i] = 50;
  }

  for (int i=0; i<n; i++) {
    char s[50];
    scanf("%s", s);

    int cnt[26];
    counter(s, cnt);
    for (int j=0; j<26; j++) {
      cnt0[j] = min(cnt[j], cnt0[j]);
    }
  }
  for (int i=0; i<26; i++) {
    for (int j=0; j<cnt0[i]; j++) {
      printf("%c", 'a'+i);
    }
  }
}

Measured memory_bytes: 128
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 1; i < N; i++) {
			A[sc.nextInt() - 1]++;
		}
		sc.close();

		for (int i = 0; i < N; i++) {
			System.out.println(A[i]);
		}

	}
}


Measured memory_bytes: 60440
import java.util.*;
import java.io.*;
class Main{
    public static void main(String[] args){
	try{
	    BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
	    String st;
	    int[] x = new int[1000000];
	    for(int i=2; i<=1000; i++)
		if(x[i]==0)
		    for(int j=i*i; j<1000000; j+=i)
			x[j]=1;
	    while((st=s.readLine())!=null){
		int count=0, n=Integer.valueOf(st);
		for(int i=2; i<=n; i++)
		    if(x[i]==0)
			count++;
		System.out.println(count);
	    }
	}catch(Exception e){
	    System.out.println("Error");
	}
    }
}

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

using namespace std;

static const int INF = 1e9 + 7;

template<typename T>
using Vec = vector<T>;

template<typename T, typename T2>
using P = pair<T, T2>;

template<typename... Args>
using Tup = tuple<Args...>;

template<typename T>
using qp = priority_queue<T, Vec<T>, greater<T> >;

template<typename T>
using pq = priority_queue<T>;

using llong = long long;
using ullong = unsigned long long;
using uint = unsigned int;

template<typename T>
T gcd(T x, T y)
{
	return y ? gcd(y, x % y) : x;
}

void hawawa()
{
	int n;
	cin >> n;
	cout << (n / 2) * ((n / 2) + (n % 2)) << "\n";
}

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


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer sum = 0;
		Integer buf =0;
		Integer nInteger = new Integer(scanner.next());
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		for(int i = 1;i <= nInteger;i++) {
			buf = i;
			sum = 0;
			while(buf != 0){
				sum += buf%10;
				buf /= 10;
			}
			if(sum >= aInteger && sum <= bInteger) {
				output +=i ;
			}
		}

		System.out.println(output);
		scanner.close();
	}
}


Measured memory_bytes: 23892
#include<bits/stdc++.h>
using namespace std;
typedef long long int  ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define txt freopen("ip.txt", "r", stdin); freopen("op.txt", "w", stdout)
#define a3 INT_MAX
#define i3 INT_MIN
#define a6 INT64_MAX
#define i6 INT64_MIN
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define quickie ios_base::sync_with_stdio(false); cin.tie(NULL);
#define div2(a) (!(a&1))
#define deb(x) cout<<(#x)<<" "<<(x)<<"\n";
#define newl cout<<"\n" 
#define all(s) s.begin(),s.end()
#define pi 3.14159265358979323846
#define fp(x) fixed<<setprecision(x)<<
template<class T>
T mod(T a){
    if(a < 0){
        a += 1000000007;
    }
    return a%1000000007; 
}
template<class T>
T addmod(T a, T b){
    return (mod(a) + mod(b)) % 1000000007;
}
template<class T>
T prodmod(T a, T b){
    return (mod(a) * mod(b)) % 1000000007;
}
template<class T>
T bin_exp(T a, T b)
{
    T res = 1;
    T temp = 1;
    if (b <= 1)
        return a;
    if (b %2 == 0)
        res = bin_exp(a * a, b / 2);
    else
    {
        res *= a;
        temp = bin_exp(a, --b);
    }
    return res * temp;
}
template<class T>
T bin_expmod(T a, T b)
{
    T res = 1;
    T temp = 1;
    if (b <= 1)
        return a;
    if (b %2 == 0)
        res = bin_expmod(prodmod(a,a), b / 2);
    else
    {
        res = prodmod(a,res);
        temp = bin_exp(a, --b);
    }
    return prodmod(res , temp);
}

template<class T>
int digit(T a)
{
    vector<long long> dig = {
        0,
        9,
        99,
        999,
        9999,
        99999,
        999999,
        9999999,
        99999999,
        999999999,
        9999999999,
        99999999999,
        999999999999,
        9999999999999,
        99999999999999,
        999999999999999,
        9999999999999999,
        99999999999999999,
        999999999999999999,
        INT64_MAX};
    auto it = lower_bound(dig.begin(), dig.end(), a);
    int idx = (it - dig.begin());
    return idx;
}
template<class T>
int sumAllInts(T n){
    int a = 1;
    int su = 0;
    while(n){
        su += n%10;
        n/=10;
    }
    return su;
}
template<class T>
void split(char c,T s){
    int n = s.size();
    int i = 0;
    while ((cout<<s[i],i+=1) && (i<n) && (cout<<c<<' '));
}
void solve(){
    long long int N;
    cin>>N;
    long long int res=1;
    for(long long int i=2;i<=N;i++)
    {
        res=(res*i)%1000000007;
    }
    cout<<res%1000000007;
}
int main(){
    quickie;
    //txt;
    int t=1;
    while(t--){
        solve(); 
        newl; 
    } 
    return 0;
}

Measured memory_bytes: 3516
#include <stdio.h>
 
main(void)
{
int H, W,i, j;

while (1) {
	scanf("%d %d", &H, &W);
	if (H == 0 && W == 0)
	break;

	for (i = 1; i <= H; i++) {
		for (j = 1; j <= W; j++) {
			if (i % 2 == 0) {
				if (j % 2 == 0) printf("#");
			else printf(".");
			}
		else {
			if (j % 2 == 0) printf(".");
			else
			printf("#");
			}
		}
		printf("\n");
		}
	printf("\n");
	}
	return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h>
#define forinc(i,a,b) for(int i=a;i<=b;++i)
using namespace std;
const int N=1e5+1;
struct town {int x,y,id;}a[N],E[2*N];
bool X (town a,town b) {return a.x<b.x;}
bool Y (town a,town b) {return a.y<b.y;}
bool C (town a,town b) {return a.id<b.id;}
int n,cnt;
int id[N],res=0;
int root(int u)
{
    return (id[u]<0?u:(id[u]=root(id[u])));
}
void join(int u,int v,int c)
{
    if((u=root(u))==(v=root(v))) return;
    if(id[u]>id[v]) swap(u,v);
    id[u]+=id[v];
    id[v]=u;
    res+=c;
}
int main()
{
    //freopen("built.inp","r",stdin);
    cin>>n;
    forinc(i,1,n) {cin>>a[i].x>>a[i].y;a[i].id=i;}
    sort(a+1,a+n+1,X);
    forinc(i,1,n-1)
    {
        int c=a[i+1].x-a[i].x;
        E[++cnt]={a[i].id,a[i+1].id,c};
    }
    sort(a+1,a+n+1,Y);
    forinc(i,1,n-1)
    {
        int c=a[i+1].y-a[i].y;
        E[++cnt]={a[i].id,a[i+1].id,c};
    }
    sort(E+1,E+cnt+1,C);
    memset(id,-1,sizeof id);
    forinc(i,1,cnt) join(E[i].x,E[i].y,E[i].id);
    cout<<res;
}


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

using namespace std;

int main()
{
   int n;
   cin>>n;
   int h[n];
   int dp[n+1];

   for(int i=0;i<n;i++){
    cin>>h[i];
   }
   dp[0]=0;
   dp[1]=dp[0]+abs(h[0]-h[1]);
   for(int i=0;i<n;i++){

    if(i>=2){
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i-2]-h[i]));

    }
   }
   cout<<dp[n-1]<<endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
long long  mod = 1000000007;
long long A[100000];
int main()
{
	long long N, K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	long long c1 = 0, c2 = 0;
	long long an = 0;
	for (int i = 0; i < N; i++) {
		c1 = 0; c2 = 0;
		for (int j = 0; j < N; j++) {
			if (A[i] > A[j]) {
				if (i < j) {
					an = (an + (K * (K + 1) / 2)) % mod;
				}
				else {
					an = (an + (K * (K - 1) / 2)) % mod;
				}
			}
		}
	}
	cout << an;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#define PI acos(-1.0)

int main()
{
    int A, B, H, M;
    double deg1, deg2, deg, dist;

    scanf("%d %d %d %d", &A, &B, &H, &M);

    deg1 = 30*(double)H + 0.5*(double)M;
    deg2 = 30*(double)M/5;
    deg = deg1 - deg2;
    deg = PI/180 * deg;

    dist = sqrt((double)A*(double)A + (double)B*(double)B - cos(deg)*2*(double)A*(double)B);

    printf("%.20lf", dist);

    return 0;
}


Measured memory_bytes: 2588
#include <iostream>
#include <vector>
#include <queue>
#include<map>
#include<algorithm>
#include<set>
#include<iomanip>
#define rep(i,n) for(int i = 0;i < n;i++)
#define req(i,n) for(int i = 1; i<=n;i++)
#define rrep(i,n) for(int i = n-1;i >=0;i--)
#define ALL(a) a.begin(),a.end()
#define PI  acos(-1)
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
typedef long long int ll;
typedef long double ld;
const int MOD = 1e9 + 7;
int dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 }, sum = 0, h, w;
int main() {
    int x, y,sum=0,ans = 0; cin >> x >> y;
    req(i, x) {
        if (y * i % x == 0) ans++;
        sum++;
    }
    req(i, y) {
        if (x * i % y == 0) ans++;
        sum++;
    }cout << sum - ans/2 + 1 << endl;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define ALL(x) (x).begin(), (x).end()
#define REP(i ,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
typedef vector<int>vint;
typedef vector<ll>vll;
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int main()
{
    const ll INF = 1LL << 60;

    ll dp[100010];

    REP(i,100010)dp[i]=INF;

    dp[0] = 0;

    int N;
    cin >> N;
    vint H(N);
    cin >> H;
    for(int i=0; i<N; i++){
        chmin(dp[i+1],dp[i]+abs(H[i]-H[i+1]));
        chmin(dp[i+2],dp[i]+abs(H[i]-H[i+2]));
    }
    cout << dp[N-1] << endl;
}

Measured memory_bytes: 4564
#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
  
int main(){


  int N=0;
  string S;
  cin>>S;
  for(int i=0;i<4;i++){
  if(S.at (i)=='+'){
  N++;
  }
    else{
    N--;
    }
  }
  cout<<N<<endl;
}

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

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

int main(){
    int q,p,r;
    cin>>p>>q>>r;
    cout<<(p+q+r-max({p,q,r}))<<endl;
    return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
int N,M;
string A[55];
string B[55];
int main(){
    cin>>N>>M;
    for(int i=0;i<N;i++) cin>>A[i];
    for(int i=0;i<M;i++) cin>>B[i];
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            int fail=0;
            for(int k=0;k<M;k++){
                for(int s=0;s<M;s++){
                    if(i+k>=N){
                        fail=1;
                        break;
                    }
                    if(j+s>=N){
                        fail=1;
                        break;
                    }
                    if(A[i+k][j+s]!=B[k][s]){
                        fail=1;
                        break;
                    }
                }
            }
            if(!fail){
                cout<<"Yes";
                return 0;
            }
        }
    }
    cout<<"No";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    int l, r;
    cin >> l >> r;

    if (r - l >= 2019) {
        cout << 0 << endl;
    } else {
        int min = 2018;
        for (long long i = l; i <= r; i++) {
            for (long long j = i + 1; j <= r; j++) {
                if (min > i * j % 2019) {
                    min = i * j % 2019;
                }
            }
        }
        cout << min << endl;
    }
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

ls_A = len(set(A))

if ls_A >= 3:
  print("No")
  exit()
  
if max(A) - min(A) >= 2:
  print("No")
  exit()

if len(set(A)) == 1:
  if A[0] == N - 1:
    print("Yes")
    exit()
  if N // A[0] >= 2:
    print("Yes")
  else:
    print("No")
else:
  min_A = min(A)
  cnt_min = 0
  for a in A:
    if a == min_A:
      cnt_min += 1
  N -= cnt_min  
  if max(A) - cnt_min <= 0:
    print("No")
    exit()
  if N // (max(A) - cnt_min) >= 2:
    print("Yes")
  else:
    print("No")

Measured memory_bytes: 14564
#define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
#define dumpR(x) cerr<<"\x1b[31m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpY(x) cerr<<"\x1b[33m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpG(x) cerr<<"\x1b[32m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define dumpR(x) ;
#define dumpY(x) ;
#define dumpG(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fr<<','<<a.sc<<')';
    return out;
  }
}

lint readL(){
  lint res;
#ifdef ONLINE_JUDGE
  scanf("%I64d",&res);
#else
  scanf("%lld",&res);
#endif
  return res;
}
void printL(lint res){
#ifdef ONLINE_JUDGE
  printf("%I64d",res);
#else
  printf("%lld",res);
#endif
}

//const int INF=5e8;
struct uf{

  static const int MAXN=200005;
  int par[MAXN];
  int size[MAXN];
  void init(){
    memset(par,-1,sizeof(par));
    REP(i,MAXN) size[i]=1;
  }
  int root(int a){
    if(par[a]==-1) return a;
    return par[a]=root(par[a]);
  }
  void unite(int a,int b){
    a=root(a);b=root(b);
    if(a==b) return;
    if(size[a]<size[b]) swap(a,b);

    par[b]=a;
    size[a]+=size[b];
  }
  bool same(int a,int b){
    return root(a)==root(b);
  }
};



int n,q;
pair<lint,pi> es[800005];
lint mn[200005];
uf u;
const lint INF=1e18;
int main(){
  u.init();
  cin>>n>>q;
  int m=0;
  REP(i,n) mn[i]=INF;
  REP(i,q){
    int a,b,c;scanf("%d%d%d",&a,&b,&c);
    es[m++]=mp(c,mp(a,b));
    chmin(mn[a],(lint)c+1);
    chmin(mn[b],(lint)c+2);
  }
  REP(_,3){
    REP(i,n){
      chmin(mn[(i+1)%n],mn[i]+2);
    }
  }

  REP(i,n) if(mn[i]<INF) es[m++]=mp(mn[i],mp(i,(i+1)%n));

  sort(es,es+m);

  lint res=0;
  REP(i,m){
    if(!u.same(es[i].sc.fr,es[i].sc.sc)){
      u.unite(es[i].sc.fr,es[i].sc.sc);
      res+=es[i].fr;
    }
  }
  cout<<res<<endl;
  return 0;
}





Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
int main () {
    string S, T;
    cin >> S >> T;
    set<string> ans;
    string _S = S;
    for (int i = 0; i < S.length(); i++) {
        if (S[i] == '?') _S[i] = 'a';
    }
    for (int i = 0; i + T.length() <= S.length(); i++) {
        bool f = 1;
        string SS = _S;
        for (int j = 0; j < T.length(); j++) {
            if (S[i+j] == '?' || S[i+j] == T[j]) {
                SS[i+j] = T[j];
            }
            else {
                f = 0;
                break;
            }
        }
        if (f) {
            ans.insert(SS);
        }
    }
    if (ans.size()) {
        cout << *ans.begin() << endl;
    }
    else {
        puts("UNRESTORABLE");
    }
}

Measured memory_bytes: 256
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <vector>
#include <stdio.h>
#include <iostream>
#include <unordered_set>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <random>
#include <time.h>
#include <cassert>


#define prev askdnsajd
#define rank asasdmdnasd
#define next lsjndajbs
#define hash asmdklansd
#define index asdklnas
#define right sld
#define left sldl
using namespace std;

typedef long long ll;
typedef long double dbl;

template<class T>
void print(vector<T> s){
    for (T x : s)
        cout << x << " ";
    cout << endl;
}

mt19937 mrand(random_device{} ());
int rnd() {
    return mrand();
}

int get(int l){
    if (l % 3 == 0)
        return l / 3 * 2;
    if (l % 3 == 1)
        return l / 3 * 2 + 1;
    return l / 3 * 2 + 2;
}


void solve(){
    string s;
    cin >> s;
    int len = 1;
    int answer = 0;
    for (int i = 1; i < s.size(); i++){
        if (s[i] != s[i - 1]){
            answer += get(len);
            if (len % 3 != 2)
                len = 1;
            else
                len = 0;
        }
        else
            len++;
    }
    answer += get(len);
    if (len % 3 == 2)
        answer--;
    cout << answer << endl;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t-- > 0)
        solve();
    return 0;
}

Measured memory_bytes: 720
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>

using namespace std;
typedef long long ll;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;

int MOD = 1000000007;

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

int main(){
    std::ios_base::sync_with_stdio(false);

    string s; cin >> s;
    int n = s.size();  

    int ans =0;

    rep(i,n){
        if(i%2==0 && s[i]=='1') ans++;
        else if (i%2==1 && s[i]=='0') ans++;
    }

    int ans2 = 0;

    rep(i,n){
        if(i%2==0 && s[i]=='0') ans2++;
        else if (i%2==1 && s[i]=='1') ans2++;
    }

    cout << min(ans, ans2) << endl;

    return 0;
}


Measured memory_bytes: 512
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        while (0 < n) {
            n -= 1000;
        }
        int result = Math.abs(n);

        // 出力
        System.out.println(result);
    }
}


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

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

#define loop(i, n) for(int i = 0;i < n;i++)
#define IINF 2e9
#define MOD 1e9+7

int main(void){

    int n;
    cin >> n;

    vector<int> a(n);
    loop(i, n) cin >> a[i];

    ll ans = 0;

    loop(i, n-1){
        if(a[i] > a[i+1]){
            ans += a[i] - a[i+1];
            a[i+1] = a[i];
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4048
def counter(x):
        if x == 0:
                return 0
        return counter(x >> 1) + int(bin(x & 1), 2)

N = int(input())
A = []
x = [0] * N 
for i in range(N):
        A.append(int(input()))
        x[i] = [list(map(int, input().split())) for j in range(A[i])]

ans = 0 
for bits in range(1, 1 << N): 
        flag = 1 
        for i in range(N):
                if not int(bin(bits & (1 << i)), 2): 
                        continue
                for j in range(A[i]):
                        if int(bin((bits >> (x[i][j][0] - 1) & 1) ^ x[i][j][1]), 2): 
                                flag = 0 
        if flag:
                ans = max(ans, counter(bits))
print(ans)

Measured memory_bytes: 50904
#include <iostream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <iomanip>
#define REP(i,n) for (int i=0;i<(n);++i)
using namespace std;

int main(){
    int n, m;
     cin >> n >> m;
     char a[55][55], b[55][55];

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

     REP(i, m){
         REP(j, m){
             cin >> b[i][j];
         }
     }

     bool exist = false;

     REP(i, n){
         REP(j, n){
                if(i + m - 1 >= n || j + m - 1 >= n) continue;

            bool match = true;
            REP(y, m){
                 REP(x, m){
                    if(a[i + y][j + x] != b[y][x]) match = false;
                 }
            }
            if(match) exist = true;
         }
     }

     if(exist) cout << "Yes" << endl;
     else cout << "No" << endl;
    return 0;
}


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

using namespace std;

int main() {
  int N;
  int ans = 0;
  int m = 101;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    ans += tmp;
    if (m > tmp && tmp % 10 != 0) {
      m = tmp;
    }
  }
  if (ans % 10 != 0) {
    cout << ans << endl;
  } else if (m == 101) {
    cout << 0 << endl;
  } else {
    cout << ans - m << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<int,int>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(3);}} __init;
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; }
int main(){
ll h,n;
cin>>h>>n;
ll sum=0;
for(int i=0;i<n;i++){
  ll a;
  cin>>a;
  sum+=a;
}
if(sum>=h)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}

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

int search(char *str, char ch);

int main(){
 unsigned n;
 char **S;
 char ans[64];
 unsigned min = unsigned(-1), cur = 0;
 unsigned kosu;
 unsigned i;
 char ch;
 scanf("%d", &n);
 S = (char **)malloc(sizeof(char *) * n);
 for(i = 0; i < n; i++){
  S[i] = (char *)malloc(64);
  scanf("%s", S[i]);
 }
 for(ch = 'a'; ch <= 'z'; ch++){
  min = unsigned(-1);
  for(i = 0; i < n; i++){
   kosu = search(S[i], ch);
   if(min > kosu) min = kosu;
  }
  for(i = 0; i < min; i++){
   ans[cur++] = ch;
  }
 }
 ans[cur] = '\0';
 printf(ans);
 putchar('\n');
}

int search(char *str, char ch){
 unsigned count = 0, i;
 for(i = 0; str[i]; i++) if(str[i] == ch) count++;
 return count;
}

Measured memory_bytes: 128
h,w = map(int, input().split())
s = []
for i in range(h):
    s.append(input())
import sys
sys.setrecursionlimit(200000)
dy = [0,0,1,-1]
dx = [1,-1,0,0]
def dfs(y,x):
    global check
    global was
    was[y][x] = 1
    if s[y][x] == "#":
        check[0] += 1
    else:
        check[1] += 1
    for k in range(4):
        nx = x + dx[k]
        ny = y + dy[k]
        if nx >= 0 and ny >= 0 and nx < w and ny < h and s[ny][nx] != s[y][x] and not was[ny][nx]:
            dfs(ny,nx)
ans = 0
was = [[0 for i in range(w)] for j in range(h)]
for i in range(w):
    for j in range(h):
        if not was[j][i]:
            check = [0,0]
            dfs(j,i)
            ans += check[0] * check[1]
print(ans)

Measured memory_bytes: 148212
using namespace std;

#include <stdio.h>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <algorithm>

typedef pair<int, int> ii;
typedef vector<int> vi;

int n, m;
map<string, int> sn, sm;
string line;

signed main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> line;
    sn[line]++;
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> line;
    sm[line]++;
  }
  
  int max = 0;
  string best = "fjeiflskdj";
  for (auto p: sn) {
    int ne = p.second - (sm.count(p.first) ? sm[p.first] : 0);
    if (ne > max) {
      max = ne;
      best = p.first;
    }
  }
  
  cout << max << endl;
}


Measured memory_bytes: 256
#include <cstdio>
int N;
int F[100][14];
int P[100][15];
int main() {
    scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 10; j++) scanf("%d", &F[i][j]);
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 11; j++) scanf("%d", &P[i][j]);
    }
    int res = -(1<<30);
    for (int b = 1; b < (1 << 10); b++) {
        int cc = 0;
        for (int i = 0; i < N; i++) {
            int c = 0;
            for (int j = 0; j < 10; j ++) {
                if ((b>>j & 1) and F[i][j]) c++;
            }
            cc += P[i][c];
        }
        if (res < cc ) res = cc;
    }
    printf("%d\n", res);
}



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

int M,N;

#define MAX 8000000

bool ok[MAX+1];

void solve(){
    for(int i=1;i<MAX;i++) ok[i]=false;

    int n=0;
    int ans=0;
    for(int i=M;;i++){
        if(ok[i]) continue;
        if(n==N){
            ans=i;
            break;
        }
        n++;
        ok[i]=true;
        for(int j=2;j*i<MAX;j++){
            ok[j*i]=true;
        }
    }

    cout<<ans<<endl;
}

int main(){
  while(1){
      cin>>M>>N;
      if(M==0&&N==0) break;
      solve();
  }

  return 0;
}



Measured memory_bytes: 10936
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set; 

int main(){
    fastio
    int k , x ; 
    cin >> k >> x ; 
    k-- ; 
    for(int i=x-k;i<=x+k;i++){
    	cout << i << ' ' ; 
    }
    return 0 ;
}


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

using namespace std;
using ll = long long int;

int main() {
    ll N, A, B;
    cin >> N >> A >> B;
    ll K = (A + B);
    ll ans = (N / K) * A;
    N %= K;
    ans += min(N, A);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#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)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> memo(1000001);
	REP(i, N) {
		cin >> A[i];
		memo[A[i]]++;
	}
	int res = 0;
	REP(i, N) {
		if (memo[A[i]] > 1) continue;
		if (A[i] == 1) {
			++res;
			continue;
		}
		if (memo[1]) {
			continue;
		}
		bool ok = true;
		for (ll j = 2; j * j <= A[i]; ++j) {
			if (A[i] % j == 0 && (memo[j] || memo[A[i] / j])) {
				ok = false;
				break;
			}
		}
		if (ok) ++res;
	}
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 7872
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    int n, m, Q;
    cin >> n >> m >> Q;
    vector<vector<int>> s(n+1, vector<int>(n+1, 0));
    REP(i,m) {
        int l, r;
        cin >> l >> r;
        s[r][l]++;
    }

    REP(i,n) for(int j = 1; j <= n; ++j) s[i+1][j] += s[i][j];
    for (int i = 1; i <= n; ++i) REP(j,n) s[i][j+1] += s[i][j];
    
    REP(i,Q) {
        int p, q;
        cin >> p >> q;
        int ans = s[q][q]-(s[q][p-1]+s[p-1][q])+s[p-1][p-1];
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 1920
#include<bits/stdc++.h>
using namespace std;
int a[100005];
int main()
{
    int n,i,num,ans=1; cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>num;
        a[num]++;
    }
    for(i=1;i<=100002;i++)
        ans=max(ans,a[i-1]+a[i]+a[i+1]);
    ans=max(ans,a[0]+a[1]);
    cout<<ans;
}


Measured memory_bytes: 640