akhauriyash/Code-Regression huggingface dataset:
//==========================Head files==========================
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<set>
#include<iostream>
#include<map>
#define LL long long
#define db double
#define mp make_pair
#define pr pair<int, int>
#define fir first
#define sec second
#define pb push_back
#define ms(i, j) memset(i, j, sizeof i)
using namespace std;
//==========================Templates==========================
inline int read() {
    int x = 0, f = 1; char c = getchar();
    while(c < '0' || c > '9'){if (c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9'){x = x * 10 + c - '0'; c = getchar();}
    return x * f;
}
inline LL readl() {
    LL x = 0, f = 1; char c = getchar();
    while(c < '0' || c > '9'){if (c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9'){x = x * 10 + c - '0'; c = getchar();}
    return x * f;
}
int power(int a, int b) {
	int ans = 1;
	while (b) {
		if(b & 1) ans = ans * a;
		b >>= 1; a = a * a;
	}
	return ans;
}
int power_mod(int a, int b, int mod) {
	a %= mod;
	int ans = 1;
	while (b) {
		if(b & 1) ans = (ans * a) % mod;
		b >>= 1, a = (a * a) % mod;
	}
	return ans;
}
LL powerl(LL a, LL b) {
	LL ans = 1ll;
	while (b) {
		if(b & 1ll) ans = ans * a;
		b >>= 1ll;a = a * a;
	}
	return ans;
}
LL power_modl(LL a, LL b, LL mod) {
	a %= mod;
	LL ans = 1ll;
	while (b) {
		if(b & 1ll) ans = (ans * a) % mod;
		b >>= 1ll, a = (a * a) % mod;
	}
	return ans;
}
LL gcdl(LL a, LL b) {return b == 0 ? a : gcdl(b, a % b);}
LL abssl(LL a) {return a > 0 ? a : -a;}
int gcd(int a, int b) {return b == 0 ? a : gcd(b, a % b);}
int abss(int a) {return a > 0 ? a : -a;}
//==========================Main body==========================
#define LD "%I64d"
#define D "%d"
#define pt printf
#define sn scanf
#define pty printf("YES\n")
#define ptn printf("NO\n")
//==========================Code here==========================
char s[200000 + 5];
int n, gg[200000 + 5], m, q[200000 + 5];
int main() {
	scanf("%s", s + 1);
	n = strlen(s + 1);
	for (int i = 1; i <= n; ++i) {
		if (s[i] == 'A') gg[++m] = 1;
		else if (i < n && s[i] == 'B' && s[i + 1] == 'C') gg[++m] = 2, ++i;
		else if (gg[m] != 100) gg[++m] = 100;
	}
	if (gg[m] != 100) gg[++m] = 100;
	for (int i = 1; i <= n; ++i) {
		q[i] = q[i - 1];
		if (gg[i] != 100) q[i] += gg[i];
	}
	LL ans = 0;
	int pre = 1;
	for (int i = 1; i <= m; ++i) {
		if (gg[i] == 100) {
			int cnt = q[i - 1];
			for (int j = i - 1; j >= pre; --j) 
				if (gg[j] == 1) ans += abss(cnt - q[j]), --cnt;
			pre = i + 1;
		}
		/*if (gg[i - 1] == 2 && gg[i] == 1) {
			int cnt = i - 1;
			for (int j = pre; j <= i - 1; ++j) if (gg[j] == 1) ans += abss(cnt - j), --cnt;
			pre = i;
		}*/
	}
	cout << ans / 2ll;
	return 0;
}

Measured memory_bytes: 2048
#include <iostream>
using namespace std;
int main(void) {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  int a = 'A' - 'a';
  cout << char(s1[0] + a) << char(s2[0] + a) << char(s3[0] + a) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
int a,b,c,n,r;
int main(){while(scanf("%d%d%d",&a,&b,&c),a|b|c){a*=a;b*=b;c*=c;scanf("%d",&n);while(n--){scanf("%d",&r);r*=4*r;puts((a+b<r||b+c<r||c+a<r)?"OK":"NA");}}return 0;}

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

using namespace std;

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

  string s;
  cin >> s;
  int n = s.size() - 1;

  int64_t ans = 0;
  for (int i = 0; i < (1 << n); ++i) {
    int64_t tmp = (s[0] - '0');
    // cerr << s[0];
    int64_t sum = 0;
    for (int j = 0; j < n; ++j) {
      if (i & (1 << j)) {
        sum += tmp;
        tmp = 0;
        // cerr << "+"s;
      }
      tmp *= 10;
      tmp += (s[j + 1] - '0');
      // cerr << s[j + 1];
    }
    sum += tmp;
    ans += sum;
    // cerr << " "s << sum << '\n';
  }

  cout << ans << '\n';

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
using namespace std;

int main(){
    int N,x=0;
    cin >> N;
    for (int i = 0;i <=25;i++){
        for (int j = 0;j<=14;j++){
            if (N==4*i+7*j) {
                x = 1;
            }
        }
    }
    if (x==1){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
import java.util.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	
	
	public static void main(String[] args) {
		int TC = sc.nextInt();
		for (int i = 0; i < TC; i++) {
			read();
			solve();
		}
	}
	
	static String S = "";
	static boolean read() {
		S = sc.next();
		return true;
	}

	static void solve() {
		int cnt = 0;
		while (S.length() != 1) {
			cnt++;
			int a = Integer.parseInt(new Character(S.charAt(0)).toString());
			int b = Integer.parseInt(new Character(S.charAt(1)).toString());
			S = new Integer(a + b).toString() + S.substring(2);
		}
		if (cnt % 2 == 0) {
			System.out.println("Audrey wins.");
		} else {
			System.out.println("Fabre wins.");
		}
	}	
}

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

template<class T> ostream& operator<<(ostream& cout,vector<T> V)
{cout<<"[ ";for(auto v:V)cout<<v<<' ';return cout<<']';}
template<class L,class R> ostream& operator<<(ostream& cout,pair<L, R> P)
{return cout<<'('<<P.F<<','<< P.S<<')';}


signed main()
{
	fio
	inp(n)
	inpa(a,n-1)
	vector<int> b(n);
	fo(i,n-1)
	{
		b[a[i]-1]++;
	}
	fo(i,n)
		cout<<b[i]<<'\n';
	printclock;
}

Measured memory_bytes: 6368
#include<stdio.h>

typedef struct {
	char suit;
	int num;
}card;

void swap (int *x, int *y,char *a, char *b) {
	int temps;
	char tempn;  
 	temps = *x;
	*x = *y;
	*y = temps;
	tempn = *a;
	*a = *b;
	*b = tempn;
}

int bubble_sort (card A[], int n) {
	int i,j = 0;
	for (i = 0; i < n - 1; i++){
    	for (j = n - 1; j >= i + 1; j--){ 
			if (A[j].num < A[j-1].num){
				swap(&A[j].num, &A[j-1].num, &A[j].suit, &A[j-1].suit);
      		}
    	}
	}
}

int selectionSort(card A[], int n){
	int i,j,minj;
	for(i = 0; i < n; i++){
		minj = i;
		for(j = i; j < n; j++){
			if(A[j].num < A[minj].num){
				minj = j;
			}
		}
		swap(&A[i].num, &A[minj].num, &A[i].suit, &A[minj].suit);
	}
}

int main(void){
	int n,i,f2 = 0;
	scanf("%d" ,&n);
	card A[n],B[n];
	for(i = 0; i < n; i++){
		scanf(" %c%d",&A[i].suit,&A[i].num);
		B[i] = A[i];
	}
	bubble_sort (A, n);
	for(i = 0; i < n; i++){
		if(i < n - 1){
			printf("%c%d ",A[i].suit,A[i].num);
		}
		else{
			printf("%c%d\n",A[i].suit,A[i].num);
		}
	}
	printf("Stable\n");
	selectionSort(B, n);
	for(i = 0; i < n; i++){
		if(i < n - 1){
			printf("%c%d ",B[i].suit,B[i].num);
		}
		else{
			printf("%c%d\n",B[i].suit,B[i].num);
		}
	}
	for(i = 0; i < n; i++){
		if(B[i].num == A[i].num && B[i].suit != A[i].suit){
			printf("Not stable\n");
			return 0;
		}
	}
	printf("Stable\n");
	return 0;
}


Measured memory_bytes: 2088
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);



int main(){
  int a, b;
  cin >> a >> b;
  int ans = max({a+b, a-b, a*b});

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


Measured memory_bytes: 3612
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const ll MOD = 1E+09 + 7;
const ll INF = 1E18;
const int MAX_N = 52;

int N;
string s1, s2;

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

    cin >> N;

    cin >> s1;

    cin >> s2;

    ll ans;
    int i;
    if (s1[0] == s2[0]) {
        i = 0;
        ans = 3;
    } else {
        i = 1;
        ans = 6;
    }
    while (i < N - 1) {
        if (s1[i] == s2[i]) {
            if (s1[i + 1] == s2[i + 1]) {
                ans = (ans * 2) % MOD;
                i++;
            } else {
                ans = (ans * 2) % MOD;
                i += 2;
            }
        } else {
            if (s1[i + 1] == s2[i + 1]) {
                i++;
            } else {
                ans = (ans * 3) % MOD;
                i += 2;
            }
        }
    }

    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 3640
N = int(input())
A = [int(i) for i in input().split()]

from fractions import gcd

L = [0, 0]
for ai in A:
    L.append(gcd(L[-1], ai))

R = [0, 0]
for ai in A[::-1]:
    R.append(gcd(R[-1], ai))

print(max(gcd(l, r) for l, r in zip(L, reversed(R))))


Measured memory_bytes: 14052
package main

import "fmt"

func main() {
	var x1, x2, x3, x4, x5 int
	fmt.Scan(&x1, &x2, &x3, &x4, &x5)
	if x1 == 0 {
		fmt.Println(1)
	} else if x2 == 0 {
		fmt.Println(2)
	} else if x3 == 0 {
		fmt.Println(3)
	} else if x4 == 0 {
		fmt.Println(4)
	} else if x5 == 0 {
		fmt.Println(5)
	}
}


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

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> K(N);
    vector<vector<int>> A(N, vector<int>(M));
    for (int i = 0; i < N; i++) {
        cin >> K[i];
        for (int j = 0; j < K[i]; j++) {
            cin >> A[i][j];
        }
    }

        vector<int> cnt(M + 1);
        for (int i = 0; i < M; i++) {
            cnt[i] = 0;
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < K[i]; j++) {
                cnt[A[i][j]]++;
            }
        }

        int ans = 0;
        for (int i = 0; i <= M; i++) {
            if (cnt[i] == N) {
                ans++;
            }
        }

        cout << ans << endl;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int DX[] = {0, 1, 0, -1};
const int DY[] = {-1, 0, 1, 0};


//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(int argc, char const *argv[])
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int h, w, n;
	cin >> h >> w >> n;
	VVI table(h, VI(w + 1));
	queue<PII> q;
	vector<PII> goals(n);
	PII start;
	REP(i, h){
		string value_line;
		cin >> value_line;
		REP(j, w){
			char value_str = value_line[j];
			int value = 0;
			if(value_str == 'S'){
				start = MP(i, j);
			}else if('1' <= value_str && value_str <= '9'){
				goals[value_str - '0' - 1] = MP(i, j);
			}else if(value_str == 'X'){
				value = -1;
			}
			table[i][j] = value;
		}
	}

	q.push(start);
	int cnt = 0;
	for(auto it = goals.begin() ; it != goals.end(); it++){
		while(!q.empty()){
			PII p = q.front();
			q.pop();
			int y = p.first, x = p.second;
			REP(i, 4){
				int dx = x + DX[i];
				int dy = y + DY[i];
				int cv = table[y][x];
				if(dy >= 0 && dy < h && dx >= 0 && dx < w
					&& (table[dy][dx] > cv + 1 || table[dy][dx] == 0)){
					table[dy][dx] = cv + 1;
					q.push(MP(dy, dx));
				}
			}
		}

		PII goal = *it;
		int gx = goal.second, gy = goal.first;
		cnt += table[gy][gx];

		REP(i, h)
			REP(j, w)
				table[i][j] = table[i][j] >= 0 ? 0 : -1;
		q.push(goal);
	}

	cout << cnt << endl;
	
	return 0;
}

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


int main(void)
{
    string s;
    getline(cin, s);
    for (char c: s)
    {
        if (islower(c))
        {
            c = toupper(c);
        }
        else if (isupper(c))
        {
            c = tolower(c);
        }
        cout << c;
    }
    cout << endl;


    return 0;
}

Measured memory_bytes: 3240
N=int(input())
*A,=map(int,input().split())

J=[0]*N
j=0
while j<N:
    J[j]=j-A[j]
    j+=1

import collections
C = collections.Counter(J)

ans=0
i=0
while i<N:
    ans+=C[i+A[i]]
    i+=1

print(ans)

Measured memory_bytes: 117968
#include <bits/stdc++.h>
#define int long long
#define N 2999
using namespace std;
vector<long double> vec;
long double dp[N+1][N+1];

long double solve(int i, int j)
{
if(j>i+1||i==-1||j==-1)
	return 0;
if(dp[i][j]!=-1)
	return dp[i][j];

if(i==0)
		{
			if(j==1)
			  return dp[i][j]=vec[0];
			else
				return dp[i][j]=1.00-vec[0];
		}
return dp[i][j]=solve(i-1,j-1)*vec[i]+(1.00-vec[i])*solve(i-1,j);
}

int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin>>n;
vec.resize(n);
for(int i=0; i<n; i++)
{
	cin>>vec[i];
}
for(int i=0; i<N+1; i++)
	for(int j=0; j<N+1; j++)
		dp[i][j]=-1;
long double sum=0;
for(int i=n/2+1; i<=n; i++)
	sum+=solve(n-1,i);
cout<<fixed<<setprecision(10)<<sum;
return 0;
}


Measured memory_bytes: 141184
import sys
from heapq import heappop, heappush, heapify

def dijkstra(s, t, links):
    """Dijkstra algorism
    s: int, start node.
    t: int, target node.
    links: iterable, link infomation.
           links[i] contains edges from node i: (cost, target_node).

    return int, minimal cost from s node to t node.
    """
    heap = list(links[s])
    heapify(heap)
    visited = set()
    while len(heap) > 0:
        cost, node = heappop(heap)
        if node == t:
            return cost

        if node in visited:
            continue

        visited.add(node)
        for cost2, node2 in links[node]:
            if node2 in visited:
                continue

            heappush(heap, (cost + cost2, node2))

    return -1

def main():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    links = [[] for _ in range(N)]
    for i in range(1, N):
        links[i].append((0, i-1))

    for _ in range(M):
        l, r, c = map(int, input().split())
        links[l-1].append((c, r-1))
    
    return dijkstra(0, N-1, links)
    

if __name__ == '__main__':
    print(main())

Measured memory_bytes: 48036
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(100000)
def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))

def solve():

    return

def main():
    a,b,x = getList()
    kara = (a*a*b) - x
    if kara <= x:
        maxb = (kara * 2 / a) / a
        theta = math.atan(maxb/a)
        # print(maxb, kara)
        print(math.degrees(theta))
        # print(math.atan(1))
    else:
        theta = math.atan((a*b*b)/(2*x))
        print(math.degrees(theta))



if __name__ =="__main__":
    main()

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 45;
const int mod = 1000000007;
//const int mod = 998244353;


template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  int n;
  ll k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  map<int, int> mp;
  for(int i = 1; i <= 2000; ++i) mp[i] = 0;
  vector<mint> init(n, 0);
  for(int i = 0; i < n; ++i) {
    ++mp[a[i]];
    for(int j = i+1; j < n; ++j) {
      if(a[i] > a[j]) ++init[i];
    }
  }
  vector<mint> add(n, 0);
  rep(i, n) {
    for(int j = a[i]-1; j > 0; --j) add[i] += mp[j];
  }
  mint x = 0, y = 0;
  rep(i, n) {
    x += init[i];
    y += add[i];
  }
  x *= k;
  y *= k*(k-1)/2;
  auto ans = x+y;
  cout << ans.x << endl;
}


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

int main()
{
	int n, val, arr[100001];
	cin>>n;
	for(int i = 1; i <=n; i++)
	{
		cin>>val;
		arr[val] = i;
	}

	for(int i = 1; i <=n; i++)
		cout<<arr[i]<<" ";
	
	return 0;
}


Measured memory_bytes: 1152
#include<stdio.h>
#include<math.h>
 
int isPrime(int);
 
int main() {
   
  int i, j, n, input, count = 0;
   
 
   
  scanf("%d",&n);
  for(i = 0 ; i < n ; i++ ){
    scanf("%d" ,&input);
    if(isPrime(input)) count++;
  }
  printf("%d\n",count);
   
  return 0;
}
 
int isPrime(int n) {
  int sq = sqrt(n);
  int i,x;  
     
  if(n == 2) return 1;
  else if(n < 2 || n % 2 == 0) return 0;
 
  for(i = 2 ; i <= sq ; i++) {
      x = n % i ;
      if(x == 0) return 0;
     
  }
  return 1;
     
}

Measured memory_bytes: 596
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18



//for (auto p : prime_factor(N)) {
//	cout << p.first << " " << p.second << endl;
//}

//auto primes=primefactor(n);


int main() {
	LL n; cin >> n;

	LL ans = 0;

	LL q = 0;
	LL r = 0;

	for (LL i = 1; i*i <= n; i++) {
		if (n%i != 0)continue;

		q = n/i;

		if (i != 1) {
			r = n % (i - 1);
			if (q == r) {
				ans += i - 1;
			}
		}

		if (q != 1) {
			r = n % (q - 1);
			if (i == r) {
				ans += q - 1;
			}
		}

	}

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

Measured memory_bytes: 256
A,B = map(int,input().split())
S = input()
X,Y,Z = S[:A],S[A],S[A+1:]
if ("-" not in X) and (A==len(X)) and (Y=="-") and ("-" not in Z) and (B==len(Z)):
    print("Yes")
else:
    print("No") 

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e18;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 20000;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    string s;
    cin >> n >> s;
    vector<ll> r(n+1,0),g(n+1,0),b(n+1,0);
    rep(i,n){
        if (s[i] == 'R') r[i+1]++;
        if (s[i] == 'G') g[i+1]++;
        if (s[i] == 'B') b[i+1]++;
    }
    rep(i,n){
        r[i+1] += r[i];
        g[i+1] += g[i];
        b[i+1] += b[i];
    }
    ll cnt = 0;
    rep(i,n-2){
        rep(j,i+1,n-1){
            if (s[i] == s[j]) continue;
            ll sa = j-i;
            if (s[i] != 'R' && s[j] != 'R'){
                cnt += r[n]-r[j+1];
                if (j+sa < n){
                    cnt -= r[j+sa+1]-r[j+sa];
                }
            }
            else if (s[i] != 'G' && s[j] != 'G'){
                cnt += g[n]-g[j+1];
                if (j+sa < n){
                    cnt -= g[j+sa+1]-g[j+sa];
                }
            }
            else if (s[i] != 'B' && s[j] != 'B'){
                cnt += b[n]-b[j+1];
                if (j+sa < n){
                    cnt -= b[j+sa+1]-b[j+sa];
                }
            }
        }
    }
    PRINT(cnt);
}



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

int main(){
    int n;
    cin >> n;
    vector<long> v;
    for(int i = 0; i < n; i++){
        long a;
        cin >> a;
        v.push_back(a);
    }
    sort(v.begin(), v.end(), greater<long>());
    vector<long> rec;
    for(int i = 1; i < v.size(); i++){
        if(v[i-1] == v[i]){
            rec.push_back(v[i]);
            if(rec.size() == 2){
                break;
            }
            i++;
        }
    }
    if(rec.size() == 2){
        cout << rec[0] * rec[1] << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main()
{
    long long int n,k;
    cin >> n >> k;
    long long int ans = k;
    for(int i = 1;i < n;i++)
    {
        ans = ans * (k - 1);
    }
    cout << ans << "\n";
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
const ll INF = 1e20;
const int MOD = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
int n = 405;
vector<int> a(n);
vector<vector<ll>> dp(n,vector<ll>(n,-1));
vector<ll> accum(n,0);

ll dfs(int l,int r){
  if(l==r) return dp.at(l).at(r) = 0;
  ll res = INF;
  for(int i=l;i<r;i++){
    if(dp.at(l).at(i) == -1) dp.at(l).at(i) = dfs(l,i);
    if(dp.at(i+1).at(r) == -1) dp.at(i+1).at(r) = dfs(i+1,r);
    res = min(res,dp.at(l).at(i)+dp.at(i+1).at(r)+accum.at(r)-accum.at(l-1));
  }
  return dp.at(l).at(r) = res;
}
 
int main() {
  cin >> n;
  rep(i,n) cin >> a.at(i);
  rep(i,n) accum.at(i+1) = accum.at(i)+a.at(i);
  cout << dfs(1,n) << endl;
  //rep(i,n)rep(j,n) cout << dp[i][j] << endl;
  
  return 0;
}




Measured memory_bytes: 1536
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define iter(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define riter(i, c) for (auto i = (c).rbegin(); i != (c).rend(); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;

ll dfs(const vector<vector<ll>>& a, vector<ll>& dp, int n, int mask) {
    if (dp[mask] >= 0) {
        return dp[mask];
    }
    ll res = 0;
    rep(i, 0, n) rep(j, i + 1, n) {
        if (((mask >> i) & 1) && ((mask >> j) & 1)) {
            res += a[i][j];
        }
    }
    for (int now_mask = (mask - 1) & mask; now_mask > 0; now_mask = (now_mask - 1) & mask) {
        res = max(res, dfs(a, dp, n, now_mask) + dfs(a, dp, n, mask ^ now_mask));
    }
    return dp[mask] = res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<vector<ll>> A(N, vector<ll>(N));
    rep(i, 0, N) rep(j, 0, N) {
        cin >> A[i][j];
    }
    vector<ll> dp(1 << N, -1);
    cout << dfs(A, dp, N, (1 << N) - 1) << endl;
    return 0;
}

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

#define INF (1 << 29)
#define rep2(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) rep2(i,0,n)
#define EPS 1e-10

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

int dx[4] = {-1,0,1,0};
int dy[4] = {0,1,0,-1};


// 点
typedef pair<double,double> Pt;
inline istream& operator>>(istream& s, Pt& p) {return s >> p.first >> p.second;}
bool used[1010];
double cost[1010];

double dist(Pt x, Pt y, double r1, double r2) {
    return max(0.0, sqrt(pow(x.first-y.first,2)+pow(x.second-y.second,2))-r1-r2);
}

int main()
{
    Pt s,t;
    cin >> s >> t;

    int n;
    cin >> n;
    vector<Pt> cir(n);
    vector<double> r(n);
    rep(i,n) {
        cin >> cir[i] >> r[i];
    }

    rep(i,n+2) {
        used[i] = false;
        cost[i] = 1e+12;
    }

    cir.push_back(s);
    cir.push_back(t);
    r.push_back(0.0);
    r.push_back(0.0);

    cost[n] = 0;

    while(1){
        int v = -1;
        for(int u=0;u<n+2;u++){
            if(!used[u] && (v == -1 || cost[u] < cost[v])) v = u;
        }
        if(v==-1) break;
        used[v] = true;

        rep(u,n+2){
            cost[u] = min(cost[u],cost[v] + dist(cir[u],cir[v],r[u],r[v]));
        }
    }


    printf("%.10f\n",cost[n+1]);

    return 0;
}



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

int main() {
    int X;
    cin >> X;

    int ma = 1;
    for (int b=2; ; ++b) {
        if (b > X) break;
        //ma = max(ma, b);
        int tmp = b;
        for (int p=2; ; ++p) {
            tmp *= b;
            if (tmp > X) break;
            ma = max(ma, tmp);
        }
    }

    cout << ma << endl;
}


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

int main(){
        int n,k,i,cnt=0,ans=0;
        char s_pre,s_now;
        cin >> n >> k;
        cin >> s_pre;
        for(i=0;i<n-1;++i){
                cin >> s_now;
                if(s_pre=='R'&&s_now=='L') ++cnt;
                else if(s_pre==s_now) ++ans;
                s_pre = s_now;
        }
        /*if(k<cnt) ans += k*2;
        else ans += cnt*2 + 1;*/
        cout << min(ans+2*k,n-1) << endl;
        return 0;
}

Measured memory_bytes: 3616
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;

static class P
{
    static void Main()
    {
        var ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine(ab[1] % ab[0] == 0 ? ab[1] + ab[0] : ab[1] - ab[0]);
    }
}


Measured memory_bytes: 13396
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int main(void){
	int n,p[20],i,ans=0;
	cin >> n;
	for(i=1; i<=n; ++i){
		cin >> p[i];
	}
	for(i=2; i<n; ++i){
		if((p[i]>p[i-1])^(p[i]>p[i+1])){
			++ans;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
use std::env;
use std::io::*;
use std::str::*;
use std::mem;
use std::collections::HashMap;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}
fn read_char() -> char {
    let c = read::<String>();
    let c = c.chars().collect::<Vec<char>>();
    c[0]
}
fn read_String_Vec() -> Vec<char> {
    let S = read::<String>();
    S.chars().collect::<Vec<char>>()
}

fn vecchar_to_String(Vs: &Vec<char>) -> String {
    let mut S = String::new();
    for i in 0..Vs.len() {
        S.push(Vs[i]);
    }
    S
}

/*
文字コード
A : 65
Z : 90
a : 97
z : 122
0 : 48
9 : 57
*/

/*
let N = read::<i32>();
let S = read::<String>();
let S = read_String_Vec();
let C = read_char();
*/

/*
 .to_string() : * -> String
 &*S          : String -> &str
*/

fn main() {
    // main の引数
    /*
        引数なしのときargs.len() = 1;
    */
    let args: Vec<String> = env::args().collect();

    let A = read::<usize>();
    let B = read::<usize>();

    let S = read_String_Vec();
    let mut boolean = true;
    for ind in 0..A {
        let c = S[ind] as u8;
        if 48 <= c && c <= 57 {
            // ok
        } else {
            boolean = false;
        }
    }
    if '-' != S[A] {
        boolean = false;
    }
    for ind in A+1..A+B+1 {
        let c = S[ind] as u8;
        if 48 <= c && c <= 57 {
            // ok
        } else {
            boolean = false;
        }
    }

    if boolean {
        println!("Yes");
    } else {
        println!("No");
    }
}


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

#define fr first
#define sc second
#define OK puts("OK");
#define pb push_back
#define mk make_pair
#define int long long

using namespace std;

typedef long long ll;

const int inf = (int)1e9 + 7;
const int N = (int)2e5 + 7;

int n;
int a[N],dp[N],pr[N];
int mx = -inf,cur;
vector <int> v;

main () {
    cin >> n;

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

    for (int i = 1; i <= n; i ++) {
        for (int j = 1; j < i; j ++) {
            if ((i % 2) == (j % 2) && dp[j] + a[i] >= dp[i]) {
                dp[i] = dp[j] + a[i],pr[i] = j;
            }
        }
        if (mx <= dp[i])
            mx = dp[i],cur = i;
    }

    cout << mx << endl;

    for (int i = n; i > cur; i --)
        v.pb(i);

    while (1) {
        int o = pr[cur];
        int m = (cur + o) / 2;
        for (int i = m; i > o; i --)
            v.pb(i);
        if (cur == o)
            break;
        cur = o;
    }
    for (int i = 1; i < cur; i ++)
        v.pb(1);
    cout << v.size() << endl;

    for (int i = 0; i < v.size(); i ++)
        cout << v[i] << endl;
}


Measured memory_bytes: 2304
#include <stdio.h>

typedef struct{
  char m;
  int value;
} CA;

int isStable(CA *,CA *,int);

int main()
{
  int i,j,n,k,o,minj;
  char null,e;
  scanf("%d",&n);
  CA C[36],B[36];
  for(k=0;k<n;k++)
    {
      scanf(" %c%d",&C[k].m,&C[k].value);
      B[k].m=C[k].m;
      B[k].value=C[k].value;
    }
  
  //baburu
  for(i=0;i<=n-1;i++)
    {
      for(j=n-1;j>=i+1;j--)
	{
	  if(C[j].value<C[j-1].value)
	    {
	      o = C[j].value;
	      C[j].value = C[j-1].value;
	      C[j-1].value = o;
	      e = C[j].m;
	      C[j].m = C[j-1].m;
	      C[j-1].m = e;
	    }
	}
    }
	      
  for(k=0;k<n-1;k++)
    {
      printf("%c%d ",C[k].m,C[k].value);
    }
  printf("%c%d\n",C[n-1].m,C[n-1].value);
  printf("Stable\n");

  //sentaku
  for(i=0;i<=n-1;i++)
    {
      minj=i;
      for(j=i;j<=n-1;j++)
	{
          if(B[j].value<B[minj].value)
	    {
	      minj=j;
	    }
	}
      if(i!=minj)
	{
	  o=B[i].value;
	  B[i].value=B[minj].value;
	  B[minj].value=o;
	  e = B[i].m;
	  B[i].m = B[minj].m;
	  B[minj].m = e;
	}
    }

  for(k=0;k<n-1;k++)
    {
      printf("%c%d ",B[k].m,B[k].value);
    }
  printf("%c%d\n",B[n-1].m,B[n-1].value);

  if(isStable(C,B,n)==1)printf("Stable\n");
  else printf("Not stable\n");

  return 0;
}

int isStable(CA *c,CA *d,int n)
{
  int i,j,a,b;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      for(a=0;a<n;a++){
	for(b=a+1;b<n;b++)
	  {
	    if(c[i].value==c[j].value && c[i].value==d[b].value &&c[j].value == d[a].value &&c[i].m==d[b].m &&c[j].m == d[a].m)return 0;
	}
      }
    }
  }
  return 1;
}



Measured memory_bytes: 2052
use text_io::*;
use std::collections::HashMap;
use std::process::exit;

fn main() {
    let mut n:usize = read!();
    let mut k:usize = read!();
    let mut a:usize = 1;
    let mut b:usize = k;
    for i in 0..10000000 {
        if n==n%k {
            println!("{}",a);
            exit(0);
        }
        a+=1;
        k*=b;
    }
}

Measured memory_bytes: 2156
#include <iostream>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#include <algorithm>
#include <cstring>
#include<queue>
#include <stack>
#include<map>
#include<vector>
#include <math.h>
using namespace std;
#define ll long long


int main(){
    int h,a;
    cin>>h>>a;
    int sum=h/a;
    if(h%a){
        cout<<sum+1<<endl;
    }else{
        cout<<sum<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using ll = long long;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
const ll INF = 1LL << 60;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, k;
  cin >> n >> k;
  vl p(n);
  rep(i, n) cin >> p[i];
  ll tmp = k;
  rep(i, k) tmp += p[i];
  ll mv = tmp;
  REP(i, k, n) {
    tmp -= p[i - k];
    tmp += p[i];
    mv = max(mv, tmp);
    // cerr << mv << endl;
  }
  cout << setprecision(10) << fixed << (double)mv / 2 << endl;
  return 0;
}


Measured memory_bytes: 1792
"""
https://atcoder.jp/contests/arc085/tasks/arc085_c

"""

from collections import defaultdict
from collections import deque

def Ford_Fulkerson_Func(s,g,lines,cost):

    N = len(cost)
    ans = 0
    queue = deque([ [s,float("inf")] ])


    ed = [True] * N
    ed[s] = False

    route = [0] * N
    route[s] = -1

    while queue:

        now,flow = queue.pop()
        for nex in lines[now]:

            if ed[nex]: 
                flow = min(cost[now][nex],flow)
                route[nex] = now
                queue.append([nex,flow])
                ed[nex] = False

                if nex == g:
                    ans += flow
                    break
            
        else:
            continue
        break

    else:
        return False,ans


    t = g
    s = route[t]

    while s != -1:
        cost[s][t] -= flow
        if cost[s][t] == 0:
            lines[s].remove(t)

        if cost[t][s] == 0:
            lines[t].add(s)
        cost[t][s] += flow
        t = s
        s = route[t]

    return True,ans

def Ford_Fulkerson(s,g,lines,cost):

    ans = 0

    while True:
        fl,nans = Ford_Fulkerson_Func(s,g,lines,cost)

        if fl:
            ans += nans
            continue
        else:
            break
    
    return ans

N = int(input())
a = list(map(int,input().split()))

S = N+1
T = N+2

lis = defaultdict(set)
cost = [[0] * (N+3) for i in range(N+3)]

for i in range(N):

    if a[i] > 0:
        lis[i+1].add(T)
        cost[i+1][T] += a[i]

    elif a[i] < 0:
        lis[S].add(i+1)
        cost[S][i+1] -= a[i]

for i in range(1,N+1):

    for j in range(i*2,N+1,i):

        lis[i].add(j)
        cost[i][j] += float("inf")


m = Ford_Fulkerson(S,T,lis,cost)

ss = 0
for i in range(N):
    if a[i] > 0:
        ss += a[i]
print (ss-m)

Measured memory_bytes: 75020
#include<iostream>
#include <stdio.h>
using namespace std;

int main()
{
  double r;
  cin>>r;
  double pi=3.141592653589;
  double s=pi*r*r;
  double l=pi*r*2;
  printf("%f %f\n", s, l);
  return 0;
}


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

#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 1e9 + 7;

int main(){
    int A, B;
    cin >> A >> B;
    int x = A + B;
    if(x % 2 == 0) cout << x/2 << endl;
    else cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 256
from math import floor, gcd

def f(x, A, B):
    return floor(A * x / B) - A * floor(x / B)

def main():
    A, B, N = list(map(int, input().split(' ')))
    
    tmp = 0
    
    # mods = []
    
    a = f(min(B-1, N), A, B)
    print(a)
    
    
main()

Measured memory_bytes: 62224
K = gets.to_i
SL = gets.chomp.length
s = SL-1

M = 10**9+7

fact = [1]
1.upto(K+s) do |i|
    fact[i] = (fact[i-1]*i) % M
end

def pow(a,b)
    ret = 1
    while b>0
        ret = ret * a % M if b & 1 != 0
        a = a*a % M
        b = b >> 1
    end
    ret
end

fact_inv = [nil] * fact.size
fact_inv[-1] = pow(fact[-1], M-2)
(K+s).downto(1) do |i|
    fact_inv[i-1] = fact_inv[i] * i % M
end

comb = ->(a,b){fact[a] * fact_inv[a-b] * fact_inv[b] % M}

pow25 = [1]
pow26 = [1]
1.upto(K) do |i|
    pow25[i] = pow25[i-1]*25 % M
    pow26[i] = pow26[i-1]*26 % M
end

ans = 0
0.upto(K) do |i|
    c = comb.(s+i,i)
    ans = (ans + c*pow25[i] * pow26[K-i]) % M
end

puts ans % M

Measured memory_bytes: 63264
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>

int main() {
    int a, b;

    std::cin >> a >> b;

    if (a == 1) {
        if (b == 1) {
            std::cout << "Draw" << std::endl;
            return 0;
        } else {
            std::cout << "Alice" << std::endl;
            return 0;
        }
    }
    if (b == 1) {
        if (a == 1) {
            std::cout << "Draw" << std::endl;
            return 0;
        } else {
            std::cout << "Bob" << std::endl;
            return 0;
        }
    }

    if(a == b){
        std::cout << "Draw" << std::endl;
    } else if (a < b) {
        std::cout << "Bob" << std::endl;
    } else {
        std::cout << "Alice" << std::endl;
    }
    return 0;
}

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



int main() {
    int R, G, B, N; cin >> R >> G >> B >> N;
    int ans = 0;
    rep(i, 3000) rep(j, 3000)
        if ((N - (i*R+j*G)) % B == 0 && (N - (i*R+j*G)) >= 0) ans++;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
signed main(){
  int a,b,c,d[100000],j=0,e=0;
  cin>>a>>b>>c;
  for(int i=1;i<c+1;i++){
    if(c%i==0){
      d[j]=i;
      j++;
    }
  }
  for(int i=a;i<=b;i++){
    for(int j=0;j<=b;j++){
      if(d[j]==i){
	e++;
      }
    }
  }
  cout<<e<<"\n";
  return(0);
}



Measured memory_bytes: 3104
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <cmath>
#include <climits>
#include <unordered_map>

using namespace std;

#define size_t int

int main(int argc, char const *argv[]) {
  char N[5];
  scanf("%s", N);
  int r = 0;
  for (size_t i = 0; i < 4; i++) {
    if (N[i] == '2') {
      r++;
    }
  }
  printf("%d\n", r);
}


Measured memory_bytes: 256
N,K = (int(x) for x in input().split())

h_arr = []
for _ in range(N):
    h_arr.append(int(input()))

h_arr.sort()
first_hd = h_arr[K-1]-h_arr[0]
min_hd = first_hd
for i in range(K-1, N):
    current_hd = h_arr[i] - h_arr[i-K+1]
    min_hd = min(min_hd, current_hd)

print(min_hd)


Measured memory_bytes: 7384
#include<cstdio>
#include<iostream>
#include<cstdlib>
using namespace std;
long long cur;
int w;
long long p[18],po[18];
int bs(int x)
{
	int l=-1,r=10;
	if(x==1)l=0;
	while(l+1<r)
	{
		int m=(l+r)/2;
		printf("? %lld\n",(cur*10LL+m)*po[11-x]+p[11-x]);
		char op;
		cin>>op;
		if(op=='N')l=m;else r=m;
	}
	return l;
}
int main()
{
	po[0]=1LL;
	for(int i=1;i<=17;i++)p[i]=p[i-1]*10LL+9,po[i]=po[i-1]*10LL;
	w=1;
	while(1)
	{
		if(w>10)
		{
			long long t=cur;
			long long cj=1LL;
			while(t%10==0)
			{
				t/=10LL;
				cj*=10LL;
			}
			t/=10LL;
			cj*=10LL;
			char op;
			do
			{
				t=t*10LL+9;
				cj/=10LL;
				printf("? %lld\n",t);
				cin>>op;
			}
			while(op=='N');
			printf("! %lld",cur/cj);
			return 0;
		}
		int k=bs(w);
		cur=cur*10LL+k+1;
		w++;
	}
	return 0;
}

Measured memory_bytes: 596
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 dyominov
 */
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);
        BAlgae solver = new BAlgae();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAlgae {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int r = in.nextInt();
            int d = in.nextInt();
            int x = in.nextInt();
            for (int i = 0; i < 10; i++) {
                x = r * x - d;
                out.println(x);
            }
        }

    }

    static class InputReader implements AutoCloseable {
        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 int nextInt() {
            return Integer.parseInt(next());
        }

        public void close() {
        }

    }
}



Measured memory_bytes: 20436
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long w=sc.nextLong(),h=sc.nextLong();
		int x=sc.nextInt(),y=sc.nextInt();
		sc.close();
		System.out.printf("%.10f\n",(double)w*(double)h/2);
		if((double)x==(double)w/2 && (double)y==(double)h/2) System.out.println("1");
		else System.out.println("0");
	}
}

Measured memory_bytes: 21844
#include <stdio.h>

int main() {
  struct senshu{
    int num;
    double time;
  } s[8], third[3], temp;

  int i, j, k;
  for(i = 0; i < 3; i++) {
    for(j = 0; j < 8; j++) {
      scanf("%d %lf", &s[j].num, &s[j].time);
    }
    for(j = 0; j < 8; j++) {
      for(k = 1; k < 8-j; k++) {
	if(s[k-1].time > s[k].time) {
	  temp = s[k-1];
	  s[k-1] = s[k];
	  s[k] = temp;
	}
      }
    }
    printf("%d %.2f\n", s[0].num, s[0].time);
    printf("%d %.2f\n", s[1].num, s[1].time);
    third[i] = s[2];
  }
  for(j = 0; j < 3; j++) {
    for(k = 1; k < 3-j; k++) {
      if(third[k-1].time > third[k].time) {
	temp = third[k-1];
	third[k-1] = third[k];
	third[k] = temp;
      }
    }
  }
  printf("%d %.2f\n", third[0].num, third[0].time);
  printf("%d %.2f\n", third[1].num, third[1].time);
  return 0;
}

Measured memory_bytes: 0