akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

typedef long long llint;

int main() {
  int n, k;
  cin >> n >> k;
  vector<llint> a, b;
  for (int i = 0; i < n; i++) {
    llint x;
    cin >> x;
    if (x < 0)
      a.emplace_back(-x);
    else
      b.emplace_back(x);
  }
  reverse(a.begin(), a.end());
  if (a.empty()) {
    cout << b[k - 1] << endl;
  } else if (b.empty()) {
    cout << a[k - 1] << endl;
  } else {
    llint ans = 1e18, v = 0, w = 0;
    int vi = 0, cnt = 0;
    for (int i = 0; i < min(k, (int)a.size()); i++) {
      v = a[i];
      vi = i;
      cnt++;
    }
    for (int i = 0; i < min(k, (int)b.size()); i++) {
      w = b[i];
      cnt++;
      if (cnt == k) {
        llint res = min(2 * v + w, v + 2 * w);
        ans = min(ans, res);
      } else if (cnt > k) {
        vi--;
        if (vi < 0)
          v = 0;
        else
          v = a[vi];
        llint res = min(2 * v + w, v + 2 * w);
        ans = min(ans, res);
      }
    }
    cout << ans << endl;
  }

  return 0;
}

Measured memory_bytes: 1656
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2005;
const int mod=1e9+7;

#define endl "\n"

int dp[N][N];

void solve(int n){
	for(int i=0;i<=n;i++) dp[i][0]=1;
	dp[1][1]=1;
	for(int i=2;i<=n;i++)
		for(int j=1;j<=n;j++)
			dp[i][j]=(1ll*dp[i-1][j]+dp[i-1][j-1])%mod;
}

int C(int n,int m){
	if(n<0||m<0||m>n) return 0;
	return dp[n][m];
}

int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int k,n;
	cin>>n>>k;
	solve(n);
	for(int i=1;i<=k;i++){
		cout<<1ll*C(k-1,i-1)*C(n-k+1,i)%mod<<endl;
		//cout<<1ll*C(k-1,i-1)*(1ll*C(n-k-1,i-2)+C(n-k-1,i-1)+C(n-k-1,i))%mod<<endl;
	}
	return 0;
}
/*
隔板法。
k个蓝球分成i分，所有蓝球之间有k-1个间隙，需要有i-1个隔板， 
故共有C(k-1,i-1)种分法。 
n-k个红球，共有n-k+1个位置用于放蓝球堆，选其中i个位置
作为隔板，C(n-k+1,i)。
组合数可以用递推公式C(n,m)=C(n-1,m)+C(n-1,m-1)求得，
时间复杂度O(n^2) ，也可以求阶乘和阶乘的逆元求组合数，复杂度更低。 
*/

Measured memory_bytes: 16000
M,D=map(int,input().split())
count = 0
for d in range(22,D+1):
    d1 = d % 10
    d2 = (d - d % 10)/10
    if d1 < 2 or d2 < 2:continue
    elif d1 * d2 <= M:
        count += 1
print(count)

Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
using namespace std;

bool check(int x){
	if(x == 2)return true;
	if(x == 1 || x%2 == 0)return false;
	for(int i = 3;i <= sqrt(x);i+=2){
		if(x%i == 0)return false;
	}
	return true;
}

int main(){
	int n,p;
	vector<int> v,res;
	while(1){
		cin >> n >> p;
		if(n < 0)break;
		v.clear();
		res.clear();
		for(int i = n+1;;i++){
			if(check(i))v.push_back(i);
			if(v.size() > 100)break;
		}
		//for(int i = 0;i < 100;i++){
		//	cout << v[i] << endl;
		//}
		for(int i = 0;i < 100;i++){
			for(int j = i;j < 100;j++){
				res.push_back(v[i] + v[j]);
			}
		}
		sort(res.begin(),res.end());
		cout << res[p-1] << endl;

	}
	return 0;
}

Measured memory_bytes: 1276
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;
typedef long long i64;
typedef long double ld;
typedef pair<i64,i64> P;
#define rep(i,s,e) for(int i = (s);i <= (e);i++)

ld a,b;

int main(){
  cin >> a >> b;
  if(a > b) swap(a,b);
  cout << fixed << setprecision(8);
  ld angle1 =  (b - a) / 2;
  ld angle2 = (360 + a - b) / 2;
  if(angle1 < angle2){
    cout << a + angle1 << endl;
  }
  else{
    angle2 = a - angle2;
    if(angle2 < 0) angle2 += 360;
    cout << angle2 << endl;
  }

}



Measured memory_bytes: 3288
h, w = map(int, input().split())
c = []
for i in range(10):
    c_tmp = list(map(int, input().split()))
    c.append(c_tmp)
a = []
for i in range(h):
    a_tmp = list(map(int, input().split()))
    a += a_tmp

a2 = [_ for _ in a if _ not in [-1, 1]]

c_min = [c_tmp[1] for c_tmp in c]

while True:
    c_tmp = [_ for _ in c_min]
    for i in [0, 2, 3, 4, 5, 6, 7, 8, 9]:
        for j in [0, 2, 3, 4, 5, 6, 7, 8, 9]:
            if i == j:
                continue
            if c_min[i] >= c[i][j] + c_tmp[j]:
                c_min[i] = c[i][j] + c_tmp[j]

    if c_tmp == c_min:
        break

res = 0
for ai in a2:
    res += c_min[ai]
print(res)

Measured memory_bytes: 3876
// {{{ by shik
#include <bits/stdc++.h>
#include <unistd.h>
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define FOR(it,c) for ( auto it=(c).begin(); it!=(c).end(); it++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

#ifdef SHIK
template<typename T>
void _dump( const char* s, T&& head ) { cerr<<s<<"="<<head<<endl; }

template<typename T, typename... Args>
void _dump( const char* s, T&& head, Args&&... tail ) {
    int c=0;
    while ( *s!=',' || c!=0 ) {
        if ( *s=='(' || *s=='[' || *s=='{' ) c++;
        if ( *s==')' || *s==']' || *s=='}' ) c--;
        cerr<<*s++;
    }
    cerr<<"="<<head<<", ";
    _dump(s+1,tail...);
}

#define dump(...) do { \
    fprintf(stderr, "%s:%d - ", __PRETTY_FUNCTION__, __LINE__); \
    _dump(#__VA_ARGS__, __VA_ARGS__); \
} while (0)

template<typename Iter>
ostream& _out( ostream &s, Iter b, Iter e ) {
    s<<"[";
    for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
    s<<"]";
    return s;
}

template<typename A, typename B>
ostream& operator <<( ostream &s, const pair<A,B> &p ) { return s<<"("<<p.first<<","<<p.second<<")"; }
template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) { return _out(s,ALL(c)); }
template<typename T, size_t N>
ostream& operator <<( ostream &s, const array<T,N> &c ) { return _out(s,ALL(c)); }
template<typename T>
ostream& operator <<( ostream &s, const set<T> &c ) { return _out(s,ALL(c)); }
template<typename A, typename B>
ostream& operator <<( ostream &s, const map<A,B> &c ) { return _out(s,ALL(c)); }
#else
#define dump(...)
#endif

template<typename T>
void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( long long &x ) { scanf("%" PRId64,&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<typename T, typename... U>
void R( T& head, U&... tail ) {
    _R(head);
    R(tail...);
}

template<typename T>
void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
template<typename T>
void _W( const vector<T> &x ) {
    for ( auto i=x.cbegin(); i!=x.cend(); i++ ) {
        if ( i!=x.cbegin() ) putchar(' ');
        _W(*i);
    }
}

void W() {}
template<typename T, typename... U>
void W( const T& head, const U&... tail ) {
    _W(head);
    putchar(sizeof...(tail)?' ':'\n');
    W(tail...);
}

#ifdef SHIK
#define FILEIO(...)
#else
#define FILEIO(name) do {\
    freopen(name ".in","r",stdin); \
    freopen(name ".out","w",stdout); \
} while (0)
#endif

// }}}

const int N=55;
const int M=55;

int n,m,a[N];
LL dp[N][N][N*M];
int main() {
    R(n,m);
    REP(i,n) R(a[i]);
    dp[0][0][0]=1;
    REP(i,n) REP1(j,0,i) REP1(k,0,j*M) {
        LL me=dp[i][j][k];
        if ( me==0 ) continue;
        dp[i+1][j][k]+=me;
        dp[i+1][j+1][k+a[i]]+=me;
    }
    LL ans=0;
    REP1(i,1,n) ans+=dp[n][i][i*m];
    W(ans);
    return 0;
}


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

	int a[3000000][2]={};//
void f(int z){
		if(a[z*2][1]>=a[z*2+1][1]){
			a[z][0]=a[z*2][0];
			a[z][1]=a[z*2][1];
		}else{
			a[z][0]=a[z*2+1][0];
			a[z][1]=a[z*2+1][1];
		}
	if(z!=1)f(z/2);
}


int main(){
	int m,x,y,n;
	int q=0;
	cin>>n>>m;
	for(q=1;q<n;q=q*2);
	for(int i=1;i<=n;i++)a[i+q-1][0]=i;
	for(int i=0;i<m;i++){
		cin>>x>>y;
		a[q+x-1][1]+=y;
		f((q+x-1)/2);
		cout<<a[1][0]<<' '<<a[1][1]<<endl;
	}
	return 0;
}

Measured memory_bytes: 17464
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    int a , b = 0 , c = 0 , d = 0;
    for( int i = 0 ; i < n ; i++ ) {
        cin >> a;
        if( a % 4 == 0 ) b++;
        else if( a % 4 == 2 ) c++;
        else d++;
    }
    if( d <= b ) cout << "Yes";
    else if( c == 0 && d <= b + 1 ) cout << "Yes";
    else cout << "No";
}




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

#define ll long long
#define INF 10e8
#define rep(i,n) for(int i=0; i<n; i++)
#define repr(i,n,m) for(int i=m; i<n; i++)
#define MAX 100
#define MOD 1000000007
#define pb push_back
#define debug(x) cout << x << endl;
#define END cout << endl;
#define sorti(x) sort(x.begin(), x.end())

/* ダイクストラ法, vector gにedgeを入れます */
typedef pair<int, int> P; // firstは最短距離, secondは頂点の番号
typedef struct edge {int to, cost;} edge;
vector<edge> g[100002];
int d[100001];
int V; //頂点の数を入れること

void dijkstra(int s) {
  priority_queue<P,vector<P>,greater<P> > que;
  for (int i = 0; i <= V; ++i) d[i] = INF;
  d[s] = 0;
  que.push(P(0,s));

  while (!que.empty()) {
    P p = que.top(); que.pop();
    int v = p.second;

    if (d[v] < p.first) continue;

    for (int i = 0; i < g[v].size(); ++i) {
      edge e = g[v][i];
      if (d[e.to] > d[v] + e.cost) {
        d[e.to] = d[v] + e.cost;
        que.push(P(d[e.to], e.to));
      }
    }
  }
}

int main() {
  int n,a,b; cin >> V;
  rep(i,V-1) {
    cin >> a >> b;
    g[a].pb({b,1});
    g[b].pb({a,1});
  }
  vector<int> cost1(V+1), cost2(V+1);
  int cnt1 = 0, cnt2 = 0;
  
  dijkstra(1);
  rep(i,V+1) {
    cost1[i] = d[i];
  }
  dijkstra(V);
  rep(i,V+1) {
    cost2[i] = d[i];
  }
  
  repr(i,V+1,1) {
    if (cost1[i] <= cost2[i]) cnt1 += 1; else cnt2 += 1;
  }
  
  printf((cnt1 > cnt2) ? "Fennec" : "Snuke");
}

Measured memory_bytes: 7876
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
constexpr char ln = '\n';

const int mx=100010;
const ll mod=1e9+7;

int main(){
  int h,w,n,x,y;
  cin >> h >> w >> n >> x >> y;
  string s,t;
  cin >> s >> t;

  int cntr = y, cntl = y, cntu = x, cntd = x;
  rep(i,n){
    if(s[i]=='R'){ cntr++; }
    if(s[i]=='L'){ cntl--; }
    if(s[i]=='D'){ cntu++; }
    if(s[i]=='U'){ cntd--; }
    if(cntr > w){ cout << "NO" << ln; return 0;}
    if(cntl < 1){ cout << "NO" << ln; return 0;}
    if(cntu > h){ cout << "NO" << ln; return 0;}
    if(cntd < 1){ cout << "NO" << ln; return 0;}
    if(t[i]=='L'&&cntr>1){ cntr--; }
    if(t[i]=='R'&&cntl<w){ cntl++; }
    if(t[i]=='U'&&cntu>1){ cntu--; }
    if(t[i]=='D'&&cntd<h){ cntd++; }
  }

  
  cout << "YES" << ln;
  return 0;
}

Measured memory_bytes: 776
import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String s = scan.next();

		int end = (int)'Z';

		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < s.length(); i++) {
			int temp = (int)s.charAt(i);
			if(temp + n > end) {
				sb.append((char)(temp + n - 26));
			}else {
				sb.append((char)(temp + n));
			}
		}
		System.out.println(sb.toString());
	}
}


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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;cin >> n;
	int k;cin >> k;
	int a[300000];
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	for(int i = k; i < n; i++){
		if(a[i-k] < a[i]){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 4448
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()

using namespace std;

const int MSIZE = 21;
const long long mod = 1e9 + 7;

int g[MSIZE][MSIZE];
long long dp[1 << MSIZE];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> g[i][j];
        }
    }
    vector<int> masks[n];
    for (int i = 0; i < (1 << n) - 1; i++) {
        masks[__builtin_popcount(i)].push_back(i);
    }

    memset(dp, 0, sizeof dp);
    dp[0] = 1;

    for (int i = 0; i < n; i++) {
        for (int mask : masks[i]) {
            for (int j = 0; j < n; j++) {
                if ((mask >> j) & 1) continue;
                if (g[i][j] == 0) continue;
                int nxtMask = mask | (1 << j);
                dp[nxtMask] += dp[mask];
                dp[nxtMask] %= mod;
            }
        }
    }
    cout << dp[(1 << n) - 1] << endl;
}

Measured memory_bytes: 26044
#include <iostream>

using namespace std;
typedef long long ll;

int main(){
    ll a, b, c;
    cin >> a >> b >> c;
    ll m = max(a, max(b, c));
    ll d = a + b + c;
    if(d % 2 == (3 * m) % 2){
        cout << (3 * m - d) / 2 << endl;
    }else{
        cout << (3 * (m + 1) - d) / 2 << endl;
    }
    return 0;
}


Measured memory_bytes: 888
use std::collections::HashSet;
use std::io::Read;

fn main() {
    let mut buf = String::new();

    // 標準入力から全部bufに読み込む
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let N: u8 = iter.next().unwrap().parse().unwrap();
    let mochis: HashSet<u8> = (0..N)
        .map(|_| iter.next().unwrap().parse().unwrap())
        .collect();
    println!("{}", mochis.len());
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
#ifdef ONLINE_JUDGE
#define endl '\n'
#endif
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#ifndef ONLINE_JUDGE
#define tr(...) {__l(__LINE__);__f(#__VA_ARGS__, __VA_ARGS__);}
inline void __l(int line) { cerr << "#" << line << ": "; }template <typename Arg1>
void __f(const char* name, Arg1&& arg1){cerr << name << " : " << arg1 << endl;}template <typename Arg1, typename... Args>void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define tr(...)
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}template<typename T>inline std::ostream &operator << (std::ostream & os,const std::vector<T>& v){bool first = true;os << "[";for(auto i: v){if(!first)os << ", ";os << i;first = false;}return os << "]";}
const int N = 5*(int)1e5 + 10;
// make sure N size is correctttt!!!!!!!!!


int n;
int32_t main(){_

   int gc = 0;
   cin>>n;
   for (int i = 0; i < n; ++i)
   {
      int x;
      cin>>x;  
      gc = __gcd(gc, x);
   }

   cout<<gc;

   //make sure N size is correct!!!!!!!!!
   return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  int sec,h,m,s;
  cin >> sec ;

  for(h=0;;h++){
    if(3600 <= sec){
      sec -= 3600;
    }else{
      break;
    }
  }
  for(m=0;;m++){
    if(60 <= sec){
      sec -= 60;
    }else{
      break;
    }
  }

  cout << h <<":"<<m<<":"<<sec;

  cout << endl;
}



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

using namespace std;
typedef long long ll;

int main(){
    ll n, w;
    cin >> n >> w;
    vector<ll> weight, value;
    weight.resize(n);
    value.resize(n);
    for(int i = 0; i < n; ++i){
        cin >> weight.at(i);
        cin >> value.at(i);
    }

    vector<vector<ll>> dp(n + 1, vector<ll>(301, 0));
    for(int i = 0; i < n; ++i){
        for(int j = n - 1; j >= 0; --j){
            for(int l = 0; l + (weight.at(i) - weight.at(0)) <= 300; ++l){
                dp.at(j + 1).at(l + weight.at(i) - weight.at(0)) = max(
                    dp.at(j + 1).at(l + weight.at(i) - weight.at(0)),
                    dp.at(j).at(l) + value.at(i)
                );
            }
        }
    }

    ll ans = 0;
    for(int i = 1; i <= n; ++i){
        for(int j = 0; j <= 300; ++j){
            if(w >= i * weight.at(0) + j){
                // cerr << i << ' ' << j << ' ' << dp.at(i).at(j) << endl;
                ans = max(ans, dp.at(i).at(j));
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
package main

import (
	"fmt"
)

func main() {
	Q := 0
	MAX := 100000
	//エラトステネス
	list := make([]int, MAX)
	for i := range list {
		list[i] = 1
	}
	list[0] = 0
	list[1] = 0
	for j := 2; j < MAX; j++ {
		if list[j] == 0 {
			continue
		}
		for k := j * 2; k < MAX; k += j {
			list[k] = 0
		}
	}
	//like a 2017
	a := make([]int, MAX)
	for i := 0; i < MAX; i++ {
		if i%2 == 0 {
			continue
		}
		if list[i] == 1 && list[(i+1)/2] == 1 {
			a[i] = 1
		}
	}
	s := make([]int, MAX+1)
	for i := 0; i < MAX; i++ {
		s[i+1] = s[i] + a[i]
	}

	fmt.Scan(&Q)
	for i := 0; i < Q; i++ {
		l, r := 0, 0
		fmt.Scan(&l, &r)
		r++
		fmt.Println(s[r] - s[l])
	}

}


Measured memory_bytes: 5888
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var n = int.Parse(Console.ReadLine());
            var hi = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var can = true;
            for (var i = hi.Length - 1; i > 0; i--)
            {
                if (hi[i] >= hi[i - 1]) continue;
                if (hi[i - 1] - hi[i] == 1)
                {
                    hi[i - 1]--;
                }
                else
                {
                    can = false;
                    break;
                }
            }

            Console.WriteLine(can ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 32220
from heapq import heappop,heappush

N,Q=map(int,input().split())


event=[]
q=[]
for _ in range(N):
    S,T,X=map(int,input().split())
    event.append([S-X,1,X])
    event.append([T-X,-1,X])

for i in range(Q):
    event.append([int(input()),2,i])

stop_set=set()
event.sort()
q=[]

for pos,m,x in event:
    if m==-1:
        stop_set.remove(x)
        
    elif m==1:
        #heappushする時点でqはソートされている
        heappush(q,x)
        stop_set.add(x)
    
    else:
        #この時点でのstop_setは、i番目の人が遭遇する通行止めの座標
        #この時点でのqは今までstopになった座標
        while q:
            #qはソート済なので、q[0]は最小値　それがstop_setから外れている場合、heappopでそれを排除する
            if q[0] not in stop_set:
                heappop(q)
            #q[0]がstop_setから外れてない場合、それ以降のqも外れていないのでbreak    
            else:
                break

        if q:
            print(q[0])
        else:
            print(-1)

Measured memory_bytes: 115996
n,k = map(int,input().split())
d = list(map(int,input().split()))

allowed = {i for i in range(10) if i not in d}
maxn = 10**5

for k in range(1,maxn+1):
    if k >= n and all(int(c) in allowed for c in str(k)):
        print(k)
        break

Measured memory_bytes: 9192
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll R, G;
  cin >> R >> G;
  ll ans = 2 * G - R;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3568
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
#include<unordered_map>
#include <queue>
 
using namespace std;
using ll=long long;
#define rep(i,n)  for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()
 
int main(){
    ll n;
    string s;
    cin >> n >> s;
    ll ans = 0;
    rep(i, n){
        ans++;
        while(s[i]==s[i+1])i++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<long long> vec(N);

    int count = 0;
    for(int i = 0; i < N; i++) {
        long long A;
        cin >> A;
        if(A < 0) count++;
        vec[i] = abs(A);
    }

    sort(vec.begin(), vec.end());

    if(count % 2) {
        cout << accumulate(vec.begin(), vec.end(), (long long)0) - 2 * vec[0] << endl;
    } else {
        cout << accumulate(vec.begin(), vec.end(), (long long)0) << endl;
    }
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;

int main(){
    vector<int> v;
    int tmp;
    int a;
    int i;
    int ans = 0;
    int last;
    
    for(i = 0; i < 5; i++){
        cin >> a;
        v.push_back(a);
    }
    
    last = 0;
    if(v[0]%10 == 0){
        tmp = 10;
    }else{
        tmp = v[0]%10;
    }
    
    for(i = 1; i < 5; i++){
        if(v[i]%10 == 0){
            if(10 < tmp){
                last = i;
            }
        }else{
            if(v[i]%10 < tmp){
                last = i;
            }
        }
    }
    
    for(i = 0; i < 5; i++){
        if(i == last){
            ans += v[i];
        }else{
            if(v[i]%10 != 0){
                ans += v[i] + (10 - v[i]%10);
            }else{
                ans += v[i];
            }
        }
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <numeric>
#include <queue>
#include <map> 
#include <set>
#include <string>
#include <functional>
#include <list>
#define ll long long
#define oku7 1000000007
using namespace std;

bool cmpMagiMap(vector<vector<int>>& v1, vector<vector<int>>& v2) {
	bool result = true;
	for (size_t i = 0; i < v1.size(); i++) {
		for (size_t j = 0; j < v1[0].size(); j++) {
			if (v1[i][j] != v2[i][j]) {
				result = false;
				return false;
			}
		}
	}
	return true;
}

void updateMagiMap(vector<vector<int>>& magiMap) {
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			for (int k = 0; k < 10; k++) {
				//i,j:座標 k:参照先の行を走査
				magiMap[i][k] = min(magiMap[i][k], magiMap[i][j] + magiMap[j][k]);
			}
		}
	}
}


int main() {
	int H, W;
	vector<vector<int>> c,A;
	cin >> H >> W;
	for (int i = 0; i < 10; i++) {
		vector<int> tmp;
		for (int j = 0; j < 10; j++) {
			int n;
			cin >> n;
			tmp.push_back(n);
		}
		c.push_back(tmp);
	}

	for (int i = 0; i < H; i++) {
		vector<int> tmp;
		for (int j = 0; j < W; j++) {
			int n;
			cin >> n;
			tmp.push_back(n);
		}
		A.push_back(tmp);
	}

	//表が変わらなくなるまで更新
	
	vector<vector<int>> old = c;
	updateMagiMap(c);
	while (cmpMagiMap(c,old)==false){
		old = c;
		updateMagiMap(c);
	}
	int ans = 0;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) {
			if (A[i][j] != -1) {
				ans += c[A[i][j]][1];
			}
		}
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 384
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author /\
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DMegalomania solver = new DMegalomania();
        solver.solve(1, in, out);
        out.close();
    }

    static class DMegalomania {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            DMegalomania.Job[] jobs = new DMegalomania.Job[n];
            for (int i = 0; i < n; i++) {
                jobs[i] = new DMegalomania.Job(in.nextInt(), in.nextInt());
            }
            Arrays.sort(jobs, (j1, j2) -> j1.deadline - j2.deadline);
            long tot = 0;
            for (int i = 0; i < n; i++) {
                tot += jobs[i].time;
                if (tot > jobs[i].deadline) {
                    out.println("No");
                    return;
                }
            }
            out.println("Yes");
        }

        static class Job {
            int time;
            int deadline;

            public Job(int time, int deadline) {
                this.time = time;
                this.deadline = deadline;
            }

        }

    }

    static class Scanner {
        private StringTokenizer st;
        private BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 51940
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;
using static ConsoleApplication.Utils;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var n = ReadInt();
            var a = ReadInts();
            var res = a.Select(i => Pow(Round(i - a.Average()), 2)).Sum();
            WriteLine(res);
        }
    }

    public static class Utils
    {
        #region Extensions for IO

        public static int ReadInt()
            => ReadInts().First();

        public static IEnumerable<int> ReadInts()
            => ReadStrings().Select(int.Parse);

        public static IEnumerable<String> ReadStrings()
            => ReadLine().Split(' ');

        #endregion

        #region Extensions of int

        public static bool IsOdd(this int n)
            => !n.IsEven();

        public static bool IsEven(this int n)
            => n % 2 == 0;

        public static bool CanDivideWith(this int n, int divisor)
            => n % divisor == 0;

        #endregion

        #region Extensions of string

        public static int ToInt(this string str)
            => int.Parse(str);

        public static long ToLong(this string str)
            => long.Parse(str);

        public static bool IsNullOrEmpty(this string str)
            => string.IsNullOrEmpty(str);

        #endregion

        public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
        {
            foreach (var item in source)
            {
                action(item);
            }
        }

        public static IEnumerable<T> Peek<T>(this IEnumerable<T> source, Action<T> action)
        {
            foreach (var item in source)
            {
                action(item);
            }
            return source;
        }
    }
}


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

int main(){
  int n;
  cin >> n;
  vector<int> v;
  for(int i = 0;i < n;i++){
    int a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(),v.end());
  cout << v[n/2]-v[n/2-1] << endl;
}


Measured memory_bytes: 892
import java.math.*;
import java.util.*;
  


public class Main {
	
	
	
	public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N=scan.nextInt(),W=scan.nextInt();
        int dp[]=new int[W+1],v[]=new int[N],w[]=new int[N];
        for(int i=0;i<N;i++) {
        	v[i]=scan.nextInt();
        	w[i]=scan.nextInt();
        }
        for(int i=0;i<N;i++) {
        	for(int j=W;j>=w[i];j--) {
        		dp[j]=Math.max(dp[j], dp[j-w[i]]+v[i]);
        	}
        }
        System.out.println(dp[W]);
        
	}
	
	
	
}


Measured memory_bytes: 26880
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>

using namespace std;

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

#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb push_back
#define ppb pop_back
#define mkp make_pair
#define F first
#define S second
#define show(a) cerr << #a <<" -> "<< a <<"\n"

const int N = 1e5 + 1;
const int N2 = 101;
const int INF = 1e9 + 5;

int n, W, w[N2], v[N2], dp[N2][N], sum;

int main () {
	ios_base::sync_with_stdio(0);
	cin >> n >> W;
	for(int i = 1; i <= n; ++i) {
		cin >> w[i] >> v[i];
		sum += v[i];
	}			
	for(int m = 0; m <= sum; ++m)
		dp[0][m] = INF;
	dp[0][0] = 0;
	for(int i = 1; i <= n; ++i) {
		for(int m = 0; m <= sum; ++m) {
			if(m - v[i] >= 0)
				dp[i][m] = min(dp[i - 1][m], dp[i - 1][m - v[i]] + w[i]);
			else
				dp[i][m] = dp[i - 1][m]; 
		}
	}
	for(int m = sum; m >= 0; --m) {
//		cout << dp[n][m] <<' ';
		if(dp[n][m] <= W) {
			cout << m;
			return 0;
		}
	}
	return 0;
}


















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

int main(){
  int n;
  cin >> n;
  bool ans=false;
  for(int i=0;i<=25;++i){
    if(n-4*i>=0 && (n-4*i)%7==0)
      ans=true;
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

	int flag = 1;
	int a = scan.nextInt();
	int b = scan.nextInt();
	String s = scan.next();

	if(s.length() != a+b+1){
	    flag = 0;
	}
	

	for(int i = 0; i < a; i++){
	    if('0' <= s.charAt(i) && s.charAt(i) <= '9'){
	    }else{
		flag = 0;
	    }
	}


	if(s.charAt(a) != '-'){
	    flag = 0;
	}


	for(int i = a+1; i < s.length(); i++){
	    if('0' <= s.charAt(i) && s.charAt(i) <= '9'){
	    }else{
		flag = 0;
	    }
	}

	if(flag == 1){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
}

Measured memory_bytes: 23636
//84104971101048411497 - Can you guess what does this mean?
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef complex<double> point;
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define forrit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define maxN 55
#define oo 1000000000000000007LL
#define sz(a) (int)a.size()

const double PI = acos(-1.0);

double fRand(double fMin, double fMax)
{
    double f = (double)rand() / RAND_MAX;
    return fMin + f * (fMax - fMin);
}

template <class T>
T min(T a, T b, T c) {
    return min(a, min(b, c));
}

template <class T>
T max(T a, T b, T c) {
    return max(a, max(b, c));
}

int n, a[maxN], b[maxN];
bool c[maxN][maxN];
vector<int> taken;

bool Check(int x) {
    vector<int> allK(taken.begin(), taken.end());
    fto(k, 1, x) allK.pb(k);

    memset(c, false, sizeof c);
    fto(u, 0, 50) {
        c[u][u] = true;
        for(int k: allK) c[u][u%k] = true;
    }

    fto(u, 0, 50)
        fto(v, 0, 50)
            fto(k, 0, 50) c[u][v] |= c[u][k] & c[k][v];

    fto(i, 1, n) {
        if (!c[a[i]][b[i]]) return false;
    }
    return true;
}

int main () {
    scanf("%d", &n);
    fto(i, 1, n) scanf("%d", &a[i]);
    fto(i, 1, n) scanf("%d", &b[i]);

    if (!Check(50)) {
        puts("-1");
        return 0;
    }

    ll sum = 0;
    fdto(k, 50, 1) {
        if (!Check(k-1)) {
            taken.pb(k);
            sum += (1LL<<k);
        }
    }

    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 256
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#define INF 100000000000000
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド　引数：サイズ、値
//与えられたサイズと値でvectorを初期化する

bool isprime(llong num){
    if(num==1){
        return false;
    }
    for(int i=2; i<=sqrt(num); i++){
        if(num%i==0){
            return false;
        }
    }
    return true;
}

int main(){
    llong n;
    llong ans=0;
    cin >> n;
    vector<llong> num_list(n);
    for(int i=0; i<n; i++){
        cin >> num_list[i];
    }
    for(int i=0; i<num_list.size(); i++){
        if(isprime(num_list[i])){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


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

enum {
    B10 = 10000, B5 = 5000, B1 = 1000
};

inline int maxNumber(long yen, int bill){
    return int(yen / bill);
}

inline bool isCorrect(int x10, int x5, int x1, int n, long y){
    bool isPositive = ((x10 >= 0) && (x5 >= 0) && (x1 >=0));
    bool isCorrectN = (n == x10 + x5 + x1);
    bool isCorrectY = (y - B10*x10 - B5*x5 - B1*x1 == 0);

    return isPositive && isCorrectN && isCorrectY;
}

void fastAns(int& x10, int& x5, int& x1, int n, long y){
    x10 = min(n, maxNumber(y, B10));
    for(; x10 >= 0; x10--){
        x5 = min(n - x10, maxNumber(y - B10*x10, B5));
        for(; x5 >= 0; x5--){
            x1 = min(n - x10 - x5, maxNumber(y - B10*x10 - B5*x5, B1));

            if(isCorrect(x10, x5, x1, n, y)) return;
        }
    }
}

void simplyAns(int& x10, int& x5, int& x1, int n, long y){
    for(x10 = 0; x10 <= n; x10++){
        for(x5 = 0; x5 <= n - x10; x5++){
            x1 = n - x5 - x10;
            if(isCorrect(x10, x5, x1, n, y)) return;
        }
    }
}

int main(){
    int  n; cin >> n;
    long y; cin >> y;

    int x10 = -1, x5 = -1, x1 = -1;
    simplyAns(x10, x5, x1, n, y);

    if(isCorrect(x10, x5, x1, n, y)){
        cout << x10 << " " << x5 << " " << x1 << endl; 
    } else {
        cout << "-1 -1 -1" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define _GLIBCXX_DEBUG
const int INF=1e18;

signed main(){
  	int A,B;cin>>A>>B;
    cout<<(A-1)*(B-1)<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;

int main(){
    int N, M;
    cin >> N >> M;
    vector<pair<long long, long long>> AB(N);
    for(int i=0; i<N; i++)
        cin >> AB[i].first >> AB[i].second;
    sort(AB.begin(), AB.end());
    long long cnt = 0;
    long long ans = 0;
    for(int i=0; i<N && cnt < M; i++){
        long long tmp = min(M-cnt, AB[i].second);
        cnt += tmp;
        ans += tmp * AB[i].first;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

const int INF = INT_MAX / 2;

class Edge
{
public:
    int to, cost;
    Edge(){};
    Edge(int to0, int cost0){to = to0; cost = cost0;}
};

void shortestPath(const vector<vector<Edge> >& edges, int start, vector<int>& dist)
{
    dist.assign(edges.size(), INF);
    dist[start] = 0;
    priority_queue<pair<int,int> ,vector<pair<int,int> >, greater<pair<int,int> > > q;
    q.push(make_pair(0, start));

    while(!q.empty()){
        pair<int, int> p = q.top();
        q.pop();
        int v = p.second;
        if(dist[v] < p.first)
            continue;
        for(unsigned i=0; i<edges[v].size(); ++i){
            Edge e = edges[v][i];
            if(dist[v] + e.cost < dist[e.to]){
                dist[e.to] = dist[v] + e.cost;
                q.push(make_pair(dist[e.to], e.to));
            }
        }
    }
}

void shortestPath(const vector<vector<Edge> >& edges, vector<vector<int> >& dist)
{
    dist.resize(edges.size());
    for(unsigned i=0; i<edges.size(); ++i)
        shortestPath(edges, i, dist[i]);
}

int main()
{
    for(;;){
        int n, m, c, s, g; // 駅の数、路線の数、鉄道会社の数、出発地、目的地
        cin >> n >> m >> c >> s >> g;
        if(n == 0)
            return 0;

        vector<vector<vector<Edge> > > edges0(c+1, vector<vector<Edge> >(n+1));
        for(int i=0; i<m; ++i){
            int x, y, d, c;
            cin >> x >> y >> d >> c;
            edges0[c][x].push_back(Edge(y, d));
            edges0[c][y].push_back(Edge(x, d));
        }

        vector<vector<vector<int> > > dist(c+1); // 1種類の鉄道会社の路線だけを使ったときの最短距離
        for(int i=1; i<=c; ++i)
            shortestPath(edges0[i], dist[i]);

        vector<int> p(c+1);
        for(int i=1; i<=c; ++i)
            cin >> p[i];

        vector<vector<Edge> > edges(n+1);
        for(int i=1; i<=c; ++i){
            vector<int> q(p[i], INF), r(p[i]);
            for(int j=0; j<p[i]-1; ++j)
                cin >> q[j];
            for(int j=0; j<p[i]; ++j)
                cin >> r[j];

            int a = 0;
            vector<int> cost(20000, 0); // 距離に対する運賃
            for(int j=1; j<20000; ++j){
                if(j > q[a])
                    ++ a;
                cost[j] = cost[j-1] + r[a];
            }

            for(int j=1; j<=n; ++j){
                for(int k=1; k<=n; ++k){
                    if(dist[i][j][k] != INF)
                        edges[j].push_back(Edge(k, cost[dist[i][j][k]]));
                }
            }
        }

        vector<int> ret;
        shortestPath(edges, s, ret);
        if(ret[g] == INF)
            cout << -1 << endl;
        else
            cout << ret[g] << endl;
    }
}

Measured memory_bytes: 3540
n,a,b=map(int,input().split())
def combination(n, a, mod):
    bunbo = 1
    bunshi = 1
    for i in range(a):
        bunshi *= n-i
        bunshi = bunshi%mod
        bunbo *= a-i
        bunbo = bunbo%mod
        
    return bunshi*pow(bunbo, mod-2, mod)%mod
        
        
mod = 1000000007
answer = pow(2, n, mod)
answer -= 1
answer -= combination(n, a, mod)
answer -= combination(n, b, mod)
print(answer%mod)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <set>
#include <string>
#include <math.h>
#include <map>
#include <climits>
#include <iomanip>


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

#define ll long long

using namespace std;

void A();
void B();
void C();
void D();
void E();
void F();

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

	B();


}

void A() {

	int K, A, B;
	cin >> K >> A >> B;

	double qA = (double)A / (double)K;
	double qB = (double)B / (double)K;

	cout << (qA <= (int)qB ? "OK" : "NG");


}

void B() {

	ll Bal = 100;

	ll Goal;
	cin >> Goal;

	int yr = 0;
	while (Bal < Goal) {

		Bal += Bal / 100;
		yr++;
	}

	cout << yr;

}

void C() {

}

void D() {
	int T;
	cin >> T;
	for (int t = 1; t <= T; t++) {

		int N;
		cin >> N;


		int result = 0;

		cout << "Case #" << t << ": ";

		cout << result << endl;

	}
}

void E() {
	int T;
	cin >> T;
	for (int t = 1; t <= T; t++) {

		int N;
		cin >> N;


		int result = 0;

		cout << "Case #" << t << ": ";

		cout << result << endl;

	}
}

void F() {
	int T;
	cin >> T;
	for (int t = 1; t <= T; t++) {

		int N;
		cin >> N;


		int result = 0;

		cout << "Case #" << t << ": ";

		cout << result << endl;

	}
}



Measured memory_bytes: 3656
#pragma GCC optimize("Ofast")
#include<stdio.h>
int x;
char c;
inline int read()
{
    x=0; c=getchar();
    while(c<'0'||c>'9') c=getchar();
    while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
    return x;
}
int main(void)
{
    long n = read() + 1, ans = n - 1;
    for (int i = 2; i < n; ++i)
    {
        int u = read(), v = read();
        if(u > v) ans += n * (u - v);
        ans += i * (n - i) - u * (n - v);
    }
    printf("%ld", ans);
    return 0;
}


Measured memory_bytes: 1600
import java.util.*

fun main(args : Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    var sum = 0
    val array = IntArray(n)
    for (k in 0..n-1) {
        array[k] = scanner.nextInt()
    }

    for (i in 0..n-1) {
        val di = array[i]
        for (j in i+1..n-1) {
            val dj = array[j]
            val mul = di * dj
            sum += mul
        }
    }
    println(sum)
}

Measured memory_bytes: 29732
# coding: utf-8
n, m = map(int, input().split())
cnct = [list(map(int, input().split())) for i in range(m)]
p = list(map(int, input().split()))

ans = 0

for i in range(2 ** n):
    for idx, j in enumerate(cnct):
        switch_num = j[0]
        res = 0
        for k in range(1, switch_num + 1):
            if i & (1 << (j[k] - 1)):
                res += 1
        if res % 2 == p[idx]:
            continue
        else:
            break
        
    else:
        ans += 1

print(ans)


Measured memory_bytes: 3064
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    S =     _in[0]   # type:str
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    s = '2018'+S[4:]
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(s)


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

int main(){
    int N;
    string s;
    cin >> N;
    cin >> s;
    int einright = 0;
    int winleft = 0;
    for(size_t i = 1; i < N; i++)
    {
        if(s[i] == 'E')
            einright++;
    }
    int ret = einright;
    for(size_t i = 1; i < N; i++)
    {
        if (s[i] == 'E')
            einright--;
        if (s[i-1] == 'W')
            winleft++;
        if (einright+winleft < ret)
            ret = einright+winleft;
    }
    cout << ret << endl;
    
    return 0;
}

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

int main() {
    int a, b;
    cin >> a >> b;
    if (a > 8 || b > 8)
    {
        cout << ":(" << endl;
    }
    else
    {
        cout << "Yay!" << endl;
    }
    
    
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define finish(x) return cout << x << endl, 0
#define ll long long

const int N = 100001;

int n, mod = 1e9 + 7;
vector <int> a;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for(int i = 0 ; i < 2 * n ; i++){
        char c;
        cin >> c;
        a.push_back(c == 'W' ? 0 : 1);
    }
    int open = 0;
    int ans = 1;
    for(auto &i : a){
        if(open < 0) finish(0);
        if(((open & 1) ^ i) == 0){
            ans = 1LL * ans * open % mod;
            open--;
        }
        else open++;
    }
    if(open) finish(0);
    for(int i = 1 ; i <= n ; i++){
        ans = 1LL * ans * i % mod;
    }
    cout << ans << endl;
}


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

int main()
{
  string s, t;
  i64 a, b;
  string u;
  cin >> s >> t >> a >> b >> u;
  if (s == u)
    a--;
  else
    b--;
  cout << a << " " << b << endl;
  return 0;
}


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

using namespace std;

int main(){
    int a,b,l,c;
	cin>>a>>b;
    c = log10(b) + 1;
    a = a * pow(10,c) + b;
    if(round(sqrt(a))==sqrt(a)) cout<<"Yes";
	else cout<<"No";
}


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

typedef long long ll;

#define rep(a,b,c) for(int a=b,a##end=c;a<=a##end;++a)
#define drep(a,b,c) for(int a=b,a##end=c;a>=a##end;--a)


char IO;
int rd(){
	int s=0,f=0;
	while(IO=getchar(),IO<'0'||IO>'9')if(IO=='-')f=1;
	do s=(s<<1)+(s<<3)+(IO^'0');
	while(IO=getchar(),IO>='0'&&IO<='9');
	return f?-s:s;
}

const int N=300,K=50;

int n,m;

int a[N];

int main(){
	int ans=0;
	n=rd();
	rep(i,1,n) a[i]=rd();
	rep(i,2,n-1)
		if(a[i]>a[i-1]&&a[i]<a[i+1]) ans++;
		else if(a[i]<a[i-1]&&a[i]>a[i+1]) ans++;
	printf("%d\n",ans);
}








Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long

bool ok=true;
int ans=-1,maxx=0;
int color[210];
char s[210][210];
vector<vector<int>> adjl;

/*void dfs( int x, int len )
{
    cout <<x << " " << len << " kontas " << adjl[x].size() << " " << color[ adjl[x][0] ] << " " << adjl[x][0] <<endl;
    if(!ok) return;
    color[x]=len;
    maxx=max( maxx, len );
    for(int i=0;i<adjl[x].size();i++){
        int v = adjl[x][i];
        if( color[v]!=-1 && color[v]!=len-1 ){
            ok=false;
            return;
        }
        else if( color[v]==-1 ) dfs( v,len+1 );
    }
}*/
void bfs( int x )
{
    queue<int>q;
    color[x]=1;
    q.push(x);
    while( !q.empty() ){
            int u = q.front();
       //     cout << u << " " << color[u] << " ee " <<endl;
            q.pop();
             maxx=max( maxx,color[u] );
        for( int i=0;i<adjl[u].size();i++ ){
            int v = adjl[u][i];
            if( color[v]!=-1 && color[v] != color[u]-1 && color[v]!= color[u]+1 ){
             //       cout << " oppp  "<<endl;
                ok=false;
                return;
            }
            else if( color[v]==-1 ){
            color[v]=color[u]+1;
            q.push( v );
            }
        }
    }
}

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

            int n;
            cin>>n;
            adjl.resize(n);

            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    cin>>s[i][j];
                }
            }
            for(int i=0;i<n;i++){
                for(int j=i+1;j<n;j++){
                    if( s[i][j]=='1' ) adjl[i].pb(j), adjl[j].pb(i);
                }
            }

            for(int i=0;i<n;i++){
                    for(int j=0;j<n;j++)color[j]=-1;
                ok=true, maxx=0;
                bfs(i);
                if(ok) ans=max(maxx,ans);

            }

           // for(int i=0;i<adjl[0].size();i++) cout <<adjl[0][i] << " ee " <<endl;
            cout<<ans<<endl;

            return 0;
}































Measured memory_bytes: 512