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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll s,w;cin>>s>>w;
    cout << (s<=w?"unsafe":"safe") << endl;
}


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

main() {
  int N; cin >> N;
  vector<int> A(N); for (int i = 0; i < N; i++) cin >> A[i];
  cout << pow(3, N) - accumulate(begin(A), end(A), 1, [](int acc, int v){ return acc << (~v & 1); }) << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <math.h>

#ifdef _MSC_VER
#pragma warning(disable:4996)
#endif

using namespace std;


int main() {
	double pi = acos(-1);

	double a;
	scanf("%lf", &a);
	printf("%f", a*2*pi);

	return 0;
}


Measured memory_bytes: 3824
fn main() {
    let (n, m, k): (usize, usize, usize) = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    };
    let a: Vec<usize> = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let iter = buf.split_whitespace();
        iter.map(|x| x.parse().unwrap()).collect()
    };
    let b: Vec<usize> = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let iter = buf.split_whitespace();
        iter.map(|x| x.parse().unwrap()).collect()
    };

    let mut t = 0;
    let mut i = 0;
    while i < n && t + a[i] <= k {
        t += a[i];
        i += 1;
    }
    let mut ans = i;
    let mut j = 0;
    while j < m {
        while j < m && t + b[j] <= k {
            t += b[j];
            j += 1;
        }
        ans = std::cmp::max(ans, i + j);
        if i == 0 { break; }
        i -= 1;
        t -= a[i];
    }
    println!("{}", ans);
}

Measured memory_bytes: 7184
public class Main {
  private static void solve() {
    int k = ni();

    if (k == 1)  {
      System.out.println(1);
      System.out.println(1);
      return;
    }
    int n = (k + 3) / 4 * 2;
    
    int[][] ret = new int[n][n];
    for (int i = 0; i < n; i ++) {
      for (int j = 0; j < n; j ++) {
        ret[i][j] = (i % 2 == 0 ? 0 : n) + (i + j) % n;
      }
    }
    
    for (int i = 0; i < n; i ++) {
      for (int j = 0; j < n; j ++) {
        if (ret[i][j] >= k) ret[i][j] = (ret[i][j]  - n) % k;
      }
    }
    
    System.out.println(n);
    for (int i = 0; i < n; i ++) {
      for (int j = 0; j < n; j ++) {
        System.out.print((ret[i][j] + 1) + " ");
      }
      System.out.println();
    }
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 51392
// In the name of God

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);	
	string s1, s2;
	cin >> s1;
	s2 = s1;
	reverse(s2.begin(), s2.end());
	int ans = 0;
	for(int i=0;i<s1.size();i++) if(s1[i] != s2[i]) ans++;
	cout << ans/2;
	return 0;
}


Measured memory_bytes: 256
n,W=map(int,input().split())
w=[]
v=[]
for i in range(n):
    ww,vv=map(int,input().split())
    w.append(ww)
    v.append(vv)
#dp[i][j]:i番目まで選んで、価値がj以上となる最小の重さ
dp=[[10**10]*(sum(v)+1) for i in range(n+1)]
dp[0][0]=0
for i in range(n):
    for j in range(sum(v)+1):
        if j>=v[i]:
            dp[i+1][j]=min(dp[i][j-v[i]]+w[i],dp[i][j])
        else:
            dp[i+1][j]=dp[i][j]
ans=[]
for i in range(sum(v)+1):
    if dp[n][i]<=W:
        ans.append(i)
print(max(ans))

Measured memory_bytes: 119404
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

char s[110][110];
int main(){
	ll h,w;
	scanf("%lld%lld",&h,&w);
	rep(i,0,h)scanf("%s",s[i]);
	
	rep(i,0,w+2)putchar('#');puts("");
	rep(i,0,h){
		putchar('#');
		printf("%s",s[i]);
		putchar('#');
		puts("");
	}
	rep(i,0,w+2)putchar('#');puts("");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
# define ll long long
# define int long long  //comment it out when MLE
//# define endl "\n"
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
# define mo 1000000009
# define pi acos(-1)
# define fi first
# define se second
using namespace std;
vector<int> v[2005];
int dis[2][2005];
bool vis[2005];
void dfs(int x,int fl)
{
    queue<int> qq;
    qq.push(x);
    dis[fl][x]=0;
    int le=0;
    vis[x]=true;
    while(!qq.empty())
    {
       int si=qq.size();
       for(int i=0;i<si;i++)
       {
           int tt=qq.front();
           qq.pop();
           for(auto ii:v[tt])
           {
               if(!vis[ii]){
                vis[ii]=true;
                qq.push(ii);
                dis[fl][ii]=le+1;
               }
           }
       }
       le++;
    }
}
signed main()
{
    gok
    int n,x,y;
    cin>>n>>x>>y;
    for(int i=1;i<n;i++)
    {
        v[i].push_back(i+1);
        v[i+1].push_back(i);
    }
    if(min(x,y)!=max(x,y)-1){
    v[x].push_back(y);
    v[y].push_back(x);
    }
    memset(dis,INT_MAX,sizeof(dis));
    memset(vis,false,sizeof(vis));
    dfs(x,0);
    memset(vis,false,sizeof(vis));
    dfs(y,1);
    map<int,int> mp;
    /*for(int i=0;i<2;i++)
    {
        for(int j=1;j<=n;j++)
        {
            cout<<dis[i][j]<<" ";
        }
        cout<<endl;
    }*/
    for(int i=1;i<n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            int mi = min(dis[0][i]+dis[1][j]+1,dis[1][i]+dis[0][j]+1);
            mi = min(mi,j-i);
            //cout<<mi<<" "<<i<<" "<<j<<endl;
            mp[mi]++;
        }
    }
    for(int i=1;i<n;i++)
    {
        cout<<mp[i]<<endl;
    }









      return 0;
    }


Measured memory_bytes: 512
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

h = [''] * n
c = {'r': 'p', 's': 'r', 'p': 's'}
points = 0

for i, ti in enumerate(t):
    ci = c[ti]
    if i < k or h[i - k] != c[ti]:
        h[i] = ci
        points += eval(ci)
    else:
        # p1, p2 = eval(ci), eval(h[i - k])
        # if p1 > p2:
        #     h[i] = ci
        #     points -= p2
        #     points += p1
        # else:
        h[i] = '*'


print(points)


Measured memory_bytes: 4084
def main():
    N, P = map(int, input().split())
    *s, = map(int, input())

    if P in {2, 5}:
        ans = 0
        for i, x in enumerate(reversed(s), start=0):
            if x % P == 0:
                ans += N - i
        print(ans)
        return

    ans = 0
    total = 0
    coef = 1
    ctr = [0] * P
    ctr[0] = 1
    for x in reversed(s):
        total = (total + x * coef) % P
        coef = coef * 10 % P
        ans += ctr[total]
        ctr[total] += 1
    print(ans)


if __name__ == '__main__':
    main()


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

int main() {
   int a,b,c;
   cin>>a>>b>>c;
   if(a+b+c>=22){
       cout<<"bust";
   }
   else if(a+b>=22 or b+c>=22 or c+a>=22){
       cout<<"bust";
   }
   else{
       cout<<"win"<<endl;
   }
   return 0;
}



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

int main(void){
  while(true){
    int n, r;
    cin >> n >> r;
    if(n == 0 && r == 0){ break; }

    int p, c;
    vector<int> hanafuda(n);
    for(int i = 0; i < n; i++){ hanafuda[i] = n - i; }
    for(int i = 0; i < r; i++){
      cin >> p >> c;
      --p;
      vector<int> tmp;
      for(int j = p; j < p + c; j++){ tmp.push_back(hanafuda[j]); }
      for(int j = p - 1; j >= 0; j--){ hanafuda[j + c] = hanafuda[j]; }
      for(int j = c - 1; j >= 0; j--){ hanafuda[j] = tmp[j];}
    }
    cout << hanafuda[0] << endl;
  }
  return 0;
}

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

int main()
{
    int n, m;
    cin >> n >> m;
    int lh=1,rh=n;
    vector<int> l(m);
    vector<int> r(m);
    for(int i=0;i<m;i++){
        cin>>l.at(i)>>r.at(i);
        lh=max(lh,l.at(i));
        rh=min(rh,r.at(i));
    }
    if(rh-lh<0){
        cout<<0<<endl;
    }
    else{
        cout<<rh-lh+1<<endl;
    }

    
}


Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<assert.h>
#include<string>
#include<cstdlib>
#include<cctype>
#include<unordered_map>
#include<sstream>
#include<numeric>
#include<stack>
// #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 9e18;
constexpr int inf = 1e9;
const double INFD = 1e100;
const ll mod = 1000000007;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};

// intやllをstringに変換
template<typename T> inline string toString(const T &a){
  ostringstream oss;
  oss << a;
  return oss.str();
};
// ----------------------------------------------------------------------------

int main(){
  int N,C;
  cin >> N >> C;
  vector<vector<int>> a(C, vector<int> (1e5+10,0));
  for(int i=0; i<N; i++){
    int s,t,c;
    cin >> s >> t >> c;
    c--;
    a[c][s]++;
    a[c][t+1]--;
  }
  vector<vector<int>> sum(C, vector<int> (1e5+10,0));
  for(int i=0; i<C; i++){
    sum[i][0] = a[i][0];
    for(int j=0; j<1e5+5; j++){
      sum[i][j+1] = sum[i][j]+a[i][j+1];
    }
  }
  int ans = 0;
  for(int i=0; i<1e5+5; i++){
    int cnt = 0;
    for(int j=0; j<C; j++){
      if(sum[j][i]){
        cnt++;
      }
    }
    chmax(ans,cnt);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 24056
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int z = scan.nextInt();
        int w = 0;
        
        w = y;
        y = x;
        x = w;
        
        w = z;
        z = x;
        x = w;
        
		System.out.println(x+" "+y+" "+z);
	    scan.close();	

    }
}

Measured memory_bytes: 23124
N, Q = gets.split.map!(&:to_i)

relation = Array.new(N+1).map!{[]}
(N-1).times do
    a,b = gets.split.map!(&:to_i)
    relation[a] << b
    relation[b] << a
end

ans = Array.new(N+1,0)
Q.times do
    q,x = gets.split.map!(&:to_i)
    ans[q] += x
end

queue = [1]
visit = Array.new(N+1,false)
    
until queue.empty? do
    current = queue.shift
    visit[current] = true

    relation[current].each do |next_node|
        unless visit[next_node] then 
            queue << next_node
            ans[next_node] += ans[current]
        end
    end
end

puts ans[1..N].join(' ')

Measured memory_bytes: 27388
// In God We Trust


# include <bits/stdc++.h>
using namespace std;

# define INF 1 << 31 - 1
# define pb push_back
# define fi first
# define se second

signed main(){
  int n;
  cin >> n;
  int x = (int)ceil(n / 1.08);
  if ((int)floor(x * 1.08) == n)
    cout << x;
  else
    cout << ":(";
    
    
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        
        String s = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51";
        String[] ss = s.split(",",0);
        
        System.out.println(ss[a-1]);
    }
}


Measured memory_bytes: 23764
#include<bits/stdc++.h>
#define endl '\n'
#define PI 3.14159265358979323844
#define DECIMAL(n)  std::cout << std::fixed;std::cout << std::setprecision(n);
#define mp make_pair
#define pb push_back
#define int long long int 
#define forr(i,a,b) for (int i= a; i <b; ++i)
    using namespace std; 
    
    
    signed main(){
   int r,c; cin>>r>>c;
   char arr[r][c];
   forr(i,0,r)forr(j,0,c)cin>>arr[i][j];
   
   int dp[r][c];
   memset(dp,0,sizeof dp);
   forr(i,0,c){
        if(arr[0][i]=='.'){
        dp[0][i]=1;}
        else break;
   }
      forr(i,0,r){
        if(arr[i][0]=='.'){
        dp[i][0]=1;}
        else break;
   }           
   
   forr(i,1,r){
       forr(j,1,c){
           if(arr[i][j]=='.'){
               
               dp[i][j]=(dp[i-1][j]%1000000007+dp[i][j-1]%1000000007)%1000000007;}
            
   }}
    cout<<dp[r-1][c-1];}
   
                
          

Measured memory_bytes: 9088
#include<bits/stdc++.h>
#include<map>
using namespace std;
int N;
vector<int>p_a;
vector<int>p_b;
int r_a(int v) {
  if (p_a[v] == v) return v;
  return p_a[v] = r_a(p_a[v]);
}
int r_b(int v) {
  if (p_b[v] == v) return v;
  return p_b[v] = r_b(p_b[v]);
}
void u_a(int a, int b) {
  a = r_a(a);
  b = r_a(b);
  if (a == b) return;
  p_a[b] = a;
}
void u_b(int a, int b) {
  a = r_b(a);
  b = r_b(b);
  if (a == b) return;
  p_b[b] = a;
}
int main () {
  cin >> N;
  int K, L;
  cin >> K >> L;
  p_a.resize(N);
  p_b.resize(N);
  for (int i = 0; i < N; i ++)p_a[i] = i;
  for (int i = 0; i < N; i ++) p_b[i] = i;
  for (int i = 0; i < K; i ++) {
    int p, q;
    cin >> p >> q;
    p --;
    q --;
    u_a(p, q);
  }
  for (int i = 0; i < L; i ++) {
    int r, s;
    cin >> r >> s;
    r --;
    s --;
    u_b(r, s);
  }
  map<long long, int>ans;
  vector<long long>key(N);
  for (int i = 0; i < N; i ++) {
    key[i] = (long long)r_a(i) * N + r_b(i);
    ans[key[i]] ++;
  }
  for (int i = 0; i < N; i ++) cout << ans[key[i]] << endl;
}



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

int main() {
	long long N, ANS = 0;
	cin >> N;
	vector<long long> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];
	sort(A.begin(), A.end());
	long long COUNT = 0;
	COUNT += A[0];
	for (int i = 1; i < N; i++) {
		if (COUNT * 2 >= A[i]) ANS++;
		else ANS = 0;
		COUNT += A[i];
	}
	ANS++;
	cout << ANS << endl;
}

Measured memory_bytes: 1024
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
left=0
right=(10**5)*2+5
s=ruiseki(a)

ans=0
while 1:
    mid=(left+right)//2
    cnt=0
    for i in range(n):
        tmp=bisect.bisect_left(a,mid-a[i])
        cnt+=n-tmp
    
    if cnt<m:
        right=mid
    else:
        left=mid
    
    # print(left,right,mid)
    if right-left<=1:
        break
for i in range(n):
    tmp=bisect.bisect(a,left-a[i])
    cnt=n-tmp
    ans+=cnt*a[i]+s[n]-s[tmp]
    m-=cnt
ans+=m*left
print(ans)

Measured memory_bytes: 84640
#include<stdio.h>

int main(){
	int a,b;
	int result=0;
	char op;
	while(1){
		
		scanf("%d %c %d",&a,&op,&b);
		
		if(op=='+'){
			result=a+b;
		}else if(op =='-'){
			result=a-b;
		}else if(op=='/'){
			result=a/b;
		}else if(op=='*'){
			result=a*b;
		}
		else if(op=='?') break;
		printf("%d\n",result);
	}
	//printf("%c", op);
	return 0;
	
}


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

class Main {
	public static void main (String[] args) {
		Scanner scanner = new Scanner(System.in);
	
		int numA = scanner.nextInt();
		int numB = scanner.nextInt();
		int numC = scanner.nextInt();
		
		
		if (0 <= numA && numA <= 9 && 0 <= numB && numB <= 9 && 0 <= numC && numC <= 9) {
			int[] intArray = {numA, numB, numC};
			Arrays.sort(intArray);
			//System.out.println(Arrays.toString(intArray));
			
			int sum = intArray[2] * 10 + intArray[1] + intArray[0];
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 21204
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ld long double
#define dd double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
typedef long long ll;
typedef unsigned long long ull;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;
typedef vector<pll> vplll;
ll mod = 1e9+7;
const ld PI = 2 * acos(0.0);
const vector<ll> dx = {1, -1, 0, 0};
const vector<ll> dy = {0, 0, 1, -1};
#define round(x, y) ((x + y - 1) / y)
#define ce(x, y) ((x + y - 1) / y)
#define amax(x, y) \
    if (y > x)     \
        x = y;
#define amin(x, y) \
    if (y < x)     \
        x = y;
#define lcm(x, y) ((x) * (y) / __gcd(x, y))
#define len(x) (ll) x.length()
#define sq(x) ((x) * (x))
#define cb(x) ((x) * (x) * (x))
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,b,c,t,n,m,k,q; 
    t = 1;
    // cin>>t;
    while(t--)
    {
    	cin>>a;
    	ld ans = 2 * PI * a ;
    	printf("%6Lf \n",ans);
    }
    return 0;
}	

Measured memory_bytes: 3808
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<double> Complex;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (int i = 0; i < sz(v); i++) {
        os << v[i];
        if (i < sz(v) - 1) os << " ";
    }
    return os;
}
int main() {
    ll n;
    cin >> n;
    ll ans = 0;
    for (ll i = 1; i <= n; i++) {
        ll j = n / i;
        ans += (1 + j) * j / 2 * i;
    }
    cout << ans << endl;
}

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

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

  vector<int> vec(M);
  int ans = 0;

  for (int i = 0; i < N; i++) {
    int K;
    cin >> K;
    for (int i = 0; i < K; i++) {
      int A;
      cin >> A;
      vec.at(A - 1)++;
      if (vec.at(A - 1) == N) ans++;
    }
  }

  cout << ans << "\n";
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {

    public static void main(String[] args) {

        String str;
        int sum = 0;

        Scanner scanner = new Scanner(System.in);
        str = scanner.next();

        char c1 = str.charAt(0);
        char c2 = str.charAt(1);
        char c3 = str.charAt(2);

        if(c1 == '1') {
            sum++;
        } 

        if(c2 == '1') {
            sum++;
        } 

        if(c3 == '1') {
            sum++;
        } 


        
        System.out.println(sum);

        scanner.close() ;
    }
}


Measured memory_bytes: 21844
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
s = input().strip()
a = [False]*10
b = [ [False]*10 for i in range(10) ]
c = [ [ [0]*10 for i in range(10) ] for j in range(10)]
for i in range(n):
    m = int(s[i])
    for j in range(10):
        for k in range(10):
            if b[j][k]:
                c[j][k][m] = 1
        if a[j]:
            b[j][m] = True
    a[m] = True

x = 0
for i in range(10):
    for j in range(10):
        for k in range(10):
            x += c[i][j][k]
print(x)


Measured memory_bytes: 43500
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define len(X) (X).size()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>

set<int> p[200001];

int main() {
    ll n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        p[a[i]].insert(i);
    }
    for (int i = 0; i <= 200000; i++) {
        p[i].insert(n);
    }

    ll cyc = 0, ed = -1;
    while (ed != n - 1) {
        int m = *p[a[ed + 1]].upper_bound(ed + 1);
        if (m == n) {
            m = *p[a[ed + 1]].lower_bound(0);
            cyc++;
        }
        ed = m;
        //cerr << cyc _ ed _ a[ed] << endl;
    }
    cyc++;
    k %= cyc;
    cerr << cyc _ k << endl;
    if (!k) {
        cout << endl;
        return 0;
    }

    ed = -1;
    while (k) {
        int m = *p[a[ed + 1]].upper_bound(ed + 1);
        if (m == n) {
            m = *p[a[ed + 1]].lower_bound(0);
            k--;
        }
        if (!k) break;
        ed = m;
    }
    ed++;

    cerr << ed << endl;

    vector<int> nx(200001, -1);
    for (int i = ed; i < n; i++) {
        int m = *p[a[i]].upper_bound(i);
        if (m != n) nx[i] = m;
    }
    //for (int i = 0; i < n; i++) cerr << nx[i] << " ";
    //cerr << endl;
    int idx = ed;
    bool cnt = 0;
    while (idx < n) {
        if (nx[idx] != -1) idx = nx[idx];
        else {
            if (cnt) cout << " ";
            cout << a[idx];
            cnt++;
        }
        idx++;

    }
    if (cnt) cout << endl;

}


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

#define ll long long int
#define f(i,x,n)  for(int i=x;i<n;i++)
#define FASTIO cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define sz(a) int((a).size())
#define mod 1000000007
#define inf LLONG_MAX
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
template <typename T>
inline T gcd(T a, T b)
{
    while (b != 0) swap(b, a %= b);
    return a;
}

template <typename T>
inline void seethis(vector<T>vect)
{
    for(T x : vect)
        cout << x << " ";
    cout << "\n";
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}
//LCM
int lcm(int a, int b)
{
    return a * (b / gcd(a, b));
}

//For sort by second
bool cmp(const pair<int, int> &a)
{
    return a.first < a.second;
}

//Tree
/* const int MAXN = 1e5 + 5;
vector<ll> adj[MAXN];*/

//ModPower
ll modpower(ll a, ll b, ll c)
{
    ll res = 1;
    while(b)
    {
        if(b & 1LL)
            res = (res * a) % c;
        a = (a * a) % c;
        b >>= 1;
    }
    return res;
}

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

    vector<int>swim(n+1);
    vector<int>bug(n+1);
    vector<int>hw(n+1);

    for(int i=1;i<=n;i++)
    {
      cin>>swim[i]>>bug[i]>>hw[i];
    }


    
    vector<vector<int> > dp(n+1,vector<int>(4,0));

    for(int i=1;i<=n;i++)
    {
      //If i perform swimming on ith day
      dp[i][1]=swim[i] + max(dp[i-1][2],dp[i-1][3]);

      //I catch a bug
      dp[i][2]=bug[i] + max(dp[i-1][1],dp[i-1][3]);

      //I do HW
      dp[i][3]= hw[i]  + max(dp[i-1][2],dp[i-1][1]);

    }

    cout<<max(max(dp[n][1],dp[n][2]),dp[n][3])<<"\n";


    return 0;
}

Measured memory_bytes: 9776
#include <iostream>
#include <vector>
 
using namespace std;
 
class UnionFind {
public:
  UnionFind(long long n);
  long long size(long long n);
  bool merge(long long a, long long b);
  long long root(long long a);
  bool isSame(long long a, long long b);
 
private:
  long long N;
  vector<long long> parentArr;
  vector<long long> sizeArr;
  vector<long long> rankArr;
};
 
UnionFind::UnionFind(long long n) {
  N = n;
  parentArr.resize(n);
  sizeArr.resize(n);
  rankArr.resize(n);
 
  for (long long i = 0; i < n; i++) {
    parentArr[i] = i;
    sizeArr[i] = 1;
    rankArr[i] = 0;
  }
}
 
long long UnionFind::size(long long a) { return sizeArr[root(a)]; }
 
bool UnionFind::merge(long long a, long long b) {
  long long root_a = root(a);
  long long root_b = root(b);
 
  if (root_a == root_b) {
    return false;
  }
 
  if (rankArr[root_a] < rankArr[root_b]) {
    parentArr[root_a] = root_b;
    sizeArr[root_b] += sizeArr[root_a];
  } else {
    parentArr[root_b] = root_a;
    sizeArr[root_a] += sizeArr[root_b];
    if (rankArr[root_a] == rankArr[root_b]) {
      rankArr[root_a]++;
    }
  }
  return true;
}
 
long long UnionFind::root(long long a) {
  long long tmp = a;
  while (tmp != parentArr[tmp]) {
    tmp = parentArr[tmp];
  }
  return parentArr[a] = tmp;
}
 
bool UnionFind::isSame(long long a, long long b) { return root(a) == root(b); }
 
int main(int argc, char const *argv[]) {
  long long N, M;
  cin >> N >> M;
 
  UnionFind uf(N + 1);
 
  vector<pair<long long, long long>> bridge(M + 1);
  vector<long> ans(M + 1);
  ans[M] = N * (N - 1) / 2;
 
  for (long long i = 1; i < M + 1; i++) {
    cin >> bridge[i].first >> bridge[i].second;
  }
 
  for (long long i = M - 1; i >= 1; i--) {
    long long a = bridge[i + 1].first;
    long long b = bridge[i + 1].second;
 
    if (uf.isSame(a, b)) {
      ans[i] = ans[i + 1];
    } else {
      ans[i] = ans[i + 1] - uf.size(a) * uf.size(b);
      uf.merge(a, b);
    }
  }
 
  for (long long i = 1; i < M + 1; i++) {
    cout << ans[i] << "\n";
  }
  return 0;
}

Measured memory_bytes: 6016
package main

import (
	"fmt"
	//"sort"
)

func main(){
	var N, K int
	var a[1000000] int
	var b[1000000] int
	fmt.Scan(&N, &K)
	c := make([]int64, 100000+1)

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

	for i := 0 ; i < N ; i++{
		c[a[i]] += int64(b[i])
	}

	for i := 1 ; i <= 100000 ; i++ {
		if int64(K) <= c[i] {
			fmt.Println(i)
			break
		}
		K -= int(c[i])
	}
}

Measured memory_bytes: 14592
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s,t;
  cin>>s>>t;
  int m,n,i,j,k;
  m=s.length();
  n=t.length();
  if(m<n){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }
  for(i=0;i<=m-n;i++){
    for(j=0;j<n;j++){
      if(s.at(m-n-i+j)!='?'&&s.at(m-n-i+j)!=t.at(j)) break;
    }
    if(j==n){
      for(k=0;k<m-n-i;k++){
        if(s.at(k)=='?') cout<<'a';
        else cout<<s.at(k);
      }
      cout<<t;
      for(k=0;k<i;k++){
        if(s.at(m-i+k)=='?') cout<<'a';
        else cout<<s.at(m-i+k);
      }
      cout<<endl;
      return 0;
    }
  }
  cout<<"UNRESTORABLE"<<endl;
}

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

#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORq(i, m, n) for(int i = (m); i < (n); i++)
#define FORr(i, n) for (int i = (n); i >= 0; i++)

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

	vector<int> K(N);
	vector<vector<int>> A(N, vector<int>(M));
	FOR(i, N) {
		cin >> K[i];
		FOR(j, K[i]) {
			cin >> A[i][j];
		}
	}
	if (N == 1) {
		cout << K[0] << endl;
		return 0;
	}
	
	//sort(A[0].begin(), A[0].end());
	int count = 0;
	int answer = 0;
	for (int k = 0; k < K[0]; k++) {
		for (int i = 1; i < N; i++) {
			for (int j = 0; j < K[i]; j++) {
				if (A[i][j] == A[0][k]) {
					count++;
					
				}
			}
		}
		if (count == N - 1) {
			answer++;
		}
		
		count = 0;
	}
	cout << answer << endl;


}

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

int main() {
  string s;
  cin>>s;
  if (s[0]!=s[1] && s[1]!=s[2] && s[2]!=s[0]) {
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }

}


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


/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define sec second
#define fir first
#define pb push_back



/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
//const int inf = pow(2, 62);
//const int mod = 1e9 + 7;
const int mod = 100000;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};



/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}


/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }




/* main */



signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    
    vi arr; rep(i,0,3) arr.push_back(input());

    sort(all(arr));

    if(arr[0] + arr[1] == arr[2]){
        print("Yes");
    }else{
        print("No");
    }


    
    



    
    

    







   




    

    

    




    



    



    

 
    
    


    

    
   
    













}






    










    




    










Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__
const ll MOD = 1000000007;
const int MAX = 200000;

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

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    int N,M; cin >> N >> M;
    vector<vector<int> > A(N);
    for(int i=0;i<M;i++){
        int a,b;
        cin >> a >> b;
        a--;b--;
        A[a].push_back(b);
        A[b].push_back(a);
    }
    vector<int> dist(N,-1);
    queue<int> q;
    vector<int> out(N,INF);
    dist[0] = 0;
    out[0] = 0;
    q.push(0);
    while(!q.empty()){
        int v = q.front(); q.pop();
        for(int nv:A[v]){
            if(dist[nv] != -1) continue;
            dist[nv] = dist[v]+1;
            out[nv] = v;
            q.push(nv);
        }
    }
    bool f=true;
    for(int i=0;i<N;i++){
        if(out[i]==INF){
            cout << "No" << endl;            
            return 0;
        }
    }
    cout << "Yes" << endl;
    for(int i=1;i<N;i++){
        cout << out[i]+1 << endl;
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;
const lb PI=3.14159265359;

int main(){

  ll n,m;cin>>n>>m;
  // ll a[m],b[m];
  vector<vector<ll>>v(n);
  rep(i,0,m){
    ll a,b;cin>>a>>b;
    --a,--b;
    v[a].push_back(b);
    v[b].push_back(a);
    // cin>>a[i]>>b[i];
  }

  ll per[n];rep(i,0,n)per[i]=i;

  ll ans=0;
  do{
    if(per[0]!=0)continue;
    bool e=true;
    rep(i,0,n-1){
      if(find(v[per[i]].begin(),v[per[i]].end(),per[i+1])==v[per[i]].end())e=false;

    }
    if(e)ans++;

  }while(next_permutation(per,per+n));

  out(ans);

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int x, n = 0, a, b, c;
	
	scanf("%d%d%d", &a, &b, &c);
	for(x = a; x <= b; x++){
		if((c % x) == 0) n++;
	}
	printf("%d\n", n);
	
	return(0);
}



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

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long K, std::vector<long long> A) {
    for (long long i = 0; i < N - K; i++) {
        cout << (A[i] < A[i + K] ? "Yes" : "No") << endl;
    }
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main() {
    long long N;
    scanf("%lld", &N);
    long long K;
    scanf("%lld", &K);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        scanf("%lld", &A[i]);
    }
    solve(N, K, std::move(A));
    return 0;
}


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

int main(){
    double a,b;
    cin>>a>>b;
    double c = abs(a-b) / 2;

    if(ceil(c) == floor(c))
    {
        cout<<(int)(c+min(a,b));
    }
    else{
        cout<<"IMPOSSIBLE";
    }
    
}

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

int main() {
  int d,t,s;
  cin >> d >> t >> s;
  string ans = "No";
  if(s*t >= d) ans = "Yes";
  cout << ans << endl;
}

Measured memory_bytes: 3592
N, M, X = map(int, input().split())
L = [0 for x in range(N+1)]
gate = list(map(int, input().split()))
p = X
c = 0
min_c = 2e9

for x in gate:
    L[x] = 1

while p != N:
    if L[p] == 1:
        c += 1

    p += 1

min_c = min(min_c, c)

p = X
c = 0

while p != 0:
    if L[p] == 1:
        c += 1

    p -= 1

min_c = min(min_c, c)

print(min_c)


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

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

template<class T> inline bool chmin(T& a, T b){
    if(a > b){
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b){
    if(a < b){
        a = b;
        return true;
    }
    return false;
}
vector<bool> seen;
void dfs(const Graph &G, int v){
    seen[v] = true; // vを訪問済みにする
    
    for(auto next_v: G[v]){
        if(seen[next_v]) continue; // next_vが探索済みならスルー
        dfs(G, next_v); // 再帰的に探索
    }
}

int main(){

    int n, m;
    cin >> n >> m;
    int cnt1, cnt2;
    if(n > 0){
        cnt1 = n*(n-1)/2;
    }
    else{
        cnt1 = 0;
    }
    if(m > 0){
        cnt2 = m*(m-1)/2;
    }
    else{
        cnt2 = 0;
    }
    cout << cnt1 + cnt2 << endl;
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

r, D, x_2000 = MAP()
tmp = x_2000
for i in range(10):
	tmp = r*tmp - D
	print(tmp)


Measured memory_bytes: 3896
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 100010;

int main(){
    int q;
    cin >> q;
    vector<int> l(q), r(q);
    for(int i = 0; i < q; i++) cin >> l[i] >> r[i];

    vector<bool> is_prime(MAX, true);
    is_prime[0] = false;
    is_prime[1] = false;
    for(int i = 2; i*i < MAX; i++){
        if(is_prime[i]){
            for(int j = 2; i*j < MAX; j++) is_prime[i*j] = false;
        }
    }

    vector<int> memo(MAX, 0);
    for(int i = 1; i < MAX; i++){
        memo[i] = memo[i-1];
        if(i % 2){
            if(is_prime[i] && is_prime[(i+1)/2]){
                memo[i]++;
            }
        }
    }

    for(int i = 0; i < q; i++){
        cout << memo[r[i]]-memo[l[i]-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1792
#coding: utf-8
N = int(input())
L = list(map(int, input().split()))

cnt = 0
tri_cnt = 0
mem = 0

#全てが奇数になるまで実行し続ける
while(mem != len(L)):
    if(L[mem]%2 != 0):
        mem += 1
    else:
        L[mem] //= 2
        # for i in range(len(L)):
        #     if(i != mem):
        #         L[i] = L[i] * 3
        #         print('',end='')
        cnt += 1

    # tri_cnt = 0
    # for i in range(len(L)):
    #     if (L[i] % 2 != 0):
    #         tri_cnt += 1
else:
    print(cnt)

Measured memory_bytes: 4148
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
string a, b, c;

int solve() {
    int res = 0;
    for (int i = 0; i < n; i++) {
        if ((a[i] == b[i] && b[i] != c[i]) ||
            (a[i] != b[i] && b[i] == c[i]) ||
            (a[i] == c[i] && a[i] != b[i])) {
            res++;
        } else if (a[i] != b[i] && b[i] != c[i] && c[i] != a[i]) {
            res += 2;
        }
    }
    return res;
}

void input() {
    cin >> n;
    cin >> a >> b >> c;
}

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

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int n, i, j;
	int y1, m1, d1, y2, m2, d2;
	int y, m, d;
	int count;
	int result[100] = {0};

	i = 0;
	while (scanf("%d %d %d %d %d %d", &y1, &m1, &d1, &y2, &m2, &d2) != 0)
	{
		if (y1 < 0 || m1 < 0 || d1 < 0 || y2 < 0 || m2 < 0 || d2 < 0)
			break;

		count = 0;
		for (y = y1, m = m1, d = d1; y != y2 || m != m2 || d != d2; )
		{
			d++;

			if (d == 32 && (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12))
			{
				d = 1;
				m++;
			}
			else if (d == 31 && (m == 4 || m == 6 || m == 9 || m == 11))
			{
				d = 1;
				m++;
			}
			else if (m == 2)
			{
				if ((y % 4 == 0 && y % 100 != 0) || (y % 4 == 0 && y % 400 == 0))
				{
					if (d == 30)
					{
						d = 1;
						m++;
					}
				}
				else
				{
					if (d == 29)
					{
						d = 1;
						m++;
					}
				}
			}

			if (m == 13)
			{
				y++;
				m = 1;
			}

			count++;
		}

		result[i] = count;

		i++;
	}

	if (i != 0)
	{
		for (j = 0; j < i; j++)
			printf("%d\n", result[j]);
	}

	return 0;
}

Measured memory_bytes: 596
#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 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)1e9;
const ll  inf = (ll)1e18;
const int mod = 1000000007;
const int MAX_N = 100010;



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

	int n;
	cin >> n;
	
	map<int, int> mp;
	int ma = 0;
	rep(i, n) {
		int a;
		cin >> a;
		mp[a]++;
		chmax(ma, a + 1);
	}
	int ans = 0;
	rep(i, ma + 3) {
		chmax(ans, mp[i] + mp[i + 1] + mp[i + 2]);
	}
	out(ans);

	return 0;
}

Measured memory_bytes: 4992
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int t = sc.nextInt();
            int h = sc.nextInt();
            int s = sc.nextInt();
            if (t == -1 && h == -1 && s == -1) {
                break;
            }
            int time=7200-(t*3600+h*60+s);
            int tt=time/3600;
            time-=tt*3600;
            int hh=time/60;
            time-=hh*60;
            int ss=time;
            System.out.println("0"+tt+":"+(hh/10==0?"0"+hh:hh)+":"+(ss/10==0?"0"+ss:ss));
            time=(7200-(t*3600+h*60+s))*3;
            tt=time/3600;
            time-=tt*3600;
            hh=time/60;
            time-=hh*60;
            ss=time;
            System.out.println("0"+tt+":"+(hh/10==0?"0"+hh:hh)+":"+(ss/10==0?"0"+ss:ss));       
        }
    }
}


Measured memory_bytes: 26256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();
		int N = S.length;

		long[][] dp = new long[N+1][13];
		long MOD = 1000000007;
		
		int rem = 1;
		dp[0][0] = 1;
		for(int i=0; i<N; i++) {
			if(i>0)
				rem = (rem*10)%13;
			for(int j=0; j<13; j++) {
				if(S[N-i-1]=='?') {
					for(int k=0; k<10; k++) {
						int l = (j+rem*k)%13;
						dp[i+1][l] = (dp[i+1][l] + dp[i][j]) % MOD;
					}
				} else {
					int l = (j+rem*(S[N-i-1]-'0'))%13;
					dp[i+1][l] = (dp[i+1][l] + dp[i][j]) % MOD;
				}
			}
		}
		
		System.out.println(dp[N][5]);
		
		sc.close();
	}
}

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

using namespace std;

int main(void) {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int a, b; cin >> a >> b;
    if (a % b == 0) cout << -1 << endl;
    else cout << a << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define N 100010
#define ll long long
int main()
{
    ll k,a,b,sum=0;
    scanf("%lld%lld%lld",&k,&a,&b);
    if(k<=a || b-a<=2)
        cout<<k+1;
    else
    {
        sum+=a;
        k-=(a-1);

        ll kk=k/2;
        sum+=kk*(b-a);
        if(k&1)sum++;
        printf("%lld\n",sum);
    }
    return 0;
}



Measured memory_bytes: 256