akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
  ll n;
  cin >> n;
  vector<ll> h(n);
  for (ll i = 0; i < n; i++)
  {
    cin >> h[i];
  }
  for (ll i = 0; i < n - 1; i++)
  {
    if (h[i] < h[i + 1])
    {
      h[i + 1]--;
    }
  }
  for (ll i = 0; i < n - 1; i++)
  {
    if (h[i] > h[i + 1])
    {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 4048
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>

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

using namespace std;
int main() {
	int a, b, c;
	cin >> a >> b >> c;

	if (b - a == c - b)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;

	return 0;
}

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

using namespace std;

#define roop(i, n) for(int i = 0;i < n;i++)
#define ll long long int

int main(void){

    int n;
    cin >> n;

    for(int i = 1;i <= n;i++){
        if(i % 3 == 0) cout << " " << i;
        else{
            int temp = i;
            while(temp > 0){
                if(temp % 10 == 3) {
                    cout << " " << i;
                    break;
                }
                temp /= 10;
            }
        }
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 3096
import collections
n = int(input())

# 素因数分解 参考: https://note.nkmk.me/python-prime-factorization/
def f_prime(n):
    ANS = []
    # P = [2]

    while n % 2 == 0:
        ANS.append(2)
        n = n//2
    m = 3
    # P.append(m)
    while m ** 2 <= n:
        while n % m == 0:
            ANS.append(m)
            n = n//m
        m += 2
    
    if n != 1:
        ANS.append(n)
    return ANS

# print(f_prime(n))

c = collections.Counter( f_prime(n) )
c_key = list(c.keys())

count = 0
for k in c_key:
    t = c[k]
    s = 1
    while t >= s:
        count += 1
        t -= s
        s += 1 

print(count)


Measured memory_bytes: 9468
#include<stdio.h>                                                    
int main(void)
{
   char a;
   scanf("%s",&a);

   if (a=='A') printf("T\n");
   
   else  if(a=='G') printf("C\n");
   
   else  if(a=='T') printf("A\n");
   
   else  if(a=='C') printf("G\n");
   

   return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long i=0;i<n;i++)
int main()
{
    int n,k;
    cin >> n >> k;
    int h[n];
    rep(i,n) cin >> h[i];
    sort(h, h + n);
    int d = h[n-1] - h[0];
    rep(i, n - k + 1){
        if ((h[i+k-1]-h[i])<d) d = h[i+k-1]-h[i];
    }
    cout << d << endl;
    return 0;
}

Measured memory_bytes: 640
//2019.7.14 by ljz
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define LL long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f
#define eps 5.6e-8
#define RG register
#define db double
#define lb long db
#define pc(x) __builtin_popcount(x)
typedef pair<int,int> Pair;
#define mp make_pair
#define fi first
#define se second
#define pi acos(-1.0)
#define pb push_back
#define gc getchar
//inline char gc() {
//    static char buf[100000],*p1,*p2;
//    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
inline int read() {
    res s=0,ch=gc();
    while(ch<'0'||ch>'9')ch=gc();
    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
    return s;
}
//inline int read() {
//    res s=0,ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc();
//    while(ch<'0'||ch>'9')ch=gc();
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s;
//}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
inline void swap(res &x,res &y) {
    x^=y^=x^=y;
}
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
namespace MAIN{
    int n;
    inline void MAIN(){
        n=read();
        if(n==(n&-n)){puts("No");return;}
        puts("Yes");
        for(res i=2;i<=n-1;i+=2){
            printf("%d %d\n",i+1+n,i+n);
            printf("%d %d\n",i+n,1);
            printf("%d %d\n",1,i+1);
            printf("%d %d\n",i+1,i);
        }
        printf("%d %d\n",1+n,3+n);
        if(n%2==0){
            res p=n^1;
            res i=int(log2(p));
            res q=1<<i,r=p^q;
            if(q&1);
            else q+=n;
            if(r&1);
            else r+=n;
            printf("%d %d\n",n,q);
            printf("%d %d\n",n+n,r);
        }
    }
}
int main() {
//    srand((unsigned)time(NULL));
//    freopen("zao.in","r",stdin);
//    freopen("std.out","w",stdout);
    MAIN::MAIN();
    return 0;
}

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

int main(void){
    char input[1002];
    scanf("%s", input);
    int len = strlen(input);

    if( input[len-1] == 's'){
        input[len] = 'e';
        input[len+1] = 's';
        input[len + 2] = '\0';
    }else{
        input[len] = 's';
        input[len + 1] = '\0';
    }
    printf("%s", input);
    return 0;
    
}

Measured memory_bytes: 1728
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>

bool ok(const std::vector<int> &a, int k) {
  std::vector<int> dp(k+1, -1);
  dp[0] = 0;
  for (size_t i=0; i<a.size(); ++i) {
    for (int j=0; j<=k; ++j) {
      if (dp[j] >= 0) {
        dp[j] = 1;
      } else if (j < a[i] || dp[j-a[i]] <= 0) {
        dp[j] = -1;
      } else {
        dp[j] = dp[j-a[i]] - 1;
      }
    }
  }
  return dp[k] >= 0;
}

int main() {
  char buf[8192];
  scanf("%s", buf);
  std::string s=buf;

  int x, y;
  scanf("%d %d", &x, &y);

  std::vector<int> d[2];
  int k=0, cur=0;
  for (size_t i=0; i<s.length(); ++i) {
    if (s[i] == 'F') {
      ++cur;
    } else {
      d[k].push_back(cur);
      cur = 0;
      k ^= 1;
    }
  }
  d[k].push_back(cur);

  x -= d[0].front();
  d[0].erase(d[0].begin());
  x = std::abs(x);
  y = std::abs(y);

  std::sort(d[0].begin(), d[0].end());
  std::sort(d[1].begin(), d[1].end());

  int xs=std::accumulate(d[0].begin(), d[0].end(), 0);
  int ys=std::accumulate(d[1].begin(), d[1].end(), 0);
  if (xs < x || ys < y)
    return !printf("No\n");

  if (xs == x && ys == y)
    return !printf("Yes\n");

  if ((xs-x)%2 || (ys-y)%2)
    return !printf("No\n");

  if (ok(d[0], (xs-x)/2) && ok(d[1], (ys-y)/2)) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
}


Measured memory_bytes: 384
import java.util.*;

public class Main {

    static int mod = 1_000_000_007;
    static long pow(long a,long n) {
        long res=1;
        while (n>0) {
            if ((n-n/2*2)==1) {
                res=res*a%mod;
            }
            a=a*a%mod;
            n>>=1;
        }
        return res;
    }

    static List<Integer> divisor(int n) {
        List<Integer> list = new ArrayList<Integer>();
        for (int i=1;i<=Math.sqrt(n);i++) {
            if (n%i==0) {
                list.add(i);
                if (i*i!=n) {
                    list.add(n/i);
                }
            }
        }
        Collections.sort(list);
        return list;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        long ans = 0L;

        long[] val = new long[K+1];
        for (int i=1;i<=K;i++) {
            val[i] = pow(K/i, N);
        }
        for (int i=K;i>=1;i--) {
            ArrayList<Integer> list = new ArrayList<Integer>(divisor(i));
            for (Integer j : list) {
                if (j==i) continue;
                else val[j]-=val[i];
            }
        }
        for (int i=1;i<=K;i++) {
            ans = (ans+(long)i*val[i])%mod;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 62072
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>

#define REP(idx, end) for(int idx = 0; idx < end; ++idx)
#define DBG(x) cerr << #x << ": " << x << "\n"

using namespace std;
typedef long long lint;
const int MOD = 1000000007;

int main() {

	cin.tie(0);

	int N, x = 0, max = 0;
	string str;
	cin >> N;
	cin >> str;

	REP(i, N) {
		if (str[i] == 'I')x++;
		else x--;
		max = max < x ? x : max;
	}

	cout << max;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int n, k;
  scanf("%d %d", &n, &k);
  
  int a[n];

  int *p = a;
  for (; p < a + k; p++)
    scanf("%d", p);
  
  int *q = a;
  for (; p < a + n; p++, q++)
  {
    scanf("%d", p);
    if (*q < *p)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}


Measured memory_bytes: 2856
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
#define P pair<int,int>
const ll MOD=1e9+7;
const int INF=2e9;
const double PI=acos(-1);

const int MAX=200010;

ll fac[MAX], finv[MAX], inv[MAX];

void cmbInit() {
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for (int 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 cmb(int n, int k){
    if (n<k) return 0;
    if (n<0 || k<0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}


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

    int s;
    cin >> s;
    cmbInit();
    ll ans=0;
    repr(i,1,s/3+1) {
        ll tans=cmb(s-3*i+i-1,i-1);
        ans=(ans+tans)%MOD;
    }
    cout << ans << endl;
    
    return 0;
}


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

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

    int left = n / 2 / 2;
    int right = n / 2 + (n / 2 / 2);

    int l = 1, r = 2;
    if ((n / 2) % 2 == 1 && n % 2 == 1) {
        l = 2, r = 1;
        right++;
    }

    for (; l <= m; l += 2) {
        cout << left << ' ' << left + l << '\n';
        left--;
    }

    for (; r <= m; r += 2) {
        cout << right << ' ' << right + r << '\n';
        right--;
    }

    return 0;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define ll          long long int
#define uu          first
#define vv          second
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define INF         1e9
#define fastRead    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;

const int MAX = 1e6 + 6;
int main()
{
    fastRead;
    int n;
    cin>>n;
    vector<ll>vec(n);
    vector< vector<ll> > dp( n+1, vector<ll>(n+1) );
    for(ll& x : vec) cin>>x;
    
    for(int i =0 ; i <n ; i++) {
        if(n&1) dp[1][i] = vec[i];
        else dp[1][i] = -vec[i];
    }
    
    for(int i = 2; i <= n ; i++ ) {
        for(int j =0 ; j + i - 1 < n ; j++ ) {
            if( ((n%2) ^ (i%2))  == 0 )
                dp[i][j] = max(dp[i-1][j] + vec[i + j - 1], dp[i-1][j+1] + vec[j]);
            else
                dp[i][j] = min(dp[i-1][j] - vec[i + j - 1], dp[i-1][j+1] - vec[j]);
            
        }
    }
    
    cout<<dp[n][0]<<'\n';
    return 0;
}

Measured memory_bytes: 73672
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>
#include <random>
#include <complex>
#include <functional>

//using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; ++i)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

using ll =  long long;

constexpr int inf = 1e9 + 7;
constexpr ll infll = 1ll << 60ll;
constexpr ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

template<typename T> void chmax(T& a, T b) { a = std::max(a, b); }
template<typename T> void chmin(T& a, T b) { a = std::min(a, b); }
template<typename T> void chadd(T& a, T b) { a = a + b; }

using pint = std::pair<int, int>;
using pll = std::pair<ll, ll>;

namespace {  // 名前なし名前空間
	// gcd, lcm は C++17 でstdに標準入りしたので言語のバージョンに注意
	// 最大公約数
	ll gcd(ll a, ll b) {
		if (b == 0) return a;
		return gcd(b, a % b);
	}

	// 最小公倍数
	ll lcm(ll a, ll b) {
		return a / gcd(a, b) * b;
	}
}


int main() {

	int n;
	std::cin >> n;
	std::vector<int> p(n);
	rep(i, n) std::cin >> p[i];

	int ans = 0;

	int mi = inf;
	rep(i, n) {
		mi = std::min(mi, p[i]);
		if (p[i] <= mi) {
			++ans;
		}
	}

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

	return 0;
}

Measured memory_bytes: 1024
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int i, j, cnt;
		int ans = 0;
		for(i = 1; i <= n; i++) {
			if(i % 2 == 0)
				continue;
			cnt = 0;
			for(j = 1; j <= i; j++) {
				if(i % j == 0)
					cnt++;
			}
			if(cnt == 8)
				ans++;
		}
		out.print(ans);
		out.flush();
	}
	public static int gcd(int a, int b) {
		if(b == 0)
			return a;
		return gcd(b, a % b);
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

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


Measured memory_bytes: 21332
#include<iostream>
#include<vector>
using namespace std;
long calcComb(int a, int b);
long mod = 1000000007;
long long modpow(long a, int p);

int main(){
    int N,M;
    cin >> N >> M;
    long ans = 1;
    int MNokori = M;

    for (int i = 2; i*i <= MNokori; i++){
        if (MNokori % i == 0){
            int cnt = 0;
            while (MNokori % i == 0){
                cnt++; 
                MNokori /= i;
            }
            ans *= calcComb(N + cnt - 1, N-1);
            ans %= mod;
        }
    }
    if (MNokori != 1){
        ans *= calcComb(N, N-1);
        ans %= mod;
    }
    cout << ans << endl;
    cerr << calcComb(4,2) << endl;
}

//aCb
long calcComb(int a, int b){
    if (b > a-b) return calcComb(a,a-b);
    long ansMul =1;
    long ansDiv =1;
    for(int i = 0; i < b; i++)
    {
        /* code */
        ansMul *= (a-i);
        ansDiv *= (i+1);
        ansMul %= mod;
        ansDiv %= mod;
    }
    //ansDivの逆元を使う。
    long ans = ansMul * modpow(ansDiv, mod -2) % mod;
    return ans;
}


//aのp乗を求めるアルゴリズム
//p=62>31>30>15>14>7>6>3>2>1>0
//計算量はO(logp)になる。
long long modpow(long a, int p){
    if (p == 0) return 1;
    if (p%2 == 0){
        //p even
        int halfP = p/2;
        long long half = modpow(a, halfP);
        //a^(p/2)をhalfとしてhalf*halfを計算
        return half * half % mod;
    }
    else {
        return a * modpow(a, p-1) % mod; 
    }
}

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

using namespace std;

int main() {

  string inp;
  cin >> inp;
  for(int i = 0;i < inp.size();i++){
    if(i % 2 == 1 && inp[i] == 'R'){
      cout << "No";
      return 0;
    }else if(i % 2 == 0 && inp[i] == 'L'){
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}


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

int main(){
  cout << fixed <<  setprecision(12);
  double a, r ,X ,Y;
  a = 3.141592653589;
  cin>>r;
  X = r * r * a;
  Y =(r + r) * a;
  cout<< X << " " << Y << endl;



  return(0);
    }
  


Measured memory_bytes: 3260
#include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=n-1;i>=0;++i)
#define rep1(i,n) for(int i=1; i<=n; ++i)
#define per1(i,n) for(int i=n; i>=1; ++i)
#define debug cout << "line : " << __LINE__ << " debug" << endl
#define Dcout(N) cout << setprecision(20) << N << endl
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF 1e9
#define MOD 1000000007
typedef long long ll;
//------------------------------------------------------------------------

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s; cin >> s;
  int ans=0;
  rep(i,s.size()){
    if(s[i]=='1') ans++;
  }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
#define inf 1e9+7
using namespace std;
typedef long long ll;
const double pi=acos(-1);

int main(){
    int n;
    cin >> n;
    vector<int> v(n);
    vector<int> c(n);
    for(int i=0;i<n;i++) cin >> v[i];
    for(int i=0;i<n;i++) cin >> c[i];
    int ans=0;
    for(int i=0;i<n;i++){
        if(v[i]-c[i]>0) ans+=v[i]-c[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 3568
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<tuple>
#include<utility>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<iomanip>
#include<map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
const int INF = 1e9 + 7;
int dx[8] = { 1,0,-1,0,1,1,-1,-1 };
int dy[8] = { 0,1,0,-1,1,-1,1,-1 };




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

	set <int> st;

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

		if (st.count(a[i])) {
			st.erase(a[i]);
		}

		else {
			st.insert(a[i]);
		}



	}


	cout << st.size() << endl;

	return 0;
}

Measured memory_bytes: 5376
from collections import deque

S = list(input())
sign = deque()
times = deque()

# 1からnumberまでの総和
def total(number):
    answer = (number*(number+1))//2
    return answer


# 記号が何回続くか求める O(N)
sign.append(S[0])
count = 1
for i in range(1,len(S)):
    if S[i] == S[i-1]:
        count += 1
    else:
        times.append(count)
        sign.append(S[i])
        count = 1
times.append(count)

sign = list(sign)
times = list(times)

answer = 0
for i in range(len(sign)):
    if i == 0 and sign[i] == ">":
        answer += total(times[i])
        continue
    if i == len(sign)-1 and sign[i] == "<":
        answer += total(times[i])
        continue
    if sign[i] == "<":
        answer += total(max(times[i],times[i+1]))
        answer += total(min(times[i],times[i+1])-1)

print(answer)


Measured memory_bytes: 89820
//  ____            _                  _                       _       _
// |  _ \ _   _ ___| |_    ___ _ __   | |_ ___ _ __ ___  _ __ | | __ _| |_ ___
// | |_) | | | / __| __|  / __| '_ \  | __/ _ \ '_ ` _ \| '_ \| |/ _` | __/ _ \
// |  _ <| |_| \__ \ |_  | (__| |_) | | ||  __/ | | | | | |_) | | (_| | ||  __/
// |_| \_\\__,_|___/\__|  \___| .__/___\__\___|_| |_| |_| .__/|_|\__,_|\__\___|
//                            |_| |_____|               |_|

//https://github.com/manta1130/Competitive_Programming_Template_Rust

#[macro_use]
mod input {

    use std;
    use std::io;

    const SPLIT_DELIMITER: char = ' ';

    #[macro_export]
    #[allow(unused_macros)]
    macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

    #[allow(dead_code)]
    pub fn input_line_str() -> String {
        let mut s = String::new();
        io::stdin().read_line(&mut s).unwrap();
        s.trim().to_string()
    }

    #[allow(dead_code)]
    pub fn p<T>(t: T)
    where
        T: std::fmt::Display,
    {
        println!("{}", t);
    }

    #[allow(dead_code)]
    pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
    where
        T: std::str::FromStr,
    {
        let mut v: Vec<Vec<T>> = Vec::new();

        for _ in 0..line {
            let vec_line = input_vector();
            v.push(vec_line);
        }
        v
    }

    #[allow(dead_code)]
    pub fn input_vector<T>() -> Vec<T>
    where
        T: std::str::FromStr,
    {
        let mut v: Vec<T> = Vec::new();

        let s = input_line_str();
        let split_result = s.split(SPLIT_DELIMITER);
        for z in split_result {
            let buf = match z.parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            v.push(buf);
        }
        v
    }

    #[allow(dead_code)]
    pub fn input_vector_row<T>(n: usize) -> Vec<T>
    where
        T: std::str::FromStr,
    {
        let mut v = Vec::with_capacity(n);
        for _ in 0..n {
            let buf = match input_line_str().parse() {
                Ok(r) => r,
                Err(_) => panic!("Parse Error"),
            };
            v.push(buf);
        }
        v
    }

    pub trait ToCharVec {
        fn to_charvec(&self) -> Vec<char>;
    }

    impl ToCharVec for String {
        fn to_charvec(&self) -> Vec<char> {
            self.to_string().chars().collect::<Vec<_>>()
        }
    }
}

use input::*;

fn main()
{
    let s=input_line_str().to_charvec();
    for i in 1..s.len(){
        if s[i]==s[i-1]{
            println!("Bad");
            return;
        }
    }        
    println!("Good");
}



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

int main() {
  long long N, D;
  cin >> N >> D;
  vector<long long> vec(N);
  long long X, Y;
  for (int i = 0; i < N; i++) {
    cin >> X >> Y;
    vec.at(i) = X*X + Y*Y;
  }
  int counter = 0;
  for (int i = 0; i < N; i++) {
    if (vec.at(i) <= D*D)
      counter++;
  }
  cout << counter << endl;
}

Measured memory_bytes: 4780
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_p(x) cerr<<#x": "<<(x).first<<' '<<(x).second<<endl
#define dbg_v(x, n) {cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<(x)[_]<<' ';cerr<<endl;}
#define all(v) v.begin(), v.end()
#define fi first
#define se second
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

template<typename T1, typename T2>
ostream& operator <<(ostream &out, const pair<T1, T2> &item) {
	out << '(' << item.first << ", " << item.second << ')';
	return out;
}

template <typename T>
ostream& operator <<(ostream &out, const vector<T>& v) {
	for(const auto &item : v) out << item << ' ';
	return out;
}

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

	int a, b, c;

	cin >> a >> b >> c;
	if(a == b && b == c) cout << "No\n";
	else if(a == b || b == c || c == a) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}



Measured memory_bytes: 764
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define PN cout << endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (n-1); i >= (int)(m); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - (a)) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - (a)) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

/*
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
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; }
*/

/*
vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}
*/

/*
ll ncr[100][100];
ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

ll npr[100][100]={};
ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

ll nHr(int n,int r){ret nCr(n+r-1,r);}
*/

///////////////////////////////////////////////////////////////////////////



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

    ll ans = 0;

    //rep(i,k,n+2){
    for(ll i = k; i < n+2;i++){
	ans += (n+(n-i+1))*i/2 - (i-1)*i/2 + 1 ;
	ans = mod(ans);
	//PS((n+(n-i+1))*i/2);
	//PS((i-1)*i/2 );
       	//P(ans);
    }
    P(ans);
    return  0;
}


Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
template <typename T>
inline void readin(T &x) {
	x = 0;
	T fh = 1;
	char ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') fh = -1;
	for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
	x *= fh;
}
inline void d_read(double &x) {
	x = 0.0;
	int fh = 1;
	char ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') fh = -1;
	for (; isdigit(ch); ch = getchar()) x = x * 10 + (ch ^ 48);
	if (ch == '.') {
		double num = 1.0;
		ch = getchar();
		for (; isdigit(ch); ch = getchar()) x = x + (num /= 10) * (ch ^ 48);
	}
	x *= fh;
}

template <typename T>
inline void wt(T x) {
	if (x > 9) wt(x / 10);
	putchar(x % 10 + 48);
}
template <typename T>
inline void writeln(T x, char c) {
	if (x < 0) {
		putchar('-');
		x = -x;
	}
	wt(x);
	putchar(c);
}
char s[200005];
int main() {
	scanf("%s", s + 1);
	int ans = 0;
	int len = strlen(s + 1);
	for (int i = 1; i <= len; i ++) {
		ans += s[i] - '0';
	}
	if (ans % 9 == 0) puts("Yes");
	else puts("No");
	return 0;
}




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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

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

int main(){

    int n, m;
    cin >> n >> m;
    Graph G(n);

    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    vector<int> dist(n, -1);
    queue<int> que;
    vector<int> pre(n, -1);
    dist[0] = 0;
    que.push(0);

    while(!que.empty()){
        int v = que.front();
        que.pop();
        for(auto nv : G[v]){
            if(dist[nv] != -1) continue;
            dist[nv] = dist[v] + 1;
            pre[nv] = v;
            que.push(nv);
        }
    }

    cout << "Yes" << endl;
    for(int i = 1; i < n; i++){
        cout << pre[i] + 1 << endl;
    }

    return 0;
}

Measured memory_bytes: 10676
#include <iostream>

using namespace std;

int main() {
	int n, a, b;

	std::cin >> n;
	if (n == 1) {
		std::cout << "Hello World" << std::endl;
	}
	else {
		std::cin >> a;
		std::cin >> b;
		std::cout << a + b << std::endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ss second
#define ff first
#define mk make_pair
#define vec vector<int> 
#define pb push_back
#define finput ifstream cin;cin.open("in.txt")
#define foutput ofstream cout;cout.open("out.txt")
void div(int n,vector<int> &d){ 
    for (int i=1; i<=sqrt(n); i++){ 
        if (n%i == 0){
        	if (n/i == i) 
                d.pb(i); 
            else{ 
            	d.pb(i);
            	d.pb(n/i);
            } 
        } 
    }
} 
int main(){
	//finput;
	ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n,m;
    cin>>n>>m;
    vector<int> d;
    int ans=1;
    div(m,d);
    sort(d.begin(),d.end());
    for(int i=0;i<d.size();i++){
    	if(d[i]>=n){
    		ans=m/d[i];
    		break;
    	}
    }
    cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i,s,n) for(int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
    ll a, b, c;
    cin >> a >> b >> c;
    ll count = 0;
    if(a == b && b == c){
        if(a==1)
            cout << 0 << endl;
        else
            cout << -1 << endl;
    }else{
        int i = 0;
        while(1) {
            if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0) {
                cout << i << endl;
                break;
            }
            int tmp_a = a, tmp_b = b, tmp_c = c;
            a = (tmp_b + tmp_c) / 2;
            b = (tmp_a + tmp_c) / 2;
            c = (tmp_a + tmp_b) / 2;
            i++;
        }
    }
        return 0;
}

Measured memory_bytes: 256
class Dice():
    top=1
    n=2
    e=4
    w=3
    s=5
    dice=[1,2,3,4,5,6]

    top_front_right=[[-1,3,5,2,4,-1],[4,-1,1,6,-1,3],[2,6,-1,-1,1,5],
                     [5,1,-1,-1,6,2],[3,-1,6,1,-1,4],[-1,4,2,5,3,-1]]

    def __init__(self,num):
        self.dice=num

    def roll(self,direction):
        if(direction=="N"):
            self.top,self.n,self.s = self.n,7-self.top,self.top
        elif(direction=="E"):
            self.top,self.e,self.w = self.e,7-self.top,self.top
        elif(direction=="W"):
            self.top,self.e,self.w = self.w,self.top,7-self.top
        elif(direction=="S"):
            self.top,self.n,self.s = self.s,self.top,7-self.top




d=list(map(int,input().split()))
dice=Dice(d)
n=int(input())
for i in range(n):
    top,front=map(int,input().split())
    print(d[dice.top_front_right[d.index(top)][d.index(front)]-1])



Measured memory_bytes: 5616
z=60,t;p(){printf("0%d:%02d:%02d\n",t/z/z,t/z%z,t%z);}main(h,m,s){for(;scanf("%d%d%d",&h,&m,&s),~h;p(),t*=3,p())t=7200-h*z*z-m*z-s;exit(0);}

Measured memory_bytes: 612
s = input()
count = 1; memo = 0; x = 0
for i in range(1, len(s)):
    if s[i-1] == "<" and s[i] == ">":
        x += count*(count-1)//2
        memo = count
        count = 1
    elif s[i-1] == ">" and s[i] == "<":
        x += count*(count-1)//2+max(count, memo)
        memo = 0
        count = 1
    else:
        count += 1
else:
    if s[-1] == "<":
        x += count*(count+1)//2
    else:
        x += count*(count-1)//2+max(count, memo)
print(x)

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

int main() {
  int x;
  cin >> x;
  for(int i = x; i < INT_MAX; i++) {
    bool a = true;
    for(int j = 2; j < i; j++) {
      if(i%j == 0) a = false;
    }
    if(a) {
      cout << i << endl;
      break;
    }
  }
}

Measured memory_bytes: 256
n = int(input())

h = {}


def calc(x, y, z):
    return x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x


for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            a = calc(x, y, z)
            if a not in h:
                h[a] = 1
            else:
                h[a] += 1

for i in range(1, n + 1):
    if i not in h:
        print(0)
    else:
        print(h[i])

Measured memory_bytes: 11512
/* ex4-2
  kt125 */

#include<stdio.h>
#include<math.h>

int main(void){
    int short_hand, long_hand, hour, minute;  //短針長、長針長、時間、分
    scanf("%d %d %d %d", &short_hand, &long_hand, &hour, &minute);

    double short_angle, //短針の０時からの角度
           long_angle, //長針の０分からの角度
           angle; //長針と短針のなす角

    short_angle = 2 * M_PI * ( hour + minute / 60.0) / 12 ;
    long_angle = 2 * M_PI * minute / 60.0;
    angle = fabs(short_angle - long_angle);

    double ans; //余弦定理で解答を導く
    ans = sqrt(pow(long_hand, 2) + pow(short_hand, 2) 
          - 2 * long_hand * short_hand * cos(angle));

    printf("%.20lf", ans);
    return 0;
}


Measured memory_bytes: 2592
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>

#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const ll INF = 1e9;
const ll MOD = 1e9 + 7;

int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };




/******************************************************************************************/



int main() {

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

	map<vector<ll>, ll> mp;

	for (int i = 0; i < n; i++)
	{
		//out << "i= " << i << endl;
		vector<ll> cnt(26, 0);
		for (int j = 0; j < 10; j++)
		{
			//cout << "j" << endl;
			cnt[a[i][j] - 'a']++;
		}
		mp[cnt]++;
	}

	//cout << "a" << endl;
	ll ans = 0;
	for (auto itr : mp) {
		ans += (ll)itr.second*(itr.second - 1) / 2;
	}

	cout << ans << endl;











	return 0;
}


Measured memory_bytes: 36992
#include <bits/stdc++.h>
using namespace std;
typedef long long int lo;
lo dp[500005],n,arr[500005];
lo f(lo i){
	if(i>n)return 1e10;
	if(i==n) return 0;
	if(dp[i]!=-1)return dp[i];
	return dp[i]=min(f(i+1)+abs(arr[i]-arr[i+1]),f(i+2)+abs(arr[i]-arr[i+2]));
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
    memset(dp,-1,sizeof dp);
    cin >> n;
    for(lo i=1;i<=n;i++){
    	cin >> arr[i];
    }
    cout << f(1) << endl;
}

Measured memory_bytes: 8320
import java.io.*;
class Program{

}
class Main{
    public static void main(String[] args) throws IOException {
        Program obj = new Program();
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String ip[];
        int N,M,C;
        int A[],B[];
        ip = in.readLine().split(" ");
        N = Integer.parseInt(ip[0]);
        M = Integer.parseInt(ip[1]);
        C = Integer.parseInt(ip[2]);
        int count = 0,score=0;
        A = new int[M]; B = new int[M];
        ip = in.readLine().split(" ");
            for(int i=0;i<M;i++) B[i] = Integer.parseInt(ip[i]);
        while(--N>=0){
            ip = in.readLine().split(" ");
            score = 0;
            for(int i=0;i<M;i++) {
                A[i] = Integer.parseInt(ip[i]);
                score+=B[i]*A[i];
            }
            if (score+C>0) count++;
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 22740
s = input()

list_s = [int(c) for c in s]

test_01 = []
test_10 = []

for i in range(len(s)):
    test_01.append(i % 2) 
    test_10.append((i+1) % 2)

cost01 = 0
cost10 = 0


for i in range(len(s)):
    cost01 += abs(test_01[i] - list_s[i])
    cost10 += abs(test_10[i] - list_s[i])

print(min(cost01,cost10))

Measured memory_bytes: 5620
#include <bits/stdc++.h>
using namespace std;
#define M 100010
vector<int> edges[M];
int dist[M];
int in_degree[M];
bool visited[M];

void dfs(int a){
    assert(!visited[a]);
    visited[a] = true;
    for(int b : edges[a]){
        dist[b] = max(dist[b], 1+dist[a]);
        --in_degree[b];
        if(in_degree[b] == 0)
            dfs(b);
    }
}

int main()
{
    int n,m;
    cin>>n>>m;
    while(m--){
        int a,b;
        cin>>a>>b;
        edges[a].push_back(b);
        ++in_degree[b];
    }
    for(int i=1;i<=n;i++){
        if(!visited[i] and in_degree[i]==0)
            dfs(i);
    }
    int ans=0;
    for(int i=1;i<=n;i++)
        ans = max(ans, dist[i]);
    cout<<ans<<"\n";
    return 0;
}


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

int main(void){
  int n, temp;
  cin >> n;
  int t[n], b[n];
  for(int i = 0; i < n; i++) cin >> t[i];
  for(int i = 0; i < n; i++) cin >> b[i];
  for(int i = 1; i < n; i++) t[i] += t[i - 1];
  for(int i = n - 1; i > 0; i--) b[i - 1] += b[i];
  int ans = 0;
  for(int i = 0; i < n; i++){
    temp = t[i] + b[i];
    ans = max(ans, temp);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC targett("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define dbg(x) cout<<#x<<" = "<<x<<'\n';
#define fri(i,s,n) for(ll i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) vdsd.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define inf 4e18
#define five 100005;
#define six 1000005;
#define printclock cerr<<"Time"<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//_______________________________________________________________________________________
int main()
{
       int n;
       cin>>n;
       n %= 10;
       if(n==3){
              cout<<"bon"<<endl;
       }
       else if(n==0 || n == 1 || n == 6 || n == 8){
              cout<<"pon";
       }
       else{
              cout<<"hon";
       }
}


Measured memory_bytes: 3632
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<iomanip>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (2e9)
// cout << setprecision(10)

using namespace std;
typedef long long int ll;

int N, M;
int main(void){
    cin >> N >> M;
    cout << (N*(N-1)+M*(M-1))/2 << endl;
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define Pint pair<int, int>
#define Pll  pair<ll, ll>
#define Tint tuple<int, int, int>
#define Tll  tuple<ll, ll, ll>
#define PI   3.141592653589793

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    ll r = a % b;
    while (r != 0) {
        a = b;  b = r;
        r = a % b;
    }
    return b;
}

int main() {
    int k;
    cin >> k;
    ll v = 0;
    for (int a = 1; a <= k; a++) {
        for (int b = 1; b <= k; b++) {
            for (int c = 1; c <= k; c++) {
                v += gcd(gcd(a, b), c);
            }
        }
    }
    cout << v << endl;
}


Measured memory_bytes: 3576
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)
# import numpy as np

inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""


def main():
    x = int(input())
    cnt = (x//11)*2
    res = x % 11
    if res == 0:
        cnt = cnt
    elif res <= 6:
        cnt = cnt+1
    else:
        cnt = cnt+2
    
    print(cnt)


if __name__ == '__main__':
    main()


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

#include <algorithm>
#include <array>
#include <cmath>
#include <cstring>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>

int gcd(int x, int y) {
  x = std::abs(x); y = std::abs(y);
  int a = std::max(x,y), b = std::min(x,y);
  int r = a % b;
  while(r!=0){ a = b; b = r; r = a % b; }
  return b;
}

long long lcm(int x, int y) {
  return (long long)x * y / gcd(x, y);
}

int main(void) {
  int N, T, A;
  scanf("%d %d %d", &N, &T, &A);
  double H[N];
  for (int i = 0; i < N; ++i) {
    scanf("%lf", &H[i]);
    H[i] = T - 0.006 * H[i];
  }
  int ans = 0;
  for (int i = 1; i < N; ++i) {
    if (std::abs(H[ans]-A) > std::abs(H[i]-A)) ans = i;
  }
  printf("%d\n", ans+1);

  return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

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

    int n;
    int h,w;
    cin>>n>>h>>w;
    int res = 0;
    for(int i=0;i<n;i++){
        int a,b;cin>>a>>b;
        if(h<=a && w<=b) res++;
    }
    cout<<res<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<int, pair<int, int>> PP;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const ll mod = 1e+9 + 7;
const int INF = 1001001001;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

int x, y, z, k;
vector<ll> a, b, c;
vector<ll> ab;
int sz;

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

    cin >> x >> y >> z >> k;
    a.resize(x);
    b.resize(y);
    c.resize(z);
    for(int i = 0; i < x; ++i)  cin >> a[i];
    for(int i = 0; i < y; ++i)  cin >> b[i];
    for(int i = 0; i < z; ++i)  cin >> c[i];

    for(int i = 0; i < x; ++i){
        for(int j = 0; j < y; ++j){
            ab.push_back(a[i] + b[j]);
        }
    }
    sort(ab.begin(), ab.end(), greater<ll>());
    sz = ab.size();

    vector<ll> abc;
    for(int i = 0; i < min(k, sz); ++i){
        for(int j = 0; j < z; ++j){
            abc.push_back(ab[i] + c[j]);
        }
    }
    sort(abc.begin(), abc.end(), greater<ll>());

    for(int i = 0; i < k; ++i)  cout << abc[i] << "\n";
}

Measured memory_bytes: 43368
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int n;
	cin >> n;
	vector<int>v(n), x(n, -1), y(n, -1);
	for (int i = 0; i < n; i++)cin >> v[i];

	int cnt = 0;
	for (int i = 0; i < n; i++) {
		int one = 0;
		int j = i;
		for (; x[j] == -1; j = (j + v[j]) % n) {
			x[j] = one++;
			y[j] = i;

		}
		if (y[j] == i) {
			cnt += (one - x[j]);
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3824
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;

void YN(bool x){
  if(x) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return;
}


int main() {
  int N,X,T; cin>>N>>X>>T;
  if(N%X==0) cout<<T*(N/X);
  else cout<<T*((N/X)+1);
}


Measured memory_bytes: 3624