akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <string>
using namespace std;

int main(){
    string S, T;
    cin >> S >> T;
    char bf,af;
    int size = S.size();
    int R[26]={};
    int R2[26]={};
    bool flag = true;
    for(int i=0;i<26;i++){
        R[i]=-1;
        R2[i]=-1;
    }
    //cout << "abc\n";
    for(int i = 0;i<size;i++){
        if(R[S[i]-'a'] < 0){
            R[S[i] - 'a'] = T[i] - 'a';
        }else if(R[S[i] - 'a'] != T[i] - 'a'){
            flag = false;
            break;
        }
        if(R2[T[i] - 'a'] < 0){
            R2[T[i] - 'a'] = S[i] - 'a';
        }else if(R2[T[i]-'a'] != S[i] - 'a'){
            flag = false;
            break;
        }
    }
    if(flag){
        cout <<"Yes\n";
    }else{
        cout << "No\n";
    }
}


Measured memory_bytes: 776
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>
using namespace std;
using ll = long long;
constexpr ll LLMIN = numeric_limits<ll>::min();

int main() {
    ll n, p, q;
    cin >> n >> p >> q;
    vector<ll> c(n);
    vector<ll> csum(n);
    for(int i=0; i<n; ++i) {
        cin >> c[i];
        csum[i] = c[i] + i*p;
    }
    ll res = accumulate(c.begin(), c.end(), 0ll);
    ll tmp = res;
    sort(csum.begin(), csum.end());
    for(int i=0; i<n; ++i) {
        tmp += p*q - csum[i] + 2*i*p;
        res = max(res, tmp);
    }
    cout << res << endl;
}


Measured memory_bytes: 10704
#include <bits/stdc++.h>
#include <numeric>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG true
#define LL long long
#define Num 1000000007
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    int diff = b - a;
    int ans = 0;
    for (int i = 1; i <= diff; i++)
    {
        ans += i;
    }
    cout << ans - b << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  string a,b,c;
  cin >> a >> b >> c;
  cout << (char)(a[0] - 'a' + 'A') << (char)(b[0] - 'a' + 'A') << (char)(c[0] - 'a' + 'A') << endl;
}

Measured memory_bytes: 3620
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class C
{
	public static void Main()	
	{
		int N = GetInt();
		long[] T = new long[N];
		long[] A = new long[N];
		for(int i = 0; i < N; i++)
		{
			T[i] = GetLong();
			A[i] = GetLong();
		}

		long x = T[0];
		long y = A[0];
		for(int i = 1; i < N; i++)
		{
			long m = Math.Max((x + T[i] - 1)/T[i], (y + A[i] - 1)/A[i]);
			x = m * T[i];
			y = m * A[i];
		}

		Console.WriteLine(x + y);
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}


Measured memory_bytes: 11196
#include <stdio.h>

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

  if (scanf("%d %d", &a, &b) == EOF) {
    return -1;
  }

  if (a <= b) {
    coins = b;
    b--;
  }
  else {
    coins = a;
    a--;
  } 

  if (a <= b) {
    coins += b;
  }
  else {
    coins += a;
  } 

  printf("%d\n", coins);

  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>
#include <stack>

using std::vector;

int main()
{
    int n,q,ope,t,x;
    std::cin>>n>>q;
    std::stack<int> S[n];

    for(int i = 0; i < q; i++)
    {
        std::cin>>ope>>t;
        if(ope==0){std::cin>>x;S[t].push(x);}
        else if(ope==1){if(!S[t].empty()){std::cout<<S[t].top()<<std::endl;}}
        else{if (!S[t].empty()) S[t].pop();}
    }

    return 0;
}



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

# dp[i][j]:ai~aj残っているときのX-Yの値。(aiのiは0originとする)
# 太朗君の番なのか次郎君の番なのかは、Nと残っているaの個数から判断する。
dp = [[0 for _ in range(N)] for _ in range(N)]

# 漸化式の右辺にi+1,j-1が出てくるから、
# iは小さいほうから、jは大きいほうから決めていく。
for i in range(N-1,-1,-1):
  for j in range(i,N):
    if (N-(j-i))%2 == 1:
      if i == j:
        dp[i][j] = A[i]
      else:
        dp[i][j] = max(A[i]+dp[i+1][j],A[j]+dp[i][j-1])
    else:
      if i == j:
        dp[i][j] = -A[i]
      else:
        dp[i][j] = min(dp[i+1][j]-A[i],dp[i][j-1]-A[j])
print(dp[0][N-1])


Measured memory_bytes: 121948
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define Debug(x) cout<<#x<<"="<<x<<endl
using namespace std;
typedef long long LL;
const int INF=1e9+7;
inline LL read(){
    register LL x=0,f=1;register char c=getchar();
    while(c<48||c>57){if(c=='-')f=-1;c=getchar();}
    while(c>=48&&c<=57)x=(x<<3)+(x<<1)+(c&15),c=getchar();
    return f*x;
}
inline char readc(){
	register char c=getchar();
	while(c==' '||c=='\n'||c=='\t') c=getchar();
	return c;
}

const int N=505;

bool a[N][N],b[N][N];
char c[N][N];
int n,m;

int main(){
	n=read(),m=read();
	for(int i=1;i<=n;i++){
		a[i][1]=1,b[i][m]=1;
		if(i&1) for(int j=2;j<=m-1;j++) a[i][j]=1;
		else for(int j=2;j<=m-1;j++) b[i][j]=1;
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++)
			if((c[i][j]=readc())=='#') a[i][j]=b[i][j]=1;
	}
//	cout<<endl;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++)
			printf("%c",a[i][j]==1?'#':'.');
		cout<<endl;
	}
	cout<<endl;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++)
			printf("%c",b[i][j]==1?'#':'.');
		cout<<endl;
	}
}


Measured memory_bytes: 1536
from sys import stdin
from collections import deque
input = stdin.readline

H, W = map(int, input().split())
ch, cw = map(int, input().split())
dh, dw = map(int, input().split())
S = [list(input().rstrip()) for _ in range(H)]

dir_h = [0, 0, 1, -1]
dir_w = [1, -1, 0, 0]

seen = [[-1 for _ in range(W)] for _ in range(H)]
edge = []
nex = [[ch - 1, cw - 1]]
num = 0
group = [[-1 for _ in range(W)] for _ in range(H)]


def bfs():
    q = deque([])

    for h, w in nex:
        if seen[h][w] != -1:
            continue
        q.append([h, w])
        seen[h][w] = num
        while q:
            h, w = q.popleft()

            for dh, dw in zip(dir_h, dir_w):
                nh, nw = h + dh, w + dw

                if nh < 0 or nh >= H or nw < 0 or nw >= W:
                    continue
                elif S[nh][nw] == "#":
                    edge.append([h, w])
                    continue
                elif seen[nh][nw] != -1:
                    continue
                else:
                    seen[nh][nw] = num
                    q.append([nh, nw])


def dfs():
    d = deque([])
    for h, w in edge:
        d.append([h, w])

        while d:
            h, w = d.pop()
            for dh in range(-2, 3):
                for dw in range(-2, 3):
                    nh, nw = h + dh, w + dw

                    if nh < 0 or nh >= H or nw < 0 or nw >= W:
                        continue
                    elif S[nh][nw] == "#":
                        continue
                    elif seen[nh][nw] != -1:
                        continue
                    else:
                        nex.append([nh, nw])


while True:
    bfs()
    if not edge:
        break
    nex = []
    num += 1
    dfs()
    if not nex:
        break
    edge = []

# for s in seen:
#     print(s)

print(seen[dh - 1][dw - 1])


Measured memory_bytes: 192120
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


int main(){
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int x = h1*60+m1;
    int y = h2*60+m2;
    int t = y - x;
    t -= k;
    
    
    cout << t << endl;
    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
  	cin>>s;
  	for(int i=0;i+1<s.length();i++){
    	if(s.substr(i,2)=="AC"){
        	cout<<"Yes"; return 0;
        }
    }
  	cout<<"No"; return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define mer make_pair
#define fi first
#define se second
using namespace std;
typedef long long ll;

map<int,int> mp;

int main(){
	//my new name is Veex
	//clock_t start1=clock();
	int n,maxn=0;
	cin>>n;
	int a[n+10],dp[n+10];
	memset(dp,0,sizeof(dp));
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(mp[a[i]-1]){
			dp[i]=mp[a[i]-1]+1;
		}
		mp[a[i]]=max(dp[i],1);
		maxn=max(max(dp[i],1),maxn);
	}
	cout<<n-maxn;
	//((double)(clock()-start1)/CLOCKS_PER_SEC)*1000;
	return 0;
}


Measured memory_bytes: 11264
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import static java.lang.Integer.parseInt;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			int n = parseInt(line);
			if (n == 0) break;

			int[] nums = new int[n];
			for (int i = 0; i < n; i++) {
				nums[i] = parseInt(br.readLine());
			}
			int find = parseInt(br.readLine()), count = 0;
			int min = 0, max = n - 1, mid;
			while (min <= max) {
				mid = (max - min) / 2 + min;
				count++;
				if (nums[mid] == find) {
					break;
				} else if (nums[mid] > find) {
					max = mid - 1;
				} else {
					min = mid + 1;
				}
			}
			System.out.println(count);
		}
	}
}

Measured memory_bytes: 17072
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) std::cout << x << '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define sz(x) ((int)(x).size())
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = INT_MAX / 2;
const ll  inf = LLONG_MAX / 2;
const int mod = 1000000007;
const int MAX_N = 101010;
const double PI = acos(-1);

//dp[i][j] : 
//先頭i文字として考えられるのものうち,
//13で割った余りがjであるもの.
ll dp[MAX_N][13];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	/*------------------------------*/

	string s;
	cin >> s;

	dp[0][0] = 1;

	for (int i = 0; i < sz(s); i++) {
		int c;
		if (s[i] == '?') {
			c = -1;
		}
		else {
			c = s[i] - '0';
		}

		//数字を新しく右にくっつけていくことを考える.
		for (int j = 0; j < 10; j++) {
			if (c == -1 || c == j) {
				//前には0~12のどれかがあるはずなので全通り試す.
				for (int k = 0; k < 13; k++) {
					dp[i + 1][(k * 10 + j) % 13] += dp[i][k];
				}
			}
		}
		for (int j = 0; j < 13; j++) {
			dp[i + 1][j] %= mod;
		}
	}

	out(dp[sz(s)][5]);

	return 0;
}

Measured memory_bytes: 10704
#include<cstdio>
int vis[1000005];

int main(){
    long long k;
    scanf("%lld",&k);
    long long base = 0, find = -1;
    for(int i = 1; i <= 1000000; i++){
        base = (base*10ll%k+7)%k;
        if(vis[base]) break;
        else vis[base] = 1;
        if(base==0){ 
            find = i;
            break;
        }
    }
    printf("%lld\n",find);
    return 0;
}


Measured memory_bytes: 5580
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define REPD(i,a,b) for (int i=(a);i<(b);i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef set<int> si;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pi;
typedef queue<pi> qpi;
typedef pair<ll, ll> pll;
typedef queue<pll> qpll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const int mod = 1000000007;
const int INF = 1001001001;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 順列　do {} while(next_permutation(ALL(X)));
// 最大値　LLONG_MAX
// a内でx以上　auto iter = lower_bound(ALL(a), x);
// a内でxより大きい　auto iter = upper_bound(ALL(a), x);
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
int check(int x,int y, vvi ch) {
  int flg = 1;
  REP(i,8) {
    if(ch[x][i]==1) {
      flg=0;
      break;
    }
    if(ch[i][y]==1)  {
      flg=0;
      break;
    }
    if(x+i<8&&y+i<8) {
      if(ch[x+i][y+i]==1)  {
      flg=0;
      break;
    }
    }
    if(x-i>=0&&y+i<8) {
      if(ch[x-i][y+i]==1)  {
      flg=0;
      break;
    }
    }
    if(x+i<8&&y-i>=0) {
      if(ch[x+i][y-i]==1)  {
      flg=0;
      break;
    }
    }
    if(x-i>=0&&y-i>=0) {
      if(ch[x-i][y-i]==1)  {
      flg=0;
      break;
    }
    }
  }
  return flg;
}

int solution(double t,double p) {
  double f=1.0-(1/1.5)*log(2)*p*pow(2,-t/1.5);
  if(f>=0) return 1;
  else if(f<0) return 0; 
}

int main() {
  int n,k;
  cin >> n >> k;
  vi a(n);
  int ci;
  REP(i,n) {
    cin >> a[i];
    if(a[i]==1) ci=i; 
  }
  k--;
  n--;
  int ans=(n+k-1)/k;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
// Author: Jashan Bansal
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second	
#define mp make_pair
#define int long long
#define ll long long
#define pii pair<int,int>
#define all(arr) arr.begin(), arr.end()
#define sz(arr) ((long long)arr.size())
// const int mod=998244353;
const int mod=1000000007;
typedef vector<int> vi;
#define log1(x) cout << x << '\n'
#define log2(x,y) cout << x << " " << y <<'\n'
#define log3(x,y,z) cout << x <<" " << y <<" " << z << '\n'
#define logarr(arr,n) for(int __=0; __ < n; __++)	cout << arr[__] << " "; cout << '\n'

int powm(int a, int b) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}


void solve(){
	int n,w; cin >> n >> w;
	vi wt(n), val(n);
	for(int i=0; i<n; i++) cin >> wt[i] >> val[i];

	vector<vi> dp(n+1,vi(w+1,-1));

	for(int i=0; i<=w; i++){
		dp[0][i] = 0;
	} 

	for(int i=0; i<=n; i++){
		dp[i][0] = 0;
	}

	for(int i=1;i<=n; i++){
		for(int j=1; j <= w; j++){
			if(wt[i-1] <= j){
				dp[i][j] = max(dp[i-1][j], val[i-1]+ dp[i-1][j-wt[i-1]]);
			}
			else{
				dp[i][j] = dp[i-1][j];
			}
		}
	}

	cout << dp[n][w] << '\n';
}
signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t=1;
	// cin>>t;
	while(t--)
		solve();
	return 0;
}


Measured memory_bytes: 80256
N = int(input())
edge = [{} for _ in range(N + 1)]
dist = [-1] * (N + 1)
for _ in range(N - 1):
    a, b, c = map(int, input().split())
    edge[a][b] = c
    edge[b][a] = c

Q, K = map(int, input().split())
dist[K] = 0
dfs_stack = [K]
while dfs_stack:
    s = dfs_stack.pop()
    for t, t_dist in edge[s].items():
        if dist[t] == -1:
            dist[t] = dist[s] + t_dist
            dfs_stack.append(t)

for _ in range(Q):
    x, y = map(int, input().split())
    print(dist[x] + dist[y])

Measured memory_bytes: 53600
n = int(input())
A = map(int, input().split())
ls_a = list(A)

cur_max = ls_a[0]
sum = 0
for i in range(1, n):
  cur_h = ls_a[i]
  diff = cur_max - cur_h
  if diff > 0:
    sum += diff
  elif diff < 0:
    cur_max = cur_h

print(sum)

Measured memory_bytes: 32232
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int N,M,X,Y;
    R(N,M,X,Y);
    FOR(i,1,N){
        int x;
        R(x);
        X=max(X,x);
    }
    FOR(i,1,M){
        int y;
        R(y);
        Y=min(Y,y);
    }
    W(X>=Y?"War":"No War");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, a[102] = {}, b[102][11] = {}, c, z = -mod;
    cin >> n;
    for (int i = 0; i < n; i++) for (int j = 0; j < 10; j++) cin >> c, a[i] += c * (1 << j);
    for (int i = 0; i < n; i++) for (int j = 0; j <= 10; j++) cin >> b[i][j];
    for (int i = 1; i < 1024; i++) {
        int d = 0;
        for (int j = 0; j < n; j++) d += b[j][__builtin_popcount(i & a[j])];
        z = max(z, d);
    }
    cout << z;
}


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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FIO freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)

#define endl '\n'
#define int long long

int32_t main()
{
    IOS;   // FIO;
    
    int h, w;   cin >> h >> w;

    int cache[h][w];
    memset(cache,0,sizeof(cache));

    const int mod = 1e9+7;

    
    for(int i = 0; i < h; i ++) {
        for(int j = 0; j < w; j ++) {
            char ch;    cin >> ch;
            if(ch == '#') 
                cache[i][j] = -1;
        }
    }

    if(cache[0][0] == -1 || cache[h-1][w-1] == -1)
        return cout << 0, 0;
        
    cache[h-1][w-1] = 1;
    cache[0][0] = 0;

    for(int i = h-1; i >= 0; i --) {
        for(int j = w-1; j >= 0; j --) {
            if(cache[i][j] == -1)
                continue;
            if(j+1 < w and cache[i][j+1] >= 0)
                cache[i][j] = ((cache[i][j] % mod) + (cache[i][j+1] % mod)) % mod;
            if(i+1 < h and cache[i+1][j] >= 0)
                cache[i][j] = ((cache[i][j] % mod) + (cache[i+1][j] % mod)) % mod;
        }
    }

    cout << cache[0][0];

    return 0;
}

Measured memory_bytes: 8064
#include <stdio.h>
int a,b;
double a1,b1;
int d,r;
double f;
main(){
   
  scanf("%d%d",&a,&b);
  
  d=a/b;
  r=a%b;
  a1=a;
  b1=b;
  f=a1/b1;
   
  printf("%d %d %.8lf\n",d,r,f);
  return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
//const ll mod=998244353;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int n,mod;

int main(){
	cin>>n>>mod;
	n*=3;
	vector<map<ll,ll>> dp(n+1);
	dp[0][0]=1;
	for(int i=0;i<n;i++){
		for(auto p:dp[i]){
			ll j=p.first,t=p.second;
			(dp[i+1][j+1]+=t)%=mod;
			if(i+2<=n) (dp[i+2][j-1]+=t*(i+1))%=mod;
			if(i+3<=n) (dp[i+3][j]+=t*(i+1)*(i+2))%=mod;
		}
	}
	ll res=0;
	for(auto p:dp[n]) if(p.first>=0) (res+=p.second)%=mod;
	cout<<res<<endl;
}

Measured memory_bytes: 563456
#include "bits/stdc++.h"
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        int n,flag = 0;
        cin>>n;
        int a[n];
        for(int i = 0; i < n; ++i){
            cin >> a[i];
            if(!flag && !(a[i] & 1) && (a[i] % 3 != 0 && a[i] % 5 != 0))
                flag = 1;
        }
        if(flag)
            cout << "DENIED" << endl;
        else
            cout << "APPROVED" <<endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 9000000000000000000 //9e18:極めて大きい値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define LOGMAXR 18 // floor(log2(10^5)) + 1: 配列の最大のrangeのlog
//略記
//#define PB push_back //vectorヘの挿入
//#define MP make_pair //pairのコンストラクタ
//#define F first //pairの一つ目の要素
//#define S second //pairの二つ目の要素

int main(){
  ll S, W;
  cin >> S >> W;
  if(S > W){
    cout << "safe" << endl;
  }else{
    cout << "unsafe" << endl;
  }
  return 0;
}


Measured memory_bytes: 3108
import java.util.Scanner;

public class Main{
public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
int  i = sc.nextInt();

int n = i/100*111;
if(n>=i){
  System.out.println(n);
}else{
  System.out.println(n+111);
}



}
}


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


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

   ll min=9999999999999,left=0,sum=0;
   for(i=0;i<n;i++) sum+=a[i];
   for(i=0;i<n;i++){
      left+=a[i];
      if(abs(left-(sum-left))<min) min=abs(left-(sum-left));
   }
   cout << min << endl;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	while(cin>>n,n){
		int p[7]={0};
		for(int i=0;i<n;i++){
			int d;
			cin>>d;
			p[(d>=60?6:d/10)]++;
		}
		for(int i=0;i<7;i++)cout<<p[i]<<endl;
	}
}

Measured memory_bytes: 3072
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:16777216")
#pragma warning( disable : 6031)
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <numeric>
#include <algorithm>
#include <utility>
#include <bitset>
#include <cmath>
#include <sstream>
#include <functional>
#include <iomanip>
#include <limits>

#define all(a) (a).begin(),(a).end()
#define sz(a) (int)(a).size()
#define eps (1e-9)
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector<double> vd;
typedef vector< vd > vvd;
typedef vector< string > vs;
typedef pair< int, int > pii;
typedef vector< pii > vpii;
typedef tuple<int, int, int> tiii;
const long long mod = 1000000007;

template<typename T>
void max_self(T& a, T b)
{
	a = max(a, b);
}
int main()
{
#ifdef LOCAL_MACHINE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout << setprecision(18) << fixed;
	int n, m;
	cin >> n >> m;
	vi dp(n);
	vvi g(n);
	for (int i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		a--; b--;
		g[a].push_back(b);
	}
	vector<bool> visited(n, false);
	function<void(int)> dfs = [&](int u)
	{
		visited[u] = true;
		for (auto v : g[u])
		{
			if (!visited[v])
				dfs(v);

			max_self(dp[u], dp[v] + 1);
		}
	};
	for (int i = 0; i < n; i++)
		if (!visited[i])
			dfs(i);
	cout << *max_element(all(dp));
	return 0;
}

Measured memory_bytes: 8832
use std::io::*;
use std::str::FromStr;

fn main() {
	let mut h: u64 = read();
	let mut n: u32 = 1;
	while h != 1 {
		h /= 2;
		n += 1;
	}
	let ans: u64 = 2_u64.pow(n) - 1;
	println!("{}", ans);
}

fn read<T: FromStr>() -> T {
	let stdin = stdin();
	let stdin = stdin.lock();
	let token: String = stdin
		.bytes()
		.map(|c| c.expect("failed to read char") as char)
		.skip_while(|c| c.is_whitespace())
		.take_while(|c| !c.is_whitespace())
		.collect();
	token.parse().ok().expect("failed to parse token")
}



Measured memory_bytes: 4352
#include <iostream>
#include <stdio.h>
#include <ctype.h>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

string reverse(string str)
{
  char temp;
  for(int i=0;i<str.size()/2;i++){
    temp = str[i];
    str[i] = str[str.size()-1-i];
    str[str.size()-1-i] = temp;
  }
  return str;
}

int main (){
  
  string str,temp,tempL,tempR;
  int i,j,n;
  
  cin >>n;
  
  for(j=0;j<n;j++){
  
    cin >>str;
  
    vector<string> pattern;
    for(i=1;i<str.size();i++){
      tempL = str.substr(0,i);
      tempR = str.substr(i);
      
      //無・無
      temp = tempL + tempR;
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      //有・無
      temp = reverse(tempL) + tempR;
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      //無・有
      temp = tempL + reverse(tempR);
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      //有・有
      temp = reverse(tempL) + reverse(tempR);
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      temp = tempL;
      tempL = tempR;
      tempR = temp;
      
      //無・無
      temp = tempL + tempR;
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      //有・無
      temp = reverse(tempL) + tempR;
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      //無・有
      temp = tempL + reverse(tempR);
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
      //有・有
      temp = reverse(tempL) + reverse(tempR);
      if (find(pattern.begin(),pattern.end(),temp)==pattern.end()){
	pattern.push_back(temp);
      }
    }
    
    cout << pattern.size() << endl;
  }
  return 0;
}

Measured memory_bytes: 1276
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]B - Time Limit Exceeded
            var line = ReadLine();
            int n = line[0];
            int t = line[1];

            var fares = GetFares(n, t).ToList();

            if (fares.Count == 0)
            {
                Console.WriteLine("TLE");
            }
            else
            {
                Console.WriteLine(fares.Min());
            }
        }

        static IEnumerable<int> GetFares(int n, int t)
        {
            for(int i = 0; i < n; i++)
            {
                var line = ReadLine();
                int cost = line[0];
                int time = line[1];

                if (time <= t)
                {
                    yield return cost;
                }                
            }
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine().TrimEnd();
            var array = line.Split(' ');
            var numbers = new List<int>();

            foreach (var s in array)
            {
                int num = int.Parse(s);
                numbers.Add(num);
            }

            return numbers;
        }
    }
}

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

//二部グラフ
long long int n, m;
long long int black = 0;
vector<vector<int>>graph;
vector<int>color;

bool dfs(int v, int c) {
	color[v] = c;
	for (int i = 0; i < graph[v].size(); ++i) {
		if (color[graph[v][i]] == c)return false;//隣の色が同じなら失敗
		if (color[graph[v][i]] == -1) {//まだ塗られていないなら
			if (!dfs(graph[v][i], 1 - c))return false;//if文は()のなかが0のとき実行されない。つまり、これが実行されるのは!dfs=1つまりdfsがfalseを返したとき
		}
	}
	return true;
}

int main() {
	cin >> n >> m;
	graph.resize(n, vector<int>());
	color.resize(n, -1);
	bool judge;
	int a, b;
	for (int i = 0; i < m; ++i) {
		cin >> a >> b;
		a--; b--;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}
	judge = dfs(0, 0);
	if (judge) {
		for (int i = 0; i < n; ++i)if (color[i] == 1)++black;
		cout << black * (n - black) - m << endl;
	}
	else cout << n * (n - 1) / 2 - m << endl;
	return 0;
}

Measured memory_bytes: 6528
#include "bits/stdc++.h"
typedef long long ll;
using namespace std;
int main()
{
    int x;
    cin >> x;
    vector<ll> v;
    for (ll i = 0L; i * i * i * i * i <= 100000000000000; i++)
    {
        v.push_back(i * i * i * i * i);
    }
    bool isfound = false;
    for (int i = 0; i < 631; i++)
    {
        for (int j = 0; j < 631; j++)
        {
            if (v[i] - v[j] == x)
            {
                isfound = true;
                cout << i << " " << j << endl;
                break;
            }
            if (v[i] + v[j] == x)
            {
                isfound = true;
                cout << i << " " << -1 * j << endl;
                break;
            }
        }
        if (isfound)
            break;
    }
}

Measured memory_bytes: 3628
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;


namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    { 
        
        static void Main(string[] args)
        {
            var s = ReadLine();
            int ans = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == '1')
                {
                    ans++;
                }
            }
            WriteLine(ans);
        }
    }
}


Measured memory_bytes: 11092
def inpl(): return list(map(int, input().split()))


A = [int(input()) for _ in range(4)]

ans = 0
for a in range(A[0]+1):
    for b in range(A[1]+1):
        for c in range(A[2] +1):
            if 500*a+100*b+c*50==A[3]:
                ans += 1
print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> vec(26, 0);
  for (int i = 0; i < n; ++i)
    ++vec[s[i] - 'a'];

  int cnt_max = 0;
  int cnt = 0;
  vector<int> selected(26, false);
  for (int i = 0; i < n; ++i) {
    char c = s[i] - 'a';
    if (1 < vec[c] && selected[c] == false) {
      ++cnt;
      selected[c] = true;
    }
    if (vec[c] == 1 && selected[c] == true)
      --cnt;
    --vec[c];
    cnt_max = max(cnt_max, cnt);
  }

  cout << cnt_max << endl;
}


Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout<< (x) << " "

int main(){
    int a,b;cin>>a>>b;
    int cnt=0;
    for(int i=a;i<=b;i++){
        cnt+= (i<0)?1:0;
        if(i==0){co("Zero");return 0;}
    }
    co((cnt%2==1)?"Negative":"Positive");
}

Measured memory_bytes: 256
import java.io.*; 
import java.math.*;
import java.util.*;
public class Main {  //~IQEmperor~ 
	public static void main(String[] args) {
		FastScanner I = new FastScanner(); //Input
		OutPut O = new OutPut(); //Output
		int ans = 0;
		int N = I.nextInt();
		long[] a = new long[N];
		for (int i = 0; i < N; i++) a[i] = I.nextLong();
		for (int i = 0; i < N; i++) {
			for (int j = i+1; j < N; j++) {
				for (int k = j+1; k < N; k++) {
					if (a[i]!=a[j]&&a[i]!=a[k]&&a[j]!=a[k]) {
						long[] s = {a[j],a[k],a[i]};
						Arrays.sort(s);
						if (s[0]+s[1]>s[2]) ans++;
					}
				}
			}
		}
		O.pln(ans);
		//O.pln("ZERO");
	}
	public static long min(long a, long b) {return Math.min(a,b);}
	public static long max(long a, long b) {return Math.max(a,b);}
	public static int min(int a, int b) {return Math.min(a,b);}
	public static int max(int a, int b) {return Math.max(a,b);}
	public static long abs(long x, long y) {return Math.abs(x-y);}
	public static long ceil(long num, long den) {long ans = num/den; if (num%den!=0) 
	ans++; return ans;}
	public static long GCD(long a, long b) {
		if (a==0||b==0) return Math.max(a,b);
		return GCD(Math.min(a, b),Math.max(a, b)%Math.min(a, b));
	}
	public static long FastExp(long base, long exp, long mod) {
		long ans=1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			exp/=2;
			base*=base;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
	public static long ModInv(long num,long mod) {return FastExp(num,mod-2,mod);}
	public static int pop(long x) { //Returns number of bits within a number
		int cnt = 0;
		while (x>0) {
			if (x%2==1) cnt++;
			x/=2;
		}
		return cnt;
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());};
		double nextDouble() {return Double.parseDouble(next());}
	}
	static class OutPut{
		PrintWriter w = new PrintWriter(System.out);
		void pln(double x) {w.println(x);w.flush();}
		void pln(boolean x) {w.println(x);w.flush();}
		void pln(int x) {w.println(x);w.flush();}
		void pln(long x) {w.println(x);w.flush();}
		void pln(String x) {w.println(x);w.flush();}
		void pln(char x) {w.println(x);w.flush();}
		void pln(StringBuilder x) {w.println(x);w.flush();}
		void pln(BigInteger x) {w.println(x);w.flush();}
		void p(int x) {w.print(x);w.flush();}
		void p(long x) {w.print(x);w.flush();}
		void p(String x) {w.print(x);w.flush();}
		void p(char x) {w.print(x);w.flush();}
		void p(StringBuilder x) {w.print(x);w.flush();}
		void p(BigInteger x) {w.print(x);w.flush();}
		void p(double x) {w.print(x);w.flush();}
		void p(boolean x) {w.print(x);w.flush();}
	}
}


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

using namespace std;

long long inf=1000000007;

int main(){
	long long n,k;
	cin>>n>>k;
	vector<long long> syoki(n);

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

	//O(N^2)ならimos法で実装できる

	for(int i=0;i<k;i++){
		vector<long long> imos(n+1,0);
		vector<long long> ruiseki(n+1,0);

		for(int i=0;i<n;i++){
			imos.at(max((long long)0,i-syoki.at(i)))++;
			imos.at(min(n,i+syoki.at(i)+1))--;
		}

		bool flag=true;

		for(int i=1;i<=n;i++){
			ruiseki.at(i)=ruiseki.at(i-1)+imos.at(i-1);
			syoki.at(i-1)=ruiseki.at(i);

			if(syoki.at(i-1)!=n) flag=false;
		}

		if(flag) break;
	}

	for(int i=0;i<n;i++){
		cout<<syoki.at(i);
		if(i<n-1) cout<<" ";
		else cout<<endl;
	}

	return 0;
}


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

int main()
{
    ll a, b;
    cin >> a >> b;

    for(ll i = 1;  i < 10000; i++){
        ll ia = i * 0.08;
        ll ib = i * 0.1;
        if(ia == a && ib == b){
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;


    return 0;
}

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

using namespace std;
int main(void)
{
    int n;
    cin >> n;
    long long int tmp;
    long long int mi=10000000000,ma=0;
    for(int i = 1; i<=n ; i++){
        cin >> tmp;
        ma = max(tmp,ma);
        mi = min(tmp,mi); 
    } 
    cout << ma - mi;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int K,N,a[200001],maxi=0;

int main(){
    cin >> K >> N;
    for (int i=0;i<N;i++) cin >> a[i];
    
    a[N] = K + a[0];
    int prev_v = a[0],tmp_maxi;
    for(int i=0;i<N+1;i++){
        tmp_maxi = a[i] - prev_v;
        if(tmp_maxi >= maxi) maxi = tmp_maxi;
        prev_v = a[i];
    }
    cout << K - maxi << endl;
}

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

int main(void){
    string s;
    cin >> s;
    int length = 0;
    for(int i=0;i<s.size();){
        int pl = 0;
        if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){
            while(i<s.size() && s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T'){pl++; i++;}
            length = max(length,pl);
        }else{
            i++;
        }
    }
    cout << length << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  double R;
  cin>>R;
  double a=2.000000000;
  double b=22.000000000;
  double c=7.00000000000;
  double ans=a*b*R;
  ans=ans/c;
  cout<<ans<<"\n";
  
}

Measured memory_bytes: 3788
#include <stdio.h>
#define MAX 100000

typedef struct{
  char name[10];
  int time;
}Queue;
Queue queue[MAX];

void enqueue(Queue);
Queue dequeue();
int isEmpty();
int isFull();

int head,tail;

int main(){
  int n,q,i,sum=0;
  Queue Q;
  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    scanf("%s%d",Q.name,&Q.time);
    enqueue(Q);
  }
  while(head!=tail){
    Q=dequeue();
    if( Q.time > q ){
      sum+=q;
      Q.time-=q;
      enqueue(Q);
    }
    else{
      sum+=Q.time;
      printf("%s %d\n",Q.name,sum);
    }
  }
  return 0;
}
int isFull(){
  return head==(tail+1)%MAX;
}
int isEmpty(){
  return head==tail;
}
void enqueue(Queue x){
  if(isFull())fprintf(stderr,"overflow\n");
  queue[tail]=x;
  if(tail+1==MAX) tail=0;
  else tail++;
}

Queue dequeue(){
  Queue x;
  if(isEmpty())fprintf(stderr,"underflow\n");
  x=queue[head];
  if(head+1==MAX) head=0;
  else head++;
  return x;
}

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

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;

typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _ % MOD
#define __ %= MOD

#define each(it, s) for (auto it = s.begin(); it != s.end(); ++it)
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.begin(), v.end(), greater<auto>())
#define fill(a) memset(a, 0, sizeof(a))

#define swap(a, b) \
	{              \
		a = a + b; \
		b = a - b; \
		a = a - b; \
	}
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repA(i, a, n) for (ll i = a; i <= (n); ++i)
#define repD(i, a, n) for (ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) << endl

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

#define fbo find_by_order
#define ook order_of_key

#define pv(a)                                 \
	{                                         \
		rep(i, a.size()) cout << a[i] << " "; \
		cout << endl;                         \
	}
#define mark(v) cout << "Here--" << v << endl;

const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}
ll power(ll x, ll y)
{
	ll res = 1;
	while (y > 0)
	{
		if (y & 1)
			res = res * x;
		y = y >> 1;
		x = x * x;
	}
	return res;
} // modular exponent

int main()
{
	ios_base::sync_with_stdio(false); // don't use printf and scanf
	cin.tie(NULL);					  // cout<<fixed<<setprecision
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	if (b < a)
		swap(a, b);
	if (d < c)
		swap(c, d);
	ll ans = 1;
	ans = max(max(b * d, b * c), max(a * d, a * c));
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3688
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int k = Integer.parseInt(sc.next());
    int x = Integer.parseInt(sc.next());
    if(x <= 500 * k){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}
      

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

const string number_bits[11] =
{
    "0111111",
    "0000110",
    "1011011",
    "1001111",
    "1100110",
    "1101101",
    "1111101",
    "0100111",
    "1111111",
    "1101111",
    "0000000"
};

int main()
{
    while(1)
    {
        int n;
        int cur_d;
        int pre_d = 10;
        cin >> n;
        if(n == -1)
        {
            break;
        }
        for(int i=0; i<n; i++)
        {
            string ans;
            cin >> cur_d;
            
            for(int j=0; j<7; j++)
            {
                if(number_bits[cur_d][j] == number_bits[pre_d][j])
                {
                    ans += "0";
                }
                else
                {
                    ans += "1";
                }
            }
            pre_d = cur_d;
            cout << ans << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3196
#include<iostream>
using namespace std;
int main(){
  bool num[1000000] = {false};
  for(int i=2; i<1000; i++){
    if(!num[i]){
      for(int j = i*i; j<1000000; j+=i){
    num[j] = true;
      }
    }
  }
  int n;
  while(cin >>n){
    int ans = 0;
    for(int i=2; i<=n; i++){
      if(!num[i]){ans++;}
    }
    cout <<ans<<endl;
  }
  return 0;
}

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

int main() {
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    int n;
    cin>>n;
    for(int i = 111;i <= 999;i += 111) {
        if(i >= n) {cout<<i; return 0;}
    }
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,min,max,ans=0,i,a,b,c,d,e,sum;
  cin >>N>>min>>max;

  for(i=0;i<=N;i++){
    a=i/10000;
    b=(i%10000)/1000;
    c=(i%1000)/100;
    d=(i%100)/10;
    e=(i%10);
    sum=a+b+c+d+e;


    if(min<=sum && sum<=max){
      ans+=i;
    }
  }

  cout<<ans<<endl;


  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

const int MX = 100010;
int bit[MX];
void add(int i, int x){ for(; i < MX; i += i & -i) bit[i] += x; }
int sum(int i){ int res = 0; for(; i; i -= i & -i) res += bit[i]; return res; }

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n, m; cin >> n >> m;
	vector<tuple<int,int,int>> in;
	vi ans(m+1);
	rep(i, n){
		int l, r; cin >> l >> r;
		in.emplace_back(r - l, l, r);
		add(l, 1);
		add(r + 1, -1);
	}
	sort(all(in));
	for(int i = m, j = n - 1; i > 0; i--){
		while(j >= 0 && get<0>(in[j]) >= i - 1){
			add(get<1>(in[j]), -1);
			add(get<2>(in[j]) + 1, 1);
			j--;
		}
		for(int k = i; k <= m; k += i) ans[i] += sum(k);
		ans[i] += n - j - 1;
	}
	for(int i = 1; i <= m; i++) cout << ans[i] << endl;
	return 0;
}

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

int main(){
	
	int k; cin>>k;
	int64_t cnt{};
	for(int i=1; i<=k; i++){
		for(int j=1; j<=k; j++){
			for(int l=1; l<=k; l++){
				cnt+=gcd(gcd(i,j),l);
			}
		}
	}
	cout << cnt << endl;
	
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main(void) {

	// TODO: submit前にprintf-debugの削除確認！
	int N, M;
	cin >> N >> M;

	int X[M];
	for(int i=0; i<M; i++) {
		int x;
		cin >> x;

		X[i] = x;
	}

	sort(X, X+M);
	int diff[M-1];
	for(int i=0; i<M-1; i++) {
		diff[i] = X[i+1] - X[i];
		// cout << "[deb] " << diff[i] << endl;
	}
	sort(diff, diff+M-1);

	long long ans = 0;
	for(int i=0; i<M-N; i++) {
		ans += diff[i];
		// cout << "[deb] " << diff[i] << endl;
	}

	cout << ans;
	return 0;
}



Measured memory_bytes: 1024