akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  vector<ll> b(n);
  rep(i, n) cin >> a[i];
  int j = 0;
  int k = n / 2;
  if(n % 2 == 0){
    for (int i = n - 1; i >= 0; i-= 2){
      b[j] = a[i];
      j++;
    }
    for (int i = 0; i < n; i+= 2){
      b[k] = a[i];
      k++;
    }
  }else {
    for (int i = n - 2; i >= 0; i-= 2){
      b[j] = a[i];
      j++;
    }
    for (int i = 0; i < n; i+= 2){
      b[k] = a[i];
      k++;
    }
    reverse(b.begin(), b.end());
  }
  rep(i,n){
    cout << b[i] << (i == n - 1 ? "\n" : " ");
  }
}

Measured memory_bytes: 5248
#include <cstdio>
using namespace std;

long long dp[101][4][4][4];

int main() {
  int N;
  scanf("%d", &N);
  // AGCT -> 0123
  for (int i=0; i<4; i++) {
    for (int j=0; j<4; j++) {
      for (int k=0; k<4; k++) {
        dp[3][i][j][k] = 1;
      }
    }
  }
  dp[3][0][1][2] = dp[3][0][2][1] = dp[3][1][0][2] = 0;

  for (int i=4; i<=N; i++) {
    for (int j=0; j<4; j++) { // 3
      for (int k=0; k<4; k++) { // 2
        for (int l=0; l<4; l++) { // 1
          for (int m=0; m<4; m++) { // new character
            if (k==0 && l==1 && m==2) continue;
            if (k==0 && l==2 && m==1) continue;
            if (k==1 && l==0 && m==2) continue;
            if (j==0 && l==1 && m==2) continue;
            if (j==0 && k==1 && m==2) continue;
            dp[i][k][l][m] += dp[i-1][j][k][l];
            dp[i][k][l][m] %= 1000000007;
          }
        }
      }
    }
  }
  long long ans = 0;
  for (int i=0; i<4; i++) {
    for (int j=0; j<4; j++) {
      for (int k=0; k<4; k++) {
        ans += dp[N][i][j][k];
        ans %= 1000000007;
      }
    }
  }
  printf("%lld\n", ans);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define fi first
#define se second
#define int long long
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;

struct edge{
    int to, l, r;
};

const int INF = 1e9;
int n, m, si, ti;
vector<edge> G[100010];
vector<int> g[100010], d[100010];
vector<vector<edge> > nG[100010];

int getid(int pos, int t){
    vector<int> :: iterator it;
    it = lower_bound(all(g[pos]), t);
    assert(g[pos].end() != it);
    assert(*it == t);
    return it - g[pos].begin();
}

int dijkstra(){
    rep(i, 0, n){
        d[i].resize(g[i].size());
        rep(j, 0, d[i].size()){
            d[i][j] = INF;
        }
    }
    priority_queue<PP, vector<PP>, greater<PP> > q;
    d[si][0] = 0;
    q.push(PP(0, P(si, 0)));

    while(!q.empty()){
        PP p = q.top(); q.pop();
        int pos = p.se.fi;
        int tm = p.se.se;
        int cost = p.fi;
        if(cost > d[pos][tm]) continue;
        if(pos == ti) return cost;

        rep(i, 0, nG[pos][tm].size()){
            edge e = nG[pos][tm][i];
            int ntm = getid(e.to, e.r);
            if(d[e.to][ntm] > cost){
                d[e.to][ntm] = cost;
                q.push(PP(cost, P(e.to, ntm)));
            }
        }
        if(tm == g[pos].size() - 1) continue;
        int ncost = cost + g[pos][tm + 1] - g[pos][tm];
        if(d[pos][tm + 1] > ncost){
            d[pos][tm + 1] = ncost;
            q. push(PP(ncost, P(pos, tm + 1)));
        }
    }
    assert(0);
    return -1;
}

signed main(){
    cin >> n >> m >> si >> ti;
    si--; ti--;
    g[si]. push_back(0);
    rep(i, 0, m){
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--; b--;
        G[a]. push_back((edge){b, c, c + d});
        g[a]. push_back(c);
        g[b]. push_back(c + d);
    }
    rep(i, 0, n){
        sort(all(g[i]));
        g[i].erase(unique(all(g[i])), g[i].end());
    }
    rep(i, 0, n){
        nG[i].resize(g[i].size());
        rep(j, 0, G[i].size()){
            edge e = G[i][j];
            int id = getid(i, e.l);
            nG[i][id]. push_back(e);
        }
    }
    cout << dijkstra() << endl;
}

Measured memory_bytes: 46004
(let ((l1 (concatenate 'list (read-line)))
      (l2 (concatenate 'list (read-line))))

  (defun f (lst)
    (reverse (cdr (reverse (append (last lst) lst)))))


  (defun g (lst1 lst2 &optional (cnt (length lst1)))
    (if (minusp cnt)
      nil
      (if (equal lst1 lst2)
        T
        (g (f lst1) lst2 (1- cnt)))))


  (format t "~A~%"
          (if (g l1 l2)
            "Yes"
            "No")))


Measured memory_bytes: 23728
n,m = map(int,input().split())
AC = [0]*n
WA = [0]*n
wa = 0
for i in range(m):
    x = input().split()
    x[0] = int(x[0])
    if x[1]=='WA' and AC[x[0]-1]==0:
        WA[x[0]-1] += 1
    elif x[1]=='AC' and AC[x[0]-1]==0:
        AC[x[0]-1] += 1
        wa += WA[x[0]-1]
print(sum(AC),wa)

Measured memory_bytes: 4596
h,w = map(int,input().split())
l = [['']*(w+2)]
for i in range(h):
    l.append(['']+list(input())+[''])
l.append(['']*(w+2))
for i in range(1,h+1):
    for j in range(1,w+1):
        if l[i][j] == '#':
            flag = False
            for k in [(-1,0),(1,0),(0,-1),(0,1)]:
                if l[i + k[0]][j + k[1]] == '#':
                    flag = True
            if not flag:
                print('No')
                exit()
print('Yes')

Measured memory_bytes: 68228
from math import sqrt, ceil

def tostr(a):
    return ' '.join(map(str, a))

N = int(input())
k = ceil(sqrt(N*2))
#print(k)
if N!=k*(k-1)/2:
    print('No')
    exit()

print('Yes')
print(k)
M = k - 1
# diagonal
a = [1]
for i in range(M-1):
    a.append(a[-1] + i + 2)
print(M, tostr(a))
#
for i in range(M):
    a = [int(i*(i+1)/2) + 1]
    a += list(range(a[-1]+1, a[-1]+i+1))
    #print(a)
    for j in range(i+1, M):
        a.append(a[-1] + j)
    print(M, tostr(a))
        


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N;
    cin >> N;
    vector<vector<bool>> A(N, vector<bool>(N));
    rep(i, N) {
        rep(j, N) {
            int x;
            cin >> x;
            A[i][j] = x;
        }
    }

    vector<ll> dp(1 << N, 0);

    dp[0] = 1;
    rep(s, 1 << N) {
        rep(i, N) {
            int cnt = __builtin_popcount(s);
            if (cnt != i) continue;
            rep(j, N) {
                if (A[i][j] && !(s & (1LL << j))) {
                    dp[s | (1L << j)] += dp[s];
                    dp[s | (1L << j)] %= MOD;
                }
            }
        }
    }
    cout << dp[(1 << N) - 1] % MOD << '\n';
}

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


Measured memory_bytes: 16640
using System;

namespace A___Bichrome_Cells
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var a = int.Parse(Console.ReadLine());
            var ans = n * n - a;
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<bitset>
using namespace std;
typedef long long ll;
#define N 300002
int n,m,a[N][2];
bool dp[402][402],ban[N];
bitset<402>bs[402];
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)scanf("%d%d",&a[i][0],&a[i][1]);
    for(int i=1;i<=n;i++)dp[i][i]=1;
    for(int i=m;i;i--)
    {
        for(int j=1;j<=n;j++)if(!ban[j])
        {
            if(dp[j][a[i][0]]&&dp[j][a[i][1]]){ban[j]=1;continue;}
            if(dp[j][a[i][0]])dp[j][a[i][1]]=1;
            if(dp[j][a[i][1]])dp[j][a[i][0]]=1;
        }
    }
    for(int i=1;i<=n;i++)if(!ban[i])
    {
        for(int j=1;j<=n;j++)if(dp[i][j])bs[i][j]=1;
    }int ans=0;
    for(int i=1;i<=n;i++)if(!ban[i])
    for(int j=1;j<i;j++)if(!ban[j])
    {
        if((bs[i]&bs[j]).any())continue;
        ans++;
    }
    printf("%d\n",ans);
}


Measured memory_bytes: 4004
#include <bits/stdc++.h> 
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
const int MOD = 1e9+7;
int mpow(int a,int b,int p=MOD){a=a%p;int res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const int N=1e5+2;

int32_t main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);

      int n;
      cin>>n;
      for(int i=1;i<=50000;i++)
      {
        int o=(ld)(i)*(1.08);
        if(o==n){
          cout<<i;
          return 0;
        }
      }
      cout<<":(";
}
// I never lose. I either win or I learn

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


public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        String n = sc.next();
        int s_length = n.length();
        String tmp2 = "";
        int tmp = 0;
        int sum = 0;
        for(int i=0; i<n.length(); i++){
            tmp2=n.substring(i,i+1);
            tmp=Integer.parseInt(tmp2);
            sum= sum+tmp;
        }
        if(sum%9==0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
    }
}
}

Measured memory_bytes: 50072
import java.util.*;

public class Main {
    
    static int[][] q = new int[8][8];
    static int[][] ok = new int[8][8];
    static int cnt = 0;
    
    static void mark(int a, int b, int x){
        for(int i = 0; i < 8; i++){
            for(int j = 0; j < 8; j++){
                if(i == a || j == b || Math.abs(i - a) == Math.abs(j - b)){
                    ok[i][j] += x;
                }
            }
        }
    }
    
    static void dfs(int a){
        // System.out.println(a + " " + cnt);
        // for(int i = 0; i < 8; i++){
        //     for(int j = 0; j < 8; j++){
        //         System.out.print(q[i][j]);
        //     }
        //     System.out.println();
        // }
        // System.out.println();
        
        if(cnt == 8) return;
        if(a == 64) return;
        
        int i = a / 8;
        int j = a % 8;
        if(ok[i][j] == 0){
            
            mark(i, j, 1);
            q[i][j] = 1;
            cnt++;
            dfs(a + 1);
            if(cnt == 8) return;
            
            mark(i, j, -1);
            q[i][j] = 0;
            cnt--;
            dfs(a + 1);
            if(cnt == 8) return;
        }else{
            dfs(a + 1);
            if(cnt == 8) return;
        }
    }
    
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        for(int i = 0; i < k; i++){
            int r = sc.nextInt();
            int c = sc.nextInt();
            mark(r, c, 1);
            q[r][c] = 1;
        }
        cnt = k;
        dfs(0);
        for(int i = 0; i < 8; i++){
            for(int j = 0; j < 8; j++){
                if(q[i][j] == 1){
                    System.out.print("Q");
                }else{
                    System.out.print(".");
                }
            }
            System.out.println();
        }
    }
}



Measured memory_bytes: 27228
#include <iostream>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <stack>
#include <cstdio>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#include <iterator>
#include <sstream>
#define popcount(x) __builtin_popcount(x)
#define oddparity(x) __builtin_parity(x)
#define clz(x) __builtin_clz(x)
#define ctz(x) __builtin_ctz(x)
#define sf scanf
#define pf printf
#define ll long long int
using namespace std;

ll n, m, ans;

int main()
{
    sf("%lld%lld", &n, &m);
    if (n * 2 > m) {
        pf("%lld\n", m/2);
    }
    else {
        ans = n;
        m -= (n * 2);
        ans += (m/4);
        pf("%lld\n", ans);
    }
    return 0;
}


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

int main(void){
  long long A, B, C;
  cin >> A >> B >> C;
  if(A == B && B == C){
    if(A % 2 == 0) cout << -1 << endl;
    else cout << 0 << endl;
    return 0;
  }
  long long ans = 0;
  while(A % 2 == 0 && B % 2 == 0 && C % 2 == 0){
    long long a, b, c;
    a = (B + C) / 2;
    b = (C + A) / 2;
    c = (A + B) / 2;
    A = a;
    B = b;
    C = c;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	vector<ll> a(n);
	vector<ll> b(n);
	vector<ll> c(n);
	vector<ll> d(n);
	ll ans=0;
	rep(i,n) cin >> a.at(i);
	rep(i,n) cin >> b.at(i);
	rep(i,n) cin >> c.at(i);
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	sort(c.begin(),c.end());
	int j=0;
	rep(i,n){
		while(a.at(i)>=b.at(j)){
			if(j==n-1) break;
			j++;
		}
		if(a.at(i)<b.at(j)) d.at(j)++;
		else break;
	}
	rep(i,n-1) d.at(i+1)+=d.at(i);
	j=0;
	rep(i,n){
		if(d.at(i)){
			while(b.at(i)>=c.at(j)){
				if(j==n-1) break;
				j++;
			}
			if(b.at(i)<c.at(j)) ans+=d.at(i)*(n-j);
			else break;
		}
	}
	cout << ans << endl;
}

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

using namespace std;

long long x, ans;

void readInput() {
    cin >> x;
}

int main(int argc, char const *argv[]) {
    
    readInput();

    long long s = 0;
    while(s < x) {
        ans ++;
        s += ans;
    }

    cout << ans;

    return 0;
}

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

ll N;

void func(ll cur, int use, ll &counter){

  if(cur>N)return;
  
  if(use==0b111)counter++;
  
  func(cur*10 +7, use | 0b001, counter);
  
  func(cur*10 +5, use | 0b010, counter);
  
  func(cur*10 +3, use | 0b100, counter);
  
}

int main(){

  cin>>N;
 
  ll res=0;
  func(0, 0, res);
  cout<<res<<endl;
  
}


Measured memory_bytes: 256
from collections import deque

N, M = list(map(int, input().split()))
G = [[] for _ in range(N)]
for _ in range(M):
  a, b = list(map(int, input().split()))
  G[a-1].append(b-1)
  G[b-1].append(a-1)
  
ans = 0
v = 0
s = 1
l = 1
q = deque()
q.append((v, s, l))

while q:
  v, s, l = q.popleft()
  if l == N:
    ans += 1
    continue
  for nv in G[v]:
    if s&(1<<nv) == 0:
      q.append((nv, s|(1<<nv), l+1))
print(ans)

Measured memory_bytes: 40176
package main

import "fmt"

func main() {
	var n, k int
	fmt.Scan(&n, &k)

	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scan(&a[i])
	}

	tel := make([]int, 0)
	judge := make([]int, n)

	// tel[i: 0->N-1] 基本的にはテレポート回数iに対する行き先s。0回の時は1にいる。
	tel = append(tel, 1)
	judge[0] = 1
	var loopNum int
	for i := 0; i < n; i++ {
		if judge[a[tel[i]-1]-1] == 0 {
			tel = append(tel, a[tel[i]-1])
			judge[a[tel[i]-1]-1] = 1
		} else {
			for j := 0; j < len(tel); j++ {
				if a[tel[len(tel)-1]-1] == tel[j] {
					loopNum = len(tel) - j //(+1-1)が相殺
					break
				}
			}
			break
		}
	}

	iniNum := len(tel) - loopNum
	//fmt.Println(tel)
	//fmt.Println(loopNum)
	if k >= iniNum {
		fmt.Println(tel[iniNum+(k-iniNum)%loopNum])
	} else {
		fmt.Println(tel[k])
	}

}


Measured memory_bytes: 12980
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();
        char x = a.charAt(0);
        int cnta = 1;
        int cntb = 0;
        int cntc = 0;
        while (true) {
            if (x == 'a') {
                try {
                    x = a.charAt(cnta);
                } catch (Exception e) {
                    System.out.println("A");
                    System.exit(0);
                }
                cnta++;
            } else if (x == 'b') {
                try {
                    x = b.charAt(cntb);
                } catch (Exception e) {
                    System.out.println("B");
                    System.exit(0);
                }
                cntb++;
            } else {
                try {
                    x = c.charAt(cntc);
                } catch (Exception e) {
                    System.out.println("C");
                    System.exit(0);
                }
                cntc++;
            }
        }
    }
}


Measured memory_bytes: 22868
#include<bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    int P[200000];
    int ans = N-K+1;
    set<int> S;
    int i = 0, p;
    for (; i < K; ++i) {
        cin >> p;
        P[i] = p;
        S.insert(p);
    }
    for (; i < N; ++i) {
        cin >> p;
        P[i] = p;
        if (p > *prev(S.end()) && *S.begin() == P[i - K]) {
            --ans;
        }
        S.erase(P[i-K]);
        S.insert(p);
    }
    int tmp = 1;
    bool first = true;
    for (i = 1; i < N; ++i) {
        if (P[i-1] < P[i]) {
            tmp++;
        }
        else {
            if (tmp >= K) {
                --ans;
                if (first) {
                    ++ans;
                    first = false;
                }
            }
            tmp = 1;
        }
    }
    if (tmp >= K) {
        --ans;
        if (first) {
           ++ans;
        }
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 10368
//0012 A Point in a Triangle
//½ÊóÉA(x1,y1),(x2,y2),(x3,y3)ð¸_Æµ½Op`ª é
//»ÌOp`É_pªàÉÜÜêÄ¢éÈçÎYESA»¤ÅÈ¢ÈçNOÆoÍ¹æ
//È¨AOp`ÌÓãâ¸_ÍÜÜÈ¢àÌÆ·é

//üÍÍA¡ÌsÅ^¦çêAEOFÉÄI¹·é
//»ê¼êÌsÉÄAx1 y1 x2 y2 x3 y3 xp ypª¼pXy[XæØèÅ^¦çêé
//±êçÍ-100ÈãA100ÈºÌÀÅ é

#include<iostream>
#include<cmath>
using namespace std;

struct Point
{
	double x, y;
	Point(){}
	Point(double x, double y):x(x),y(y){}
};

//http://www5d.biglobe.ne.jp/~tomoya03/shtml/algorithm/Hougan.htm
//¼üÆüªÌ½è»èÅßé

//from1©çto1ÜÅÌ¼üÆAfrom2©çto2ÜÅÌüªªð·µÄ¢é©
//ßèlª0:¼üÆüªÍdÈÁÄ¢é@>0Fð·µÄ¢é@<0Fð·µÄÈ¢
double Intersect(const Point &from1, const Point &to1, const Point &from2, const Point &to2)
{
	return (
		((from1.x-to1.x)*(from2.y-from1.y) + (from1.y-to1.y)*(from1.x-from2.x)) *
		((from1.x-to1.x)*(to2.y-from1.y) + (from1.y-to1.y)*(from1.x-to2.x))
		);
}
bool IsInvolve(const Point &a, const Point &b, const Point &c, const Point &p)
{
	if(Intersect(a,b,p,c) <= 0)
		return false;
	if(Intersect(b,c,p,a) <= 0)
		return false;
	if(Intersect(c,a,p,b) <= 0)
		return false;
	return true;
}

int main(void)
{
	Point a, b, c, p;
	while(cin >> a.x >> a.y >> b.x >> b.y
		>> c.x >> c.y >> p.x >> p.y)
	{
		if(IsInvolve(a, b, c, p))
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 0
chomp (my $n = <STDIN>);
chomp (my @a = split / /, <STDIN>);
my %h;
$h{$_}++ for @a;
my $f = 1;
for my $k (keys %h) {
  if ($n % 2 == 1 && $k == 0) {
    if ($h{$k} != 1) {
      $f = 0;
      last;
    }
  } elsif ($h{$k} != 2) {
    $f = 0;
    last;
  }
}
my $MOD = 1_000_000_007;
sub mpow {
  my ($n, $p) = @_;
  my $r = 1;
  while ($p > 0) {
    $r = $r * $n % $MOD if $p & 1;
    $n = $n * $n % $MOD;
    $p >>= 1;
  }
  $r;
}
print ($f ? mpow(2, int($n / 2)) : 0), "\n";

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

const int INF = 2e9;

int main(){
    int n;
    cin >> n;
    int cnt = 0;
    bool ok = false;
    int a,b;
    rep(i,n) {
        cin >> a >> b;
        if(a == b) cnt++;
        else cnt = 0;
        if(cnt == 3) ok = true;
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl; 
}


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

signed main(){
    int N,K;
    cin >> N >> K;
    vector<int>h(N);
    for(int i = 0; i < N; i++) {
        cin >> h[i];
    }
    int ans = 1000000000;
    sort(h.begin(),h.end());
    for(int i = 0; i < (N-K+1); i++) {
        ans = min(ans,(h[i+K-1]-h[i]));
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
    cin>>s;
    for(int i=0;i<s.size();i++) {
    	if(s[i]=='C') {
    		for(int j=i+1;j<s.size();j++) {
    			if(s[j]=='F') {
    				cout<<"Yes"<<endl;
    				return 0;
				}
			}
		}
	}
	cout<<"No"<<endl;

	return 0;
}

Measured memory_bytes: 256
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
b=sum(B)
p=0
for i in range(N-1):
  if A[i+1]-A[i]==1:
    p=p+C[A[i]-1]
print(p+b)

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

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

int main() {
    string s;
    cin >> s;

    if (s.back() == 's') {
        cout << s << "es" << endl;
    } else {
        cout << s << "s" << endl;
    }
    return 0;
}


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

#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define mem(x,val) memset((x),(val),sizeof(x))
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define PI acos(-1.0) 
#define N 111111

const int INF = 1 << 30 ;
typedef long long ll ;
typedef pair < int , int > pii ;

int main() {
  int n , m , p , x;

  scanf("%d", &n) ;

  int a[n+5] ;
  for(int i = 1 ;i<=n ; i++) scanf("%d" ,&a[i]);

  scanf("%d" , &m) ;

  while(m--){
    scanf("%d %d", &p , &x) ;

    int sum = 0 ;

    for(int i =1 ; i<=n ; i++){
      if(i == p){
        sum+=x ;
      }
      else {
        sum+=a[i] ;
      }

    }
    printf("%d\n" , sum) ;
  }

	
  return 0 ;
}



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

int main()
{
    float a,b,c,d;
    cin>>a>>b>>c>>d;
    c=c/b;                               a=a/d;
    int x=c;                             int y=a;
    float i=c-x;                         float j=a-y;
    if(i!=0) x++;                        if(j!=0) y++;
    if(x<=y) cout<<"Yes";  else cout<<"No";
    return 0;
}


Measured memory_bytes: 3692
import sys
import math
#from pprint import pprint
#import numpy as np
def myinput_int():
    return list(map(int, input().split()))

S, = myinput_int()

if S<=1000000000 :
    print('0 0 1 0 0',S)
    exit(0)


a = math.ceil(math.sqrt(S))
temp = a*a-S

print('0 0 {:d} {:d} {:d} {:d}'.format(a, 1, temp, a))


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

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(t, c) for (auto&& t : c)
#define ALL(c) begin(c), end(c)
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define fk first
#define sv second

const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1}, dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

int m = (int)('z' - 'a') + 1;

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

  bool a[m] = {false};
  REP(i, str.length()) {
    a[str[i] - 'a'] = true;
  }

  REP(i, m) {
    if (!a[i]) {
      cout << (char)(i + 'a') << endl;
      return (0);
    }
  }
  cout << "None\n";
}

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

using namespace std;

int a[1010];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  long long ans = (long long)-1e18;
  int l = -1, r = -1;
  for (int i = 0; i < n; ++i) {
    long long cur = 0;
    for (int j = i; j < n; j += 2) {
      if (j == i || a[j] > 0) {
        cur += a[j];
      }
      if (cur > ans) {
        ans = cur;
        l = i;
        r = j;
      }
    }
  }
  printf("%lld\n", ans);
  vector <int> w;
  for (int i = n - 1; i > r; --i) {
    w.push_back(i);
  }
  for (int i = 0; i < l; ++i) {
    w.push_back(0);
  }
  vector <long long> z;
  for (int i = l; i <= r; ++i) {
    z.push_back(a[i]);
  }
  while ((int)z.size() > 1) {
    vector <long long> nz;
    if (z[2] > 0) {
      w.push_back(1);
      nz.push_back(z[0] + z[2]);
      for (int i = 3; i < (int)z.size(); ++i) {
        nz.push_back(z[i]);
      }
    } else {
      w.push_back(2);
      nz.push_back(z[0]);
      nz.push_back(z[1] + z[3]);
      for (int i = 4; i < (int)z.size(); ++i) {
        nz.push_back(z[i]);
      }
    }
    z = nz;
  }
  assert(z[0] == ans);
  printf("%d\n", (int)w.size());
  for (int e : w) {
    printf("%d\n", e + 1);
  }
}


Measured memory_bytes: 256
from collections import deque
N,M=map(int,input().split())
c=[deque([int(i) for i in input().split()]) for i in range(N)]

G=[0]*M
B=[-1]*N
l=-1
ans=float("inf")
for i in range(M):
  for j in range(N):
    S=len(c[j])
    if B[j]==l:
      for k in range(S):
        s=c[j].popleft()
        if G[s-1]>=0:
          G[s-1]+=1
          B[j]=s-1
          break
  a,l=0,0
  for j in range(M):
    if G[j]>a:
      a,l=G[j],j
  ans=min(ans,a)
  G[l]=-1
print(ans)
    
  


Measured memory_bytes: 46428
#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include<fstream>
#include<numeric>

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl
using namespace std;

const LL MOD = 1000000007;// 10^9+7
const int INF = (1 << 30);



//計算
LL calc(const string& s)
{
	stack<vector<LL>> cand;
	vector<LL> now;

	string num;
	for (char c : s) {
		switch (c) {
		case '[':
			cand.push(vector<LL>());
			break;
		case ']':
			now = cand.top(); cand.pop();
			if (now.empty()) {
				cand.top().push_back((stoi(num) + 1) / 2);
				num = "";
			}
			else {
				LL res = 0;
				sort(now.begin(), now.end());
				REP(i, (now.size() + 1) / 2) {
					res += now[i];
				}
				if (cand.empty())return res;
				else {
					cand.top().push_back(res);
				}
			}
			break;
		default:
			num += c;
			break;
		}
	}
}

//デバッグ
void debug()
{
	int N;
	cin>>N;
}


//メイン関数
int main()
{
	int n;
	cin >> n;
	REP(i, n) {
		string s;
		cin >> s;
		cout << calc(s) << endl;
	}
	//debug();
	
	return 0;
}



Measured memory_bytes: 3328
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define pb push_back
#define pf pop_front
#define mp make_pair
#define mod 1000000007
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mat vector<vector<int>>
#define all(x) x.begin(),x.end()
#define F first
#define S second
#define fo(i,n) for(int i=0;i<n;i++)
#define inp(a) int a;cin>>a;
#define inpa(a,n)vector<int> a(n);fo(i,n)cin>>a[i];
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
using namespace std;
#define int ll


auto max(auto a){auto ans=a[0];for(auto i:a)if(i>ans)ans=i;return ans;}
auto min(auto a){auto ans=a[0];for(auto i:a)if(i<ans)ans=i;return ans;}
void print(auto a){for(auto i:a)cerr<<i<<' ';cerr<<'\n';}

vector<int> sieve(int n)
{
	vector<int> p;
	bool primes[n+1]={0};
	for(int i=2;i*i<=n;i++)
	{
		if(!primes[i])
		{
			for(int j=i*i;j<=n;j+=i)
				primes[j]=1;
		}
	}
	for(int i=2;i<=n;i++)
		if(!primes[i])
			p.pb(i);
	return p;
}

signed main()
{
	fio
	inp(x) inp(y)
	int a=__gcd(x,y);
	vector<int> p=sieve(sqrt(a));
	int aa=a;
	vector<int> ans;
	for(int i=0;i<p.size() && aa>=p[i];i++)
	{
		if(aa%p[i]==0)
		{
			int tp=0;
			while(aa%p[i]==0)
			{
				tp++;
				aa/=p[i];
			}
			ans.pb(tp);
		}
	}
	if(aa!=1)
		ans.pb(1);
	// int fans=0;
	// for(int i:ans)
	// {
		// cout<<i<<' ';
		// fans+=i*2+1;
	// }
	// cout<<endl;
	// cout<<a<<endl;
	cout<<ans.size()+1<<'\n';
	printclock;
}

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

int main(){
    int N;
    cin>>N;
    vector<int> a(N);
    double inv=0.0;
    for (int i = 0; i < N; ++i) {
        cin>>a[i];
        inv+=1.0/a[i];
    }

    printf("%.10f\n",1.0/inv);

    return 0;
}

Measured memory_bytes: 256
"use strict"
function main(arg) {
    var data = arg.trim().split("\n").map(Number)
    var x = Math.max(data[0], data[1])
    for (var i = 0; ; i++) {
        if (i * x >= data[2]) {
            console.log(i)
            return
        }
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21956
#include <iostream>
#include <vector>
#include <iomanip>
#include <math.h>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<long double> x(n);
	vector<long double> y(n);

	cout << setprecision(10);
	for (int i = 0; i < n; i++)
	{
		cin >> x[i] >> y[i];
	}
	long double min_of_max = 10e15;
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			long double ux, uy;
			ux = (x[i] + x[j]) / 2;
			uy = (y[i] + y[j]) / 2;

			long double max = 0;
			for (int v = 0; v < n; v++)
			{
				long double d = sqrt((x[v] - ux) * (x[v] - ux) + (y[v] - uy) * (y[v] - uy));
				if (max < d)
					max = d;
			}
			if (max < min_of_max)
				min_of_max = max;
		}
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			for (int k = j + 1; k < n; k++)
			{
				long double a = (x[j] - x[i]) * (x[j] - x[i]) + (y[j] - y[i]) * (y[j] - y[i]); //kの対辺の長さの二乗
				long double b = (x[k] - x[i]) * (x[k] - x[i]) + (y[k] - y[i]) * (y[k] - y[i]); //jの対辺の長さの二乗
				long double c = (x[j] - x[k]) * (x[j] - x[k]) + (y[j] - y[k]) * (y[j] - y[k]); //iの対辺の長さの二乗

				long double ux, uy;

				if (a * (b + c - a) + b * (c + a - b) + c * (a + b - c) == 0)
				{
					if (a >= b && a >= c)
					{
						ux = (x[j] + x[i]) / 2;
						uy = (y[j] + y[i]) / 2;
					}
					if (b >= a && b >= c)
					{
						ux = (x[k] + x[i]) / 2;
						uy = (y[k] + y[i]) / 2;
					}
					if (c >= a && c >= b)
					{

						ux = (x[k] + x[j]) / 2;
						uy = (y[k] + y[j]) / 2;
					}
				}
				else
				{
					ux = (a * (b + c - a) * x[k] + b * (c + a - b) * x[j] + c * (a + b - c) * x[i]) / (a * (b + c - a) + b * (c + a - b) + c * (a + b - c));
					uy = (a * (b + c - a) * y[k] + b * (c + a - b) * y[j] + c * (a + b - c) * y[i]) / (a * (b + c - a) + b * (c + a - b) + c * (a + b - c));
				}

				long double max = 0;
				for (int v = 0; v < n; v++)
				{
					long double d = sqrt((x[v] - ux) * (x[v] - ux) + (y[v] - uy) * (y[v] - uy));
					if (max < d)
						max = d;
				}
				if (max < min_of_max)
					min_of_max = max;
			}
		}
	}
	cout << min_of_max << endl;
}

Measured memory_bytes: 256
import Data.Array

main = do
  let f i = (i+3)*(i+2)*(i+1) `div` 6 - max (2*(i-9)*(i-8)*(i-7) `div` 3) 0 in
    let p = array (0,50) $ zip [0..50] $ [ f i | i <- [0..18]++[17,16..0]] ++ [0,0..] in
      let g x = show $ p!(read x::Int) in
        putStr . unlines . map g . lines =<< getContents

Measured memory_bytes: 4024
#coding:utf-8
#1_7_B 2015.4.5
while True:
    n,x = map(int,input().split())
    if n == x == 0:
        break
    count = 0
    
    for i in range(1 , n + 1):
        for j in range(1 , n + 1):
            if i < j < (x - i - j) <= n:
                count += 1
    print(count)

Measured memory_bytes: 6728
import sys
from collections import deque

sys.setrecursionlimit(10**7)
input = sys.stdin.readline

n,m,k = map(int, input().split())
f = [[] for _ in range(n)]
g = [[] for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    f[a].append(b)
    f[b].append(a)

for _ in range(k):
    c, d = map(int, input().split())
    c, d = c - 1, d - 1
    g[c].append(d)
    g[d].append(c)

d = {}
parent = [-1] * n
seen = [False] * n

# DFS
for i in range(n):
    if seen[i]:
        continue
    stack = deque()
    # グループは集合で管理
    d[i] = set([i])
    stack = [i]
    while stack:
        v = stack.pop()
        seen[v] = True
        # 親を設定して同じ連結成分であることを判別する
        parent[v] = i
        for nv in f[v]:
            if seen[nv]:
                continue
            # 集合に追加する
            d[i].add(nv)
            stack.append(nv)

ans = [0] * n
for i in range(n):
    # 連結成分ごとに集合を取り出す
    group = d[parent[i]]
    # 集合の全要素数 - 友達 - ブロック - 自分
    sum = len(group) - len(f[i]) - len(set(g[i]) & group) - 1
    ans[i] = sum

print(*ans)


Measured memory_bytes: 133612
#include <iomanip>
#include <random>
#include <time.h>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <string>
#include <cstdlib>
#include <typeinfo>
#include <math.h>
#include <algorithm>
#include <iostream>
#include <list>
#include <stack>
#include <set>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main() {
	string s;
	cin >> s;
	ll ans = 0;
	if (s[0] == '1')ans++;
	if (s[1] == '1')ans++;
	if (s[2] == '1')ans++;
	cout << ans << endl;
	return 0;
}

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

int main(){
  int day;
  cin>>day;
  int A,B,C,D;
  cin>>A>>B>>C>>D;
  int ans1,ans2;
  ans1=A/C;
  if(A-A%C!=A) ans1+=1;
  ans2=B/D;
  if(B-B%D!=B) ans2+=1;
          
  int ans=max(ans1,ans2); 
  cout<<day-ans<<endl;
  
  return 0;
}

Measured memory_bytes: 1160
using System;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using static System.Math;
using Debug = System.Diagnostics.Debug;


static class P
{
    static void Main()
    {
        string s = Console.ReadLine();
        Console.WriteLine(s.GroupBy(x => x).All(x => x.Count() == 2) ? "Yes" : "No");
    }
}


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

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0])

int main()
{

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

        std::sort(l, l + N, std::greater<int>());
        int sum = 0;
        for (int i = 0; i < K; ++i) {

                sum += l[i];
        }
        cout << sum << endl;









}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
	"strings"

)


func main() {
	solve(os.Stdin, os.Stdout)
}

type ReaderEx struct {
	baseScanner *bufio.Scanner
	words       []string
	nextWordIdx func() int
	initWordIdx func(int)
}

func NewScannerEx(stdin io.Reader) *ReaderEx {
	var this ReaderEx
	var idx int
	var wordsCnt int
	this.baseScanner = bufio.NewScanner(stdin)
	this.baseScanner.Buffer(make([]byte, 0), 1E+11)
	this.nextWordIdx = func() int {
		cur := idx
		idx = (idx + 1) % wordsCnt
		return cur
	}
	this.initWordIdx = func(wc int) {
		idx = 0
		wordsCnt = wc
	}
	return &this
}

func (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {
	isScanned = me.baseScanner.Scan()
	if doSplit {
		me.words = strings.Fields(me.baseScanner.Text())
	} else {
		me.words = []string{me.baseScanner.Text()}
	}
	me.initWordIdx(len(me.words))
	return
}

func (me *ReaderEx) nextBytes() []byte {
	return []byte(me.words[me.nextWordIdx()])
}
func (me *ReaderEx) nextString() string {
	return me.words[me.nextWordIdx()]
}

type StringArray []string

func (me *ReaderEx) nextStringArray() StringArray {
	return me.words[me.nextWordIdx():]
}

func (me StringArray) toStrings() []string {
	return me
}

func (me StringArray) toInts() []int {
	strValues := me.toStrings()
	values := make([]int, len(strValues))
	for i, v := range strValues {
		n, err := strconv.Atoi(v)
		if err != nil {
			panic(err)
		}
		values[i] = n
	}
	return values
}
func (me *ReaderEx) nextInt() int {
	n, err := strconv.Atoi(me.words[me.nextWordIdx()])

	defer func() {
		if err != nil {
			panic(fmt.Sprintf("getInt(%d)", n))
		}
	}()
	return n
}

func pow(x, y, mod int) (ans int) {

	ans = 1
	for bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {
		if y&bit != 0 {
			ans *= x
			if mod > 0 {
				ans %= mod
			}
		}
		if bit <= 1 {
			return
		}
		ans *= ans
		if mod > 0 {
			ans %= mod
		}
	}
}

type factType struct {
	prime int
	count int
}

func fact(n int) (facts []*factType) {

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			fa := factType{prime: i}
			for n%fa.prime == 0 {
				n /= fa.prime
				fa.count++
			}
			facts = append(facts, &fa)
		}
	}
	if n > 1 {
		facts = append(facts, &factType{prime: n, count: 1})
	}
	return facts
}
func dec2bin(n int) (ret []bool) {
	for bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {
		ret = append(ret, n&bit != 0)

		if bit <= 1 {
			return
		}
	}

}

func abs(v int) int {
	if v < 0 {
		v = -v
	}
	return v
}

func b2i(b bool) (i int) {
	if b {
		i = 1
	} else {
		i = 0
	}
	return
}

func solve(stdin io.Reader, stdout io.Writer) {

	r := NewScannerEx(stdin)
	r.Scan(true)
	h := r.nextInt()
	r.Scan(true)
	w := r.nextInt()
	r.Scan(true)
	n := r.nextInt()

	M := w
	if h > w {
		M = h
	}

	fmt.Fprintln(stdout, n/M+b2i(n%M != 0))
}


Measured memory_bytes: 640
import math

A, B = list(map(int, input().split()))

minA = 12.5 * A
if minA.is_integer() == True:
    minA = int(minA)
else:
    minA = math.ceil(minA)

maxA = 12.5 *(A+1)
if maxA.is_integer() == True:
    maxA = int(maxA-1)
else:
    maxA = math.floor(maxA)

minB = 10 * B
maxB = (10 * (B+1))-1

#print("{} {} {} {}".format(minA, maxA, minB, maxB))

if minA <= maxB and minB <= maxA:
    if minA < minB:
        print(minB)
    else:
        print(minA)
else:
    print(-1)


Measured memory_bytes: 3064
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    if(n*m%2==0)
        cout<<"Even"<<endl;
    else
        cout<<"Odd"<<endl;
    
    
    
    
    return 0;
}


Measured memory_bytes: 256
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,j,n) for(int i = j; i < n; i++)
#define rrep(i,j,n) for(int i = j-1; i >= n; i--)
#define prec(n) fixed << setprecision(n)
#define print_array(v) rep(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define fi first
#define se second
#define endl "\n"
using namespace std;

//constexpr int inf = 2147483647;
//constexpr int64_t inf64 = 9223372036854775807;
//constexpr int mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << prec(20);

  long double l;
  cin >> l;

  cout << pow(l/3, 3) << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file  
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less  
using namespace         std;
#define                 int long long
#define                 double long double
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<'\n'
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define N 1014159
#define  vi vector<int>
#define  v  vector
#define die exit(0)
#define alln(arr) arr+1 , arr+1+n
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
        tree_order_statistics_node_update> oset;

int n, m, k, arr[N];

void solve()
{
    int ans = 0;
    cin >> n;
    forn(i, 1, n)
    {
        if (i % 5 and i % 3)ans += i;
    }
    cout << ans;

}


signed main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    //cin>>t;
    forn(i, 1, t)
    {
        solve();
        nl;
    }



    return 0;

}

//       clang++ c.cpp ; ./a.out < a.txt ;


Measured memory_bytes: 3660
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

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

	set<int>se;
    int n;
    cin>>n;
    rep(i,n){
        int a;
        cin>>a;
        se.insert(a);
    }
    if(n==se.size())cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}


Measured memory_bytes: 9600
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef pair<int,int> pii;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
template<class Type> void line(const Type &a){int cnt=0;for(auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	llong n;
	cin>>n;
	
	vector<llong> a(n);
	REP(i,n) cin>>a[i];
	
	vector<llong> cnt(60,0);
	REP(i,n){
		REP(j,60){
			if((a[i]>>j)&1) cnt[j]++;
		}
	}
	
	llong ans=0;
	REP(i,60){
		ans+=((1L<<i)%MOD*((n-cnt[i])*cnt[i]%MOD))%MOD;
		ans%=MOD;
	}
	
	cout<<ans<<endl;
}


Measured memory_bytes: 2560
def main(n,m,s):

    #i初期化
    i = n
    tmp = []
    while i > 0 :
        for j in range(m,-1,-1):
            if j == 0 :
                i = -1
                break

            if i-j >= 0 :
                if s[i-j] == '0':
                    i -= j
                    tmp.append(j)
                    break
    if i == 0:
        for l in reversed(tmp):
            print(l,end=' ')
    else:
        print(-1)


n,m = map(int,input().split())
s = input()
main(n,m,s)


Measured memory_bytes: 4848
#include <cmath>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;
using vi = vector<int>;

string s;

void input() {
  cin >> s;
}

void solve() {
  int ans = 0;

  if ((int)s.find('R') != -1)
    ans = 1;

  if ((int)s.find("RR") != -1)
    ans = 2;

  if (s == "RRR")
    ans = 3;

  cout << ans << '\n';
}

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

  cout.precision(16);
  cout << fixed;

  int _times = 1;

#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  _times = 3;
#endif

  // cin >> _times;

  while (_times--) {
    input();
    solve();
  }
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,p,q,r,t,x,y,flag;
    string s;
    cin>>s>>n;
    p=s.size();
    flag=0;
  for(int i=0;i<min(p,n);i++)
  {
      if(s[i]!='1')
      {
          cout<<s[i]<<endl;
          flag=1;
          break;
      }
  }
  if(flag==0) cout<<1<<endl;
    return 0;
}


Measured memory_bytes: 256
l=list(map(int,input().split()))
if l[0]>=l[3] or l[1]<=l[2]:
    print(0)
elif (l[0]<l[2]and l[3]<l[1]) or (l[2]<l[0] and l[1]<l[3]):
    print(min(l[3]-l[2],l[1]-l[0]))
else :
    print(min(l[3]-l[0],l[1]-l[2]))

Measured memory_bytes: 3064
N, K = map(int, input().split())
lis = list(map(int, input().split()))
l = lis.index(1)
Lis = list(reversed(lis))
L = Lis.index(1)
i = 0
j = 0

if l + 1 >= K:
  r = (l + 1 - K) % (K - 1)
  if r != 0:
    r = K - 1 - r
else:
  r = K - l - 1
  
if L + 1 >= K:
  R = K - (L + 1 - K) % (K - 1)
  if R != 0:
    R = K - 1 - R
else:
  R = K - L - 1


if r >= R:
  if r == K - 1:
    r = 0
    
  while l - i * K + i > 0:
    i += 1

  while l + r + j * K - j < N - 1:
    j += 1
  
else:
  if R == K - 1:
    R = 0
    
  while L - i * K + i > 0:
    i += 1

  while L + R + j * K - j < N - 1:
    j += 1
  
print(max(1, i + j))


Measured memory_bytes: 20592
#include<cstdio>
#include<map>
#define maxn 405
#define LL long long
using namespace std;
int n,c[maxn][8];
LL ans,u[4];
map<LL,LL> mp;
LL F(LL a,LL b,LL c,LL d)
{
	return a<<30|b<<20|c<<10|d;
}
void add(LL x,LL v)
{
	for(int i=0;i<4;i++)
	{
		mp[x]+=v;
		x=(x>>10)|(x&1023)<<30;
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<4;j++)
		{
			scanf("%d",&c[i][j]);
			c[i][j+4]=c[i][j];
		}
		add(F(c[i][0],c[i][1],c[i][2],c[i][3]),1);
		//printf("%lld\n",F(c[i][0],c[i][1],c[i][2],c[i][3]));
	}
	for(int i=1;i<=n;i++)
	{
		add(F(c[i][0],c[i][1],c[i][2],c[i][3]),-1);
		for(int j=i+1;j<=n;j++)
		{
			add(F(c[j][0],c[j][1],c[j][2],c[j][3]),-1);
			for(int k=0;k<4;k++)
			{
				LL r=1ll;
				u[0]=F(c[j][k+1],c[j][k+0],c[i][1],c[i][0]);
				u[1]=F(c[j][k+0],c[j][k+3],c[i][2],c[i][1]);
				u[2]=F(c[j][k+3],c[j][k+2],c[i][3],c[i][2]);
				u[3]=F(c[j][k+2],c[j][k+1],c[i][4],c[i][3]);
				if(mp[u[0]]&&mp[u[1]]&&mp[u[2]]&&mp[u[3]])
				{
					r*=mp[u[0]]; add(u[0],-1);
					r*=mp[u[1]]; add(u[1],-1);
					r*=mp[u[2]]; add(u[2],-1);
					r*=mp[u[3]];
					add(u[2],1);
					add(u[1],1);
					add(u[0],1);
					ans+=r;
				}
			}
			add(F(c[j][0],c[j][1],c[j][2],c[j][3]),1);
		}
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 20352