akhauriyash/Code-Regression huggingface dataset:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class CReplacingInteger {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            long k = in.nextLong();
            n = n % k;
            while (Math.abs(n - k) <= n) {
                n = Math.abs(n - k);
            }
            out.println(n);

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

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

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}



Measured memory_bytes: 23380
n = int(input())
a = list(map(int,input().split()))
q = int(input())
bc = [list(map(int,input().split())) for i in range(q)]
list = [0]*(10**5)
for i in range(n) :
    list[a[i]-1] += 1

wa = sum(a)

for i in range(q) :
    wa += (bc[i][1]-bc[i][0])*list[bc[i][0]-1]
    print(wa)
    list[bc[i][1]-1] += list[bc[i][0]-1]
    list[bc[i][0]-1] = 0


Measured memory_bytes: 31996
N,M = [int(i) for i in input().split()]
d = {}
for i in range(M):
    s,c = [int(i) for i in input().split()]
    if d.get(s,c) != c:
        print(-1)
        break
    else:
        d[s] = c
else:
    if N==1:
        print(d.get(1,0))
    elif d.get(1,1) == 0:
        print(-1)
    else:
        l = [str(d.get(1,1))]
        l+=[str(d.get(i,0)) for i in range(2, N+1)]
        print(''.join(l))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

ll ans[10];
int main() {
	ll h,w,n;
	cin>>h>>w>>n;
	h--;w--;
	map<pair<ll,ll>,ll>a;
	for(ll i=0;i<n;i++){
		ll x,y;
		cin>>x>>y;
		x--;y--;
		for(ll j=-2;j<=0;j++){
			for(ll k=-2;k<=0;k++){
				ll nowx=x+j;
				ll nowy=y+k;
				if(nowx<0||nowx>h-2||nowy<0||nowy>w-2){
					continue;
				}
				a[make_pair(nowx,nowy)]++;
			}
		}
	}
	for(auto itr=a.begin();itr!=a.end();itr++){
		ll val=itr->second;
		ans[val]++;
	}
	ll sum=0;
	for(ll i=0;i<10;i++){
		sum+=ans[i];
	}
	ans[0]=(h-1)*(w-1)-sum;
	for(ll i=0;i<10;i++){
		cout << ans[i]<<endl;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 56448
a = gets.chomp.split(" ").map(&:to_i)
tmp = a[0..2]
if a[3] % 2 != 0
#for i in 0..a[3]
  next_1 = tmp[1] + tmp[2]
  next_2 = tmp[0] + tmp[2]
  next_3 = tmp[0] + tmp[1]
  tmp[0] = next_1
  tmp[1] = next_2
  tmp[2] = next_3
#end
end
puts (tmp[0] - tmp[1] > 10**18) ? "Unfair" : tmp[0] - tmp[1]

Measured memory_bytes: 3836
#include<iostream>
#include<vector>
#define ll long long
#define mp make_pair
using namespace std;
vector<int>v[200005];
int n,q,val[200005];
vector<int>sons[200005];
inline void dfs(int x,int par){
	for(int i=0;i<v[x].size();++i){
        int it=v[x][i];
		if(it!=par){
			sons[x].push_back(it);
			dfs(it,x);
		}
	}
}
inline void gt(int x,int y){val[x]+=y;}
inline void push(int x,int ad){
	val[x]+=ad;
	for(int i=0;i<sons[x].size();++i)push(sons[x][i],val[x]);
}
int main(){ios_base::sync_with_stdio(false);
	cin>>n>>q;
	for(int i=1;i<n;++i){
		int x,y;
		cin>>x>>y;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	dfs(1,0);
	for(;q--;){
		int x,y;
		cin>>x>>y;
		gt(x,y);
	}
	push(1,0);
	for(int i=1;i<=n;++i)cout<<val[i]<<' ';
	cout<<endl;
}


Measured memory_bytes: 43776
Option Strict On

Module Module1
    Sub Main()
        'let'
        Dim tmp() As Long =
            Array.ConvertAll(Of String, Long)(
                Split(Console.ReadLine()), AddressOf Long.Parse)
        Dim N As Long = tmp(0)
        Dim Y As Long = tmp(1)

        'var'
        Dim ans() As Long = New Long() {-1, -1, -1}
        Dim flg As Boolean

        For i As Long = 0 To N
            For j As Long = 0 To N - i
                Dim k As Long = N - i - j
                If 10 * i + 5 * j + k = Y \ CLng(10 ^ 3) Then
                    ans(0) = i
                    ans(1) = j
                    ans(2) = k
                    flg = True
                    Exit For
                End If
            Next
            If flg Then Exit For
        Next

        Console.WriteLine(
            Join(Array.ConvertAll(Of Long, String)(ans, AddressOf IntToStr)))

    End Sub

    Function IntToStr(ByVal i As Long) As String
        Return i.ToString()
    End Function

End Module


Measured memory_bytes: 13536
from collections import deque
from heapq import heappop, heappush
def inpl(): return list(map(int, input().split()))

INF = 50000

N, M = inpl()
while N:
    s, g = inpl()
    G = [[] for _ in range(N+1)]
    for _ in range(M):
        a, b, d, c = inpl()
        G[a].append([b, c, d])
        G[b].append([a, c, d])
    DP =  [[[INF]*(N+1) for _ in range(31)] for _ in range(N+1)]
    DP[s][0][0] = 0
    Q = [[0, 0, s, 0]]  # time, speed, where, pre
    while Q:
        t, v, p, bp = heappop(Q)
        if DP[p][v][bp] < t:
            continue
        for q, c, d in G[p]:
            if q == bp:
                continue

            for dv in range(-1, 2):
                nv = v+dv
                if not (0 < nv <= c):
                    continue
                nt = t + d/(nv)
                if DP[q][nv][p] > nt:
                    DP[q][nv][p] = nt
                    heappush(Q, [nt, nv, q, p])

    ans = min(DP[g][1])
    if ans == INF:
        print("unreachable")
    else:
        print(ans)
    N, M = inpl()



Measured memory_bytes: 7728
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int N, W[100], S1, S2,i,j,min=100;
	scanf("%d", &N);
	for (i = 0; i < N; i++) {
		scanf("%d", &W[i]);
	}
	j = N-1;
	S1 = 0;
	for (i = 0; i <= j; i++) {
		S2 = 0;
		S1 = S1 + W[i];
		for (j = N - 1; j >= i; j--) {
			S2 = S2 + W[j] ;
			if (i + (N-j+1) == N) {
				if (abs(S2 - S1) < min) {
					min = abs(S2 - S1);
				}
			}
		}
		j = N - 1;
	}
	printf("%d", min);
    return 0;
}



Measured memory_bytes: 128
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val k, n = sc.nextInt()
  val as = List.fill(n)(sc.nextInt())
  val diff = (as.tail :+ as.head + k).zip(as).map { case (a, b) => a - b }
  println(k - diff.max)
}


Measured memory_bytes: 79580
#include<stdio.h>
#define N 100
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n, M[N][N];
int color[N], d[N], f[N], tt;


void dfs_visit(int u) {
  int v;
  color[u] = GRAY;
  d[u] = ++tt;
  for ( v = 0; v < n; v++ ) {
    if ( M[u][v] == 0 ) continue;
    if ( color[v] == WHITE ) {
      dfs_visit(v);
    }
  }
  color[u] = BLACK;
  f[u] = ++tt;
}

void dfs() {
  int u;

  for ( u = 0; u < n; u++ ) color[u] = WHITE;
  tt = 0;
  
  for ( u = 0; u < n; u++ ) {

    if ( color[u] == WHITE ) dfs_visit(u);
  }
  for ( u = 0; u < n; u++ ) {
    printf("%d %d %d\n", u + 1, d[u], f[u]);
  }
}


int main() {
  int u, v, k, i, j;

  scanf("%d", &n);
  for ( i = 0; i < n; i++) {
    for ( j = 0; j < n; j++ ) M[i][j] = 0;
    }

for ( i = 0; i < n; i++) {
  scanf("%d %d", &u, &k);
  u--;
  for ( j = 0; j < k; j++ ) {
    scanf("%d", &v);
    v--;
    M[u][v] = 1;
  }
 }

 dfs();

 return 0;
}



Measured memory_bytes: 2052
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	long int i,a=0,b=0,n;
	n=s.size();

		for(i=0;i<n;i++)
		{
			
			if(s[i]=='W')
			{
				b++;
				a=a+(i+1-b);
				
			}
		}
		cout<<a<<endl;
	

}

Measured memory_bytes: 3684
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

ll gcd(ll a, ll b){
    while(b){
        a %= b;
        swap(a, b);
    }
    return a;
}

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

    ll maxv = d;
    for (int i = 1; i < n; ++i) {
        ll x;
        cin >> x;
        maxv = max(maxv, x);
        d = gcd(d, x);
    }

    if (k <= maxv && k % d == 0) cout << "POSSIBLE" << endl;
    else cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const int INF=1000000001;
const double PI=3.141592653589;
const ll LMAX=1000000000000001;
ll gcd(ll a,ll b){if(a<b)swap(a,b);while((a%b)!=0){a=b;b=a%b;}return b;}
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};

int keta(ll a){
  int k=0;
  while(a/10!=0){
    a/=10;k++;
  }
  k++;
  return k;
}

int main(){
  ll n; cin>>n;
  int ans=INF;
  for(ll i=1;i*i<=n;i++){
    if(n%i!=0) continue;
    ans=min(ans,max(keta(i),keta(n/i)));
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {



        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] s = new int[M];
        int[] P = new int[M];

        for(int i=0;i<M;i++){
            int k = sc.nextInt();
            for(int j=0;j<k;j++){
                int num = sc.nextInt();
                s[i] += (int)Math.pow(2,num-1);
            }
        }
        for(int i=0;i<M;i++) {
            P[i] = sc.nextInt();
        }

        int ans = 0;

        for(int i=0;i<Math.pow(2,N);i++){

            //System.out.println("i"+i);

            boolean isOK =true;

            for(int j=0;j<M;j++){
                int modCount = 0;
                int a = i;
                int b = s[j];

                for(int k=N;k > 0;k--){
                    int modNum = (int)Math.pow(2,k-1);
                    if((a / modNum == 1) && (b / modNum == 1)){
                        //System.out.println("same");
                        modCount++;
                    } else {
                        //System.out.println("NG");
                    }
                    a = a % modNum;
                    b = b % modNum;
                }

                if(modCount % 2 != P[j]){
                    isOK = false;
                    break;
                }
            }

            if(isOK){
                ans++;
            }

        }
        System.out.println(ans);
    }



}


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

int bubbleSort(int A[], int N){
	int sw= 0;
	bool flag = 1;
	for( int i = 0; flag; i++ ){
		flag = 0;
		for( int j = N - 1; j >= i + 1; j-- ){
			if( A[j] < A[j - 1] ){
				swap(A[j], A[j - 1]);
				flag = 1;
				sw++;
			}
		}
	}
	return sw;
}

int main(){
	int A[100], N, sw;
	cin >> N;
	for( int  i = 0; i < N; i++ ) cin >> A[i];
	sw = bubbleSort(A, N);
	for( int  i = 0; i < N; i++ ){
		if(i) cout << " ";
		cout << A[i];
	}
	cout << endl;
	cout << sw << endl;
	
	return 0;
}

Measured memory_bytes: 3108
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

acs = set()
wcs = dict()
wc = 0

n,m = nm()
for i in range(m):
  p,s = input().split()
  if s == 'AC':
    if p not in acs:
      if p in wcs:
        wc+=wcs[p]
    acs.add(p)
  elif p not in acs:
    if p not in wcs:
      wcs[p]=0
    wcs[p]+=1

print(len(acs))
print(wc)

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int H,A,count=0;	cin>>H>>A;
	while(1){
		H-=A;
		count++;
		if(H<1)	break;
	}
	cout<<count<<endl;

    return 0;
}



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

int main()
{
   char a[100];
   scanf("%s",a);
   int i,l,p=1,q=1,r=1;
   l= strlen(a);
   for(int i=0;i<l/2;i++){
        if(a[i]!=a[l-1-i]){
        p=0;
        break;
        }
   }
   int l1=(l-1)/2;
   for(int i=0;i<l1/2;i++){
    if(a[i]!=a[l1-1-i]){
        q=0;
        break;
    }
   }
   for(int i=(l+3)/2;i<l/2;i++){
    if(a[i]!=a[l-1-i]){
        r=0;
        break;
    }
   }
   if(p&&q&&r)
        printf("Yes");
   else
    printf("No");
   return 0;
}


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

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

long long MOD = 1000000000 + 7;

int main(){
  cout << setprecision(10);
  int N;
  cin >> N;
  vector<ll> A(N), B;

  map<ll, int> m;
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
  }
  B = A;
  sort(A.begin(), A.end());

  for(int i = 0; i < N; i++){
    if(m.count(A.at(i))== 0){
      m[A.at(i)] = i;
    } else { 
      continue;
    }
  }

  for(int i = 0; i < N; i++){
    int j = m[B.at(i)];
    if(j <= (N/2) -1){
      cout << A.at(N/2) << endl;
    } else { 
      cout << A.at(N/2 -1) << endl;
    }
  }
}


Measured memory_bytes: 17536
#include<iostream>
using namespace std;
int main(){
    int a,b,c;
    int n=0;
    cin>>a>>b>>c;
    
    for(int i=a;i<=b;i++){
        if(c%i==0) n+=1;
        else continue;
    }
    cout<<n<<endl;
    return 0;
}


Measured memory_bytes: 3100
N, M = list(map(int, input().split()))
xyz = [list(map(int,input().split())) for i in range(N)]

ans = 0
for i in range(1, 9):
    _list = []
    for j in range(N):
        S = 0
        for k in range(3):
            if ((i//(1<<k))%2 == 0):
                S += xyz[j][k]
            else:
                S -= xyz[j][k]
        _list.append(S)
    _list.sort(reverse=True)
    tmp_ans = sum(_list[:M])
    ans = max(ans, tmp_ans)

print(ans)

Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <numeric>
#include <tuple>

// さんこう :https://beta.atcoder.jp/contests/abc109/submissions/3153889
using namespace std;

typedef long long ll;

char c[5];

int main() {
   cin >> c;
   for (int i=0;i<3;i++) {
      if (c[i] == '1') {
         printf("9");
      } else {
         printf("1");
      }
   }
   putchar('\n');
   return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds; 
using ll = long long int;
#define INF             1e14
#define dd              double
#define MOD             1000000007
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type)) 
#define nl              cout<<endl
#define fill(a,val)     memset(a,val,sizeof(a))
#define mp              make_pair
#define endl            "\n"
#define pb              push_back
#define ff              first    
#define ss              second
#define SIZE            200005
#define all(v)          v.begin(),v.end()
#define s(ar,n)         sort(ar,ar+n)
#define rs(ar,n)        sort(ar, ar+n, greater<ll>()) 
#define oa(a,n)         for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n)         for(ll i=0;i<n;i++)cin>>a[i];
#define maxa(ar,N)      *max_element(ar,ar+N)
#define mina(ar,N)      *min_element(ar,ar+N)
#define fastio()        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define printclock      cerr<<"Time : "<<1000*(long double)clock()/(long double)CLOCKS_PER_SEC<<"ms\n";
typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// find_by_order() - 0 indexing
// order_of_key() - number of elements strictly smaller
ll power(ll x, ll y){
    ll res=1;x=x;
    while(y>0){
        if(y&1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}  
ll logtwo(ll n){
    if(n==1)
        return 0;
    return logtwo(n/2)+1;
}
//---------------------------------------GL HF------------------------------------------------------
// -------------------------------------ManavJ07----------------------------------------------------
signed main()
{
    fastio();   
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--)
    {
        ll L,R,D;
        cin>>L>>R>>D;
        cout<<R/D-(L-1)/D<<endl;
    }
}

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

int main(){
  int A,B,C;
  cin>>A>>B>>C;
  if(A+B<C){
    cout <<"No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
const int inf = 1000000000; //10^9
const ll MOD = 1e9 + 7;
//加算代入演算子は+=！！！！！
//int 2^31 10^9まで
int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    while (c > 0)
    {
        c -= b;
        if (c <= 0) break;
        else 
        a -= d;
        if (a <= 0) break;
    }
    if (a > c)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3596
#include<stdio.h>
int main()
{
    int m;
    while(scanf("%d",&m)!=EOF)
    {
        int i,max,min,n,x,b,a=0;
        for(i=0; i<m; i++)
        {
            scanf("%d",&n);
            if(i==0)
                min=n;
            if(i>a)
                x=n-min;
            if(min>n)
            {
                min=n;
                a=i;
            }
            if(i==1)
                b=x;
            if(i>1)
                if(b<x)
                    b=x;
        }
        printf("%d\n",b);
    }
}




Measured memory_bytes: 2092
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define lli long long int
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF 9223372036854775807+1

int main() {
  string S;
  cin >> S;
  lli N = S.size();
  lli cou1, cou2, ans;
  cou1=0;
  cou2=0;
  ans=0;
  rep(i, N){
    if(i == 0){
    if(S[i]=='<'){
  cou1++;
      continue;
    }
      else{
        cou2++;
        continue;
      }
    }    

    
  if(S[i-1]==S[i]){
    
    if(S[i]=='<')
      cou1++;
    else
      cou2++;
  }
    else{
   if(S[i]=='<'){
     ans+=max(cou1, cou2)*(max(cou1, cou2)+1)/2;
     if(min(cou1, cou2) != 0)
     ans+=min(cou1, cou2)*(min(cou1, cou2)-1)/2;
  cou1=0;
  cou2=0;
      cou1++;
   }
    else
      cou2++;
  }
    }
  if(S[N-1]== '>')
  {
     ans+=max(cou1, cou2)*(max(cou1, cou2)+1)/2;
     if(min(cou1, cou2) != 0)
     ans+=min(cou1, cou2)*(min(cou1, cou2)-1)/2;
  cou1=0;
  cou2=0;
      cou1++;
  }
  else{
  ans+=cou1*(cou1+1)/2;
  }
  cout << ans << endl;
  }

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


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

    int n;
    cin >> n;
    vector<int> p(n);
    rep (i, n) cin >> p[i];
    auto it = max_element(ALL(p));
    int ans = 0;
    rep (i, n) ans+=p[i];
    ans -= *it / 2;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>

using namespace std;

int main() {
	string c[2];
	cin >> c[0] >>c[1];
	if (c[0][0] == c[1][2] && c[0][1] == c[1][1] && c[0][2] == c[1][0]) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	return 0;
}

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

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

fn main() {
    let a:i32 = read();
    let b:i32 = read();
    let c:i32 = read();
    let x:i32 = read();
    let mut cnt = 0;
    for i in 0..a+1 {
        let x = x - 500 * i;
        if x < 0 { continue; }
        for j in 0..b+1 {
            let x = x - 100 * j;
            if x < 0 { continue; }
            if x % 50 == 0 && x / 50 <= c {
                cnt += 1;
            }
        }
    }
    println!("{}", cnt);
}

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

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

P p[200000];

vector<P>E[200000],G[200000];
int l[200000],r[200000];
int q[200000];

bool used[200000];
int cnt[200000];

void dfs(int v,int p,int k){
	used[v]=true;
	cnt[k]+=q[v];
	for(auto u:E[v]){
		if(used[u.second])continue;
		dfs(u.second,v,k);
		G[v].push_back(u);
		G[u.second].push_back(P(u.first,v));
	}
}

vector<int>ans;
int dfs2(int v,int p){
	used[v]=true;
	int C=0;
	int id=-1;
	for(auto u:G[v]){
		if(u.second==p){
			id=u.first;
			continue;
		}
		C^=dfs2(u.second,v);
	}
	if(C^q[v]){
		assert(id!=-1);
		ans.push_back(id);
		return 1;
	}
	return 0;
}

int main(){
	int n,m;cin>>n>>m;
	vector<int>v;
	rep(i,n){
		scanf("%d%d",&p[i].first,&p[i].second);
		v.push_back(p[i].first);
	}
	p[n++]=P(-INF,0);
	p[n++]=P(INF,0);
	v.push_back(-INF);
	v.push_back(INF);
	sort(p,p+n);
	sort(v.begin(),v.end());
	rep(i,n){
		q[i]=(i?(p[i].second!=p[i-1].second):0);
	}
	rep(i,m){
		int L,R;scanf("%d%d",&L,&R);
		l[i]=lower_bound(v.begin(),v.end(),L)-v.begin();
		r[i]=upper_bound(v.begin(),v.end(),R)-v.begin();
		if(l[i]==r[i])continue;
		E[l[i]].push_back(P(i,r[i]));
		E[r[i]].push_back(P(i,l[i]));
	}
	int com=0;
	rep(i,n){
		if(!used[i])dfs(i,-1,com++);
	}
	rep(i,com){
		if(cnt[i]%2==1){
			puts("-1");return 0;
		}
	}
	memset(used,0,sizeof(used));
	rep(i,n){
		if(!used[i])dfs2(i,-1);
	}
	sort(ans.begin(),ans.end());
	cout<<ans.size()<<endl;
	for(int i:ans)cout<<i+1<<' ';
	cout<<endl;
}


Measured memory_bytes: 28152
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
using namespace std;
typedef long long ll;
ll MOD = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)
int main() {
    ll n, h, w;
    cin >> n >> h >> w;
    int ans = 0;
    rep(i, n) {
        ll a, b;
        cin >> a >> b;
        if ( a >= h && b >= w ) ++ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

AB = []
for a in A:
    for b in B:
        AB.append(a+b)
AB.sort(reverse=True)
AB = AB[:K]

ABC = []
for ab in AB:
    for c in C:
        ABC.append(ab+c)
ABC.sort(reverse=True)

for i in range(K):
    print(ABC[i])


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

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  vector<int> foo(n), bar(n);
  foo[0] = vec[0];
  for (int i = 1; i < n; i++) {
    foo[i] = __gcd(foo[i - 1], vec[i]);
  }
  bar.back() = vec.back();
  for (int i = n - 2; i >= 0; i--) {
    bar[i] = __gcd(bar[i + 1], vec[i]);
  }
  int mx = bar[1];
  for (int i = 1; i < n - 1; i++) {
    mx = max(mx, __gcd(foo[i - 1], bar[i + 1]));  
  }
  mx = max(mx, foo[n - 2]);
  cout << mx << '\n';
  return 0;
}

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

int main() {
	int n, a[200010];
	long long sum[200010], ans = 0;
	map <long long, int> m;
	cin >> n;

	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		sum[i] = sum[i - 1] + a[i];
	}

	m[0]++;
	for (int i = 1; i <= n; i++) {
		ans += m[sum[i]];
		m[sum[i]]++;
	}

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


Measured memory_bytes: 15104
implicit none
integer :: n
integer :: i,j,k
integer(8) :: ans, m(5)
character(10) :: s

m(:) = 0
read *,n
do i = 1, n
   read *,s
   if (s(1:1) == 'M') then
      m(1) = m(1) + 1
   else if (s(1:1) == 'A') then
      m(2) = m(2) + 1
   else if (s(1:1) == 'R') then
      m(3) = m(3) + 1
   else if (s(1:1) == 'C') then
      m(4) = m(4) + 1
   else if (s(1:1) == 'H') then
      m(5) = m(5) + 1
   endif
enddo

ans = 0
do i = 1, 3
   do j = i+1,4
      do k = j+1,5
         ans = ans + m(i)*m(j)*m(k)
      enddo
   enddo
enddo

print '(i0)',ans
end

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

int main(){

    int N;
    int t[110000], x[110000], y[110000];
    cin >> N;
    t[0] = x[0] = y[0] = 0; //初期状態
    for (int i = 0; i < N; ++i) cin >>t[i+1]>>x[i+1]>>y[i+1];

    bool can = true;
    for (int i = 0; i < N; ++i){
        int dt = t[i+1] - t[i];
        int dist = abs(x[i+1] - x[i]) + abs( y[i+1]- y[i]);
        if (dt < dist)can = false; //時間より距離が大きいとおかしい
        if (dist % 2 != dt % 2) can = false; //distとdtの偶奇は一致
    }
    if (can) cout << "Yes" << endl;
    else cout << "No" << endl;

}

Measured memory_bytes: 1408
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
#define tget(a,b) get<a>(b)
using namespace std;
typedef long long ll;
const ll INF = 1e17;
const int MOD = 1e9 + 7;

string A,B,C;

int main(void) {
	cin >> A >> B >> C;
	A[0] -= 32;
	B[0] -= 32;
	C[0] -= 32;
	cout<<A[0]<<B[0]<<C[0]<<endl;
	return 0;
}

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

ll ara[100005] ;

int main()
{

      ll n ;
      cin >> n ;
      for( ll i = 0 ; i<n ; i++ )
      {
          cin  >> ara[i] ;
      }
      ll sum = 1;
      ll counter = 0 ;
      sort( ara , ara+n , greater<ll>() ) ;
      for( ll i = 0 ; i<n-1 ; i++ )
      {
          if( ara[i]==ara[i+1] )
          {
              counter++;

              sum*=ara[i] ;
              i++ ;
              if( counter==2 )
              {
                  break;
              }
          }
      }

      if( counter!=2 )
      {
          cout << 0 << endl ;
      }
      else
      {
          cout << sum << endl;
      }



}


Measured memory_bytes: 1024
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	void doIt() {
		new Curling_2_0().Main();
	}
	
	
	public static void main(String[] args) {
		new Main().doIt();
	}
	
	class Curling_2_0{
		int[] dx = {-1, 0, 1, 0};
		int[] dy = {0, -1, 0, 1};
		int h, w;
		void Main(){
			while(true) {
				w = sc.nextInt();
				h = sc.nextInt();
				if(w == 0 && h == 0) return;
				int field[][] = new int[h][w];
				int x = 0, y = 0;
				for(int i = 0; i < h; i++) {
					for(int j = 0; j < w; j++) {
						field[i][j] = sc.nextInt();
						if(field[i][j] == 2) {
							x = j; y = i;
						}
					}
				}
				int ans = search(x, y, field, 0, Integer.MAX_VALUE);
				if(ans > 10) ans = -1;
				System.out.println(ans);
			}
		}
		int search(int x, int y, int[][] f, int cnt, int min) {
			cnt++;
			if(cnt > 10) return 11;
			for(int i = 0; i < 4; i++) {
				int _x = x, _y = y;
				while(_x + dx[i] >= 0 && _x + dx[i] < w &&
						_y + dy[i] >= 0 && _y + dy[i] < h) {
					if(f[y + dy[i]][x + dx[i]] == 1) break;
					_x += dx[i];
					_y += dy[i];
					//System.out.println(i);
					if(f[_y][_x] == 3) {
						f[_y][_x] = 9;
						min = Math.min(min, cnt);
						//System.out.println(cnt);
						/*for(int k = 0; k < h; k++) {
							System.out.println(Arrays.toString(f[k]));
						}
						System.out.println();*/
						f[_y][_x] = 3;
						break;
					}
					if(f[_y][_x] == 1) {
						f[_y][_x] = 0;
						/*for(int k = 0; k < h; k++) {
							System.out.println(Arrays.toString(f[k]));
						}
						System.out.println();
						*/
						min = Math.min(min, search(_x - dx[i], _y - dy[i], f, cnt, min));
						f[_y][_x] = 1;
						break;
					}
				}
				//System.out.println((_x  - dx[i])+ " " + (_y - dy[i]));
			}
			
			//System.out.println();
			return min;
		}
	}
}



Measured memory_bytes: 45676
import math
pi = math.acos(-1)
N, L = map(int, input().split())
NN = N * (N-1) * (N-2) // 6
T = [int(input()) for _ in range(N)]
print(sum([sum([math.cos((T[i]+T[j])*pi/L) * (N+2*(i-j)) for j in range(i+1, N)]) for i in range(N)])/NN, sum([sum([math.sin((T[i]+T[j])*pi/L) * (N+2*(i-j)) for j in range(i+1, N)]) for i in range(N)])/NN)

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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair

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<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


string RES[4] = {"AC", "WA", "TLE", "RE"};

int main() {
    i64 N; cin >> N;
    vector<i64> cnt(4, 0);
    REP(i, N) {
        string s; cin >> s;
        if (s[0] == 'A') {
            cnt[0]++;
        } else if (s[0] == 'W') {
            cnt[1]++;
        } else if (s[0] == 'T') {
            cnt[2]++;
        } else if (s[0] == 'R') {
            cnt[3]++;
        }
    }

    REP(i, 4){
        cout << RES[i] << " x " << cnt[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3620
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    static void Main()
    {
        FastScanner sc = new FastScanner(Console.OpenStandardInput());
        int N = 5;
        int[] x = sc.intArray(N);
        Console.WriteLine(Array.IndexOf(x, 0) + 1);
        return;
    }
}

// FastScanner start
public class FastScanner
{
    public readonly Stream str;
    private readonly byte[] buf = new byte[1024];
    private int len, ptr;
    public bool isEof = false;
    public FastScanner(Stream stream)
    {
        str = stream;
    }
    private T[] enumerate<T>(int n, Func<T> f)
    {
        var a = new T[n];
        for (int i = 0; i < n; ++i) a[i] = f();
        return a;
    }
    public char nextChar()
    {
        byte b = 0;
        do
        {
            b = read();
        }
        while ((b < 33 || 126 < b) && !isEof);
        return (char)b;
    }
    public int nextInt()
    {
        return (isEof) ? int.MinValue : (int)nextLong();
    }
    public long nextLong()
    {
        if (isEof)
        {
            return long.MinValue;
        }
        long ret = 0;
        byte b = 0;
        var ng = false;
        do
        {
            b = read();
        }
        while (b != '-' && (b < '0' || '9' < b));
        if (b == '-')
        {
            ng = true;
            b = read();
        }
        for (; true; b = read())
        {
            if (b < '0' || '9' < b)
            {
                return ng ? -ret : ret;
            }
            else ret = ret * 10 + b - '0';
        }
    }
    public int[] intArray(int n)
    {
        return enumerate(n, nextInt);
    }
    public long[] longArray(int n)
    {
        return enumerate(n, nextLong);
    }
    public char[] charArray(int n)
    {
        return enumerate(n, nextChar);
    }
    public string Scan()
    {
        var sb = new StringBuilder();
        for (var b = nextChar(); b >= 33 && b <= 126; b = (char)read())
        {
            sb.Append(b);
        }
        return sb.ToString();
    }
    private byte read()
    {
        if (isEof)
        {
            return 0;
        }
        if (ptr >= len)
        {
            ptr = 0;
            if ((len = str.Read(buf, 0, 1024)) <= 0)
            {
                isEof = true;
                return 0;
            }
        }
        return buf[ptr++];
    }
}
// FastScanner end

Measured memory_bytes: 25696
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
#define MAXN 200005
#define INF 0x3f3f3f3f
#define LL long long
LL x,y;
LL Abs(LL m)
{
	if(m>=0) return m;
	return -m;
}
int main()
{
	scanf("%lld %lld",&x,&y);
	if(Abs(x-y)<=1)
		printf("Brown\n");
	else printf("Alice\n");
    return 0;
}


Measured memory_bytes: 128
using System;

class Program {
  
  static void Main(string[] args) {
    
    string[] line=Console.ReadLine().Split(' ');
    int a=int.Parse(line[0]);
    int b=int.Parse(line[1]);
    
    if((a*b)%2==0) {
      Console.WriteLine("Even");
    } else if((a*b)%2==1) {
      Console.WriteLine("Odd");
    }
   
  }
}
    

Measured memory_bytes: 13140
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def find_gcd(list_l):
    x = reduce(gcd, list_l)
    return x


def main():
    n,x = map(int,input().strip().split())
    a = list(map(int, input().strip().split()))

    a=[y-x for y in a]
    print(abs(find_gcd(a)))

if __name__ == '__main__':
    main()

Measured memory_bytes: 84076
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
constexpr long INF = 1L << 62;
constexpr long MOD = 1e9 + 7;

long n, k;
vector<vector<int>> G;

constexpr int MAX = 100010;
long fac[MAX], inv[MAX], finv[MAX];
void CombInit(){
    fac[0] = inv[0] = finv[0] = 1;
    fac[1] = inv[1] = finv[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 P(int n,int k){
    if(n < 0 || k < 0 || n < k) return 0;
    return fac[n] * finv[n-k] % MOD;
}

long dfs(int pv, int v, long c) {
    long ret;
    if(pv == -1) ret = P(max(c - 1, k - 2), (int)G[v].size());
    else ret = P(max(c - 1, k - 2), (int)G[v].size() - 1);

    for(int nv : G[v]) {
        if(nv == pv) continue;
        ret = ret * dfs(v, nv, c - 1) % MOD;
    }
    return ret;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    cin >> n >> k;
    G.resize(n);
    CombInit();
    REP(i,n-1) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    cout << k * dfs(-1, 0, k) % MOD << endl;
    return 0;
}

Measured memory_bytes: 13952
public class Main {
	public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner( System.in);
		int a  = scan.nextInt();
		int b  = scan.nextInt();
		System.out.print(a*b);
		System.out.print(" ");
		System.out.println(2*a+2*b);
	}

}

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

struct Node {
	int key;
	Node* p, * l, * r;
};
Node* root, * NIL;
void insert(int k) {
	Node* y = NIL, * x = root, * z;
	z = (Node*)malloc(sizeof(Node));
	z->key = k;
	z->l = NIL;
	z->r = NIL;
	while (x != NIL) {
		y = x;
		if (z->key < x->key) {
			x = x->l;
		}
		else {
			x = x->r;
		}
	}
	z->p = y;
	if (y == NIL) {
		root = z;
	}
	else {
		if (z->key < y->key) {
			y->l = z;
		}
		else {
			y->r = z;
		}
	}
}
void inorder(Node* u) {
	if (u == NIL)return;
	inorder(u->l);
	cout << " " << u->key;
	inorder(u->r);
}
void preorder(Node* u) {
	if (u == NIL)return;
	cout << " " << u->key;
	preorder(u->l);
	preorder(u->r);
}
 

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

	int n, x;
	string com;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> com;
		if (com[0] == 'i') {
			cin >> x;
			insert(x);
		}
		else {
			inorder(root);
			cout << endl;
			preorder(root);
			cout << endl;
		}
	}
}


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

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

def main():
	s = input()
	if s == 'SUN':
		print(7)
	elif s == 'MON':
		print(6)
	elif s == 'TUE':
		print(5)
	elif s == 'WED':
		print(4)
	elif s == 'THU':
		print(3)
	elif s == 'FRI':
		print(2)
	elif s == 'SAT':
		print(1)

if  __name__=='__main__':
	main()


Measured memory_bytes: 5712
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define SP << " " <<

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;

__attribute__((constructor))
void initial(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed <<setprecision(15);
}


int main(void){
	double r;
    cin >> r;
    r = r*2*3.1415926;
    cout << r << endl;
    return 0;
}


Measured memory_bytes: 3800
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long H,W,K;
    cin >> H >> W >> K;
    std::vector<std::vector<char>> c(H, vector<char>(W, ' '));
    long count=0;
    for(size_t i=0;i<H; i++)
    {
        string line;
        cin >> line;
        for(size_t j=0;j<W; j++)
        {
            if(line[j] == '#') count++;
            c[i][j] = line[j];
        }
    }
    cerr << count << endl;
    /*
    for(size_t i=0;i<H; i++)
    {
        for(size_t j=0;j<W; j++)
        {
            cerr << c[i][j] << " ";
        }
        cerr << endl;
    }
    */
   ll comb_count=0;
    for(ll k=0;k<(1<<(H+W)); k++)
    {
        //cerr << k << endl;
        ll erase = 0;
        //cerr << k << ">>" << endl;
        for(size_t i=0;i<H;i++)
        {
            //cerr << i << endl;
            for(size_t j=H;j<W+H; j++)
            {
                //cerr << "i:" << i << ":" << (k>>i) << " " << "j:" << j << ":" << (k>>j) << endl;

                if(((k>>i) & 1 || (k>>j) & 1) && c[i][j-H]=='#') erase++;
            }
        }
        //cerr << erase << ":" << count-erase << endl;
        if(count-erase == K) comb_count++;
    }
    cout << comb_count << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;
using boost::sort;
using boost::adaptors::reversed;

int main() {
    int n;
    cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        int a;
        cin >> a;
        if (i % 2 == 0) continue;
        if (a % 2 == 1) ans += 1;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll dp[1000001][4];
ll ar[1000001][4];
int n;

ll calc(int i,int j){
  if(i==n)return 0;
  if(dp[i][j]!=-1)return dp[i][j]; 
  ll maxm=INT_MIN,ans;
  for(int k=0;k<3;k++){
      if(j!=k){
      ans=calc(i+1,k)+ar[i][k];
      maxm=max(maxm,ans);
          
      }
      
  }
  return dp[i][j]=maxm;
  
}
int main(){
    cin>>n;
    
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++){
            cin>>ar[i][j];
           // cout<<ar[i][j]<<" ";
        }
    }
    memset(dp,-1,sizeof(dp));
    
    ll ans=max(calc(1,0)+ar[0][0],max(calc(1,1)+ar[0][1],calc(1,2)+ar[0][2]));
    cout<<ans<<endl;
    
}

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

typedef long long ll;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 999999999
#define DEBUG(s) cout << s << endl

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int ans = 1;
    if (n == 1)
    {
        cout << m;
        return 0;
    }
    for (int i = 2; i < m / n + 1; i++)
    {
        if (m % i == 0)
            ans = i;
    } /*
    for (int i = 2; n <= m / i; i++)
    {
        if (m % i == 0)
        {
            int j = m / i;
            // if (m / i <= m / n)
            if (n <= m / i)
            {
                ans = m / i;
                break;
            }
            ans = i;
        }
    }*/
    cout << ans;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define MOD 1000000007 //S.size()
using namespace std;
typedef unsigned long long ll;

int main(void){
	stack<int> S;
	string s;

	int a, b;
	while(cin >> s){
		if(s[0] == '+'){
			a = S.top(); S.pop();
			b = S.top(); S.pop();
			S.push(a + b);
		}
		else if(s[0] == '-'){
			a = S.top(); S.pop();
			b = S.top(); S.pop();
			S.push(b - a);
		}
		else if(s[0] == '*'){
			a = S.top(); S.pop();
			b = S.top(); S.pop();
			S.push(a * b);
		}
		else {
			S.push(stoi(s));
		}
	}
	cout << S.top() << endl;

	return 0;
}



Measured memory_bytes: 3228
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
  ifstream cin("in.txt");
#endif
  int A, B;
  while (cin >> A >> B) {
    int res = B % A == 0 ? A + B : B - A;
    cout << res << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define pi acos(-1.0)
using namespace std;
const int maxn = 1e5+5;
 
int main(){
	string s; cin >> s;
	if(s == "ABC") cout << "ARC" << endl;
	else cout << "ABC" << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <algorithm>
typedef long long lint;
using namespace std;
const int N=2e5+5;
int h,w,n;
char st1[N],st2[N];
char mp[126];

namespace utils{
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
	template <class T> inline void apn(T &x,const T y){x=x<y?x:y;}
	template <class T> inline void apx(T &x,const T y){x=x>y?x:y;}
	template <class T> inline T cabs(const T &x){return x<0?-x:x;}
	static struct{
		template <class T> operator T(){
			T x=0;
			char c;
			while(((c=getchar())>'9'||c<'0')&&c!='-');
			const bool f=(c=='-')&&(c=getchar());
			while(x=x*10-48+c,(c=getchar())>='0'&&c<='9');
			return f?-x:x;
		}
	}ni;
}
using namespace utils;

bool onbrd(const int st){
	int l=1,r=w;
	for(int i=n; i>=1; --i){
		if(st2[i]=='R'){
			l=max(1,l-1);
		}else if(st2[i]=='L'){
			r=min(w,r+1);
		}
		if(st1[i]=='R'){
			if(--r<l) return 0;
		}else if(st1[i]=='L'){
			if(++l>r) return 0;
		}
	}
	return st>=l&&st<=r;
}

int main(){
	mp['L']='U',mp['R']='D',mp['U']='L',mp['D']='R';
	h=ni,w=ni,n=ni;
	int sr=ni,sc=ni;
	scanf("%s",st1+1);
	scanf("%s",st2+1);
	if(!onbrd(sc)) puts("NO");
	else{
		swap(w,h);
		for(int i=1; i<=n; ++i){
			st1[i]=mp[st1[i]];
			st2[i]=mp[st2[i]];
		}
		puts(onbrd(sr)?"YES":"NO");
	}
	return 0;
}


Measured memory_bytes: 4052