akhauriyash/Code-Regression huggingface dataset:
#!/bin/env python3

IS = lambda: int(input())
IA = lambda: [int(x) for x in input().split()]

N = IS()
B = IA()

def f(b, n):
    ans = []
    while b:
        for i in range(len(b), 0, -1):
            j = i - 1
            if i == b[j]:
                ans.append(i)
                b = b[:j] + b[j+1:]
                break
        else:
            return None
    return list(reversed(ans))

ans = f(B, N)
if ans:
    print(*ans, sep="\n")
else:
    print(-1)


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

int main(){
  int P,Q,R;
  cin>>P>>Q>>R;
  if(P+Q<=P+R && P+Q<=Q+R){
    cout<<P+Q<<endl;
    }else if (P+R<=P+Q && P+R<=Q+R){
    cout<<P+R<<endl;
  }else{
    cout<<Q+R<<endl;
  }
}


Measured memory_bytes: 256
def calc(l):
    tmp = 0
    #print(l)
    for Q in Qs:
        if l[Q[1] - 1] - l[Q[0] - 1] == Q[2]:
            tmp += Q[3]
    return tmp


def solve(l, d):
    global n
    global ans
    if d == n:
        ans = max(ans, calc(l))
        return
    for i in range(l[-1], m + 1):
        l_ = l + [i]
        solve(l_, d + 1)


n, m, q = map(int, input().split())
Qs = [list(map(int, input().split())) for _ in range(q)]
ans = 0
for i in range(1, m + 1):
    solve([i], 1)
print(ans)


Measured memory_bytes: 9212
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>
#include <stack>
#include <bitset>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

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(a>b){a=b;return 1;}return 0;}

map<char, int> mp;

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

  int n;
  string s;
  cin >> s;

  REP(i, s.size()){
    mp[s[i]]++;
  }

  for(auto &e: mp){
    if(e.second % 2 == 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    int x,i,n,m,a,b,c;
    while(~scanf("%d %d",&n,&m))
    {
        a=n+m;
        b=n*m;
        c=n-m;
        if(a>=b&&a>=c)
        {
            printf("%d\n",a);
        }
        else if(b>=a&&b>=c)
        {
            printf("%d\n",b);
        }
        else if(c>=b&&c>=a)
        {
            printf("%d\n",c);
        }
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int h, w, d;
    cin >> h >> w >> d;
    vector<P> a(h * w);
    rep(i, h)rep(j, w){
        int A;
        cin >> A;
        A--;
        a[A] = make_pair(i, j);
    }

    vector<int> cost(h * w, 0);
    for(int i = d; i <= h * w; i++){
        cost[i] = cost[i - d];
        cost[i] += abs(a[i].first - a[i - d].first) + abs(a[i].second - a[i - d].second);
    }

    int q;
    cin >> q;
    rep(i, q){
        int l, r;
        cin >> l >> r;
        l--;
        r--;
        cout << cost[r] - cost[l] << endl;
    }
}

Measured memory_bytes: 2176
#include <stdio.h>
#include <string.h>
int main(void) {
    int ioi,joi,i,j;
    char str[10001];
    while (scanf("%s\n",str)!=EOF) {
        ioi=0,joi=0;
        for (i=0; i<strlen(str)-2; i++) {
            if (str[i]=='J'&&str[i+1]=='O'&&str[i+2]=='I') joi++;
            if (str[i]=='I'&&str[i+1]=='O'&&str[i+2]=='I') ioi++;
        }
        printf("%d\n%d\n",joi,ioi);
    }
    return 0;
}

Measured memory_bytes: 556
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
#define inf 1e9


int main(){
	int n;
	cin>>n;
	vector<ll> a(n),b;
	vector<bool> match(n,false);
	for(int i=0;i<n;i++)cin>>a[i];
	b = a;
	sort(b.begin(),b.end());
	ll cnt =0;
	for(int i=0;i<n;i++){
		if(a[i] == b[i]){
		    match[i] = true;
		}
		else{
		    cnt++;
		}
	}
	if(cnt==0){
		cout<<0<<endl;
		return 0;
	}
	int q;
	cin>>q;
	for(int i=0;i<q;i++){
		int x,y;
		cin>>x>>y;
		x--,y--;
		swap(a[x],a[y]);
		if(match[x]){
			if(a[x] != b[x] ) {
			    cnt++;
			    match[x] = false;
			}
		}else{
			if(a[x] == b[x] ) {
			    cnt--;
			    match[x] = true;
			}
		}
		if(match[y]){
			if(a[y] != b[y] ){
			    cnt++;
			    match[y] = false;
			}
		}else{
			if(a[y] == b[y] ) {
			    cnt--;
			    match[y] = true;
			}
		}
		if(cnt==0){
		    cout<<i+1<<endl;
		    return 0;
		}
	}
	cout<<-1<<endl;

	return 0;
}



Measured memory_bytes: 7616
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define VV vector
#define pb push_back
#define bitc  __builtin_popcountl
#define m_p make_pair
#define inf 1000000000000000000ll
#define MAXN 1000001
#define eps 0.0000000001
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<class T>//usage rand<long long>()
T rand() {
    return uniform_int_distribution<T>()(rng);
}

// string to integer stuuu()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();

//////////////

#define S second
#define F first
#define int long long  
///////

signed main()
{
	fastio;
	#ifdef ANIKET_GOYAL
		freopen("inputf.in","r",stdin);
		freopen("outputf.in","w",stdout);
	#endif
	int n;
	cin>>n;
	int a[n][2];
	set<pair<int,int>> s;
	for(int i=0;i<n;++i)
	{
		cin>>a[i][0]>>a[i][1];
		s.insert({a[i][0],a[i][1]});
	}
	int ans=n;
	for(int i=0;i<n;++i)
	{
		for(int j=0;j<n;++j)
		{
			int p=a[i][0]-a[j][0];
			int q=a[i][1]-a[j][1];
			if(p==0&&q==0)
				continue;
			int c=0;
			for(int k=0;k<n;++k)
			{
				if(s.find({a[k][0]-p,a[k][1]-q})!=s.end())
				{
					++c;
				}
			}
			ans=min(ans,n-c);
		}
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T&v)
{fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0; return gcd(a, b, x, y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 500;
int h, w, q[N][N];
vi a, b, c, d;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> h >> w;
  FOR(i, 0, h)FOR(j, 0, w) cin >> q[i][j];
  FOR(i, 0, h){
    if(i%2==0){
      FOR(j, 0, w-1) if(q[i][j]%2){
        a.pb(i);
        b.pb(j);
        c.pb(i);
        d.pb(j+1);
        q[i][j+1]++;
      };
      if(i<h-1 && q[i][w-1]%2){
        a.pb(i);
        b.pb(w-1);
        c.pb(i+1);
        d.pb(w-1);
        q[i+1][w-1]++;
      };
    }else{
      FORR(j, w-1, 1) if(q[i][j]%2){
        a.pb(i);
        b.pb(j);
        c.pb(i);
        d.pb(j-1);
        q[i][j-1]++;
      };
      if(i<h-1 && q[i][0]%2){
        a.pb(i);
        b.pb(0);
        c.pb(i+1);
        d.pb(0);
        q[i+1][0]++;
      };
    }
  }
  cout << sz(a) << endl;
  FOR(i, 0, sz(a)) cout << a[i]+1 << " " << b[i]+1 << " " << c[i]+1 << " " << d[i]+1 << endl;
  return 0;
}

Measured memory_bytes: 5220
program prob4
    implicit none
    integer, allocatable::a(:), c(:)
    integer::n, i, j, cnt
    read(*,*) n
    allocate(a(n),c(n))
    read(*,*) a
    c = 0
    cnt = 0
    do i = 1, n
        if(a(i) > n) then
            cnt = cnt + 1
        else
            c(a(i)) = c(a(i)) + 1
        end if
    end do
    do i = 1, n
        if(c(i) >= i) then
            cnt = cnt + c(i) - i
        else if(c(i) > 0) then
            cnt = cnt + c(i)
        end if
    end do
    write(*,*) cnt
    deallocate(a,c)
    stop
end program

Measured memory_bytes: 3884
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
vector<int>adj[100001];
int visited[100001];

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    int n=s.size();
    if(s[2]==s[3]&&s[4]==s[5]){
        cout<<"Yes\n";
    }
    else cout<<"No\n";
    
}


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

int main(){
int n,m; cin >> n >> m; int t=0;
vector<vector<int>> vec(m);

for(int i=0; i<m; i++){
    int k; cin >> k;
    vec[i].resize(k);
    for(int j=0; j<k; j++){
        cin >> vec[i][j];
        --vec[i][j];
    }
}

vector<int> p(m);
while(t<m){
    cin >> p[t++];
}

int ans=0;
for(int i=0; i<(1<<n); i++){
     bool ok = true;
     for(int j=0; j<m; j++){
         int c=0;
         for(int id : vec[j]){
             if((i>>id) & 1){
                 ++c;
             }
         }
         c %= 2;
         if(c != p[j]){
             ok = false;
         }
     }
     if(ok){
         ++ans;
     }
}

cout << ans << endl;

return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dd;
//#define i_7 (ll)(1E9+7)
#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E17;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////////////////
#define N 600004

ll kai[N];
ll kai2[N];
ll po(ll i,ll p){
    if(p==0)return 1;
    else if(p==1)return mod(i);
    else if(p%2==0)return po(mod(mod(i)*mod(i)),p/2);
    else  return mod(mod(i)*po(i,p-1));
}
void calc(){
    kai[0]=1;
    kai2[0]=1;
    rep(i,1,N-1){
        kai[i]=mod(kai[i-1]*i);
    }
    kai2[N-1]=po(kai[N-1],i_5);
    for(ll i=N-2;i>=0;i--){
        kai2[i]=mod(kai2[i+1]*(i+1));
    }
}
ll comb(ll n,ll k){
    if(n<k)return 0;
    else if(n==0)return 1;
    else return mod(mod(kai[n]*kai2[n-k])*kai2[k]);
}
ll bunbo(ll n){
    return po(n,i_5);
}

int main(){fastio;
    calc();
    ll n,a,b,k;cin>>n>>a>>b>>k;
    ll ans=0;
    rep(i,0,n){
        ll j=(k-a*i)/b;
        if(0<=j&&j<=n&&a*i+b*j==k){
            Add(ans,comb(n,i)*comb(n,j));
        }
    }
    cout<<ans<<endl;
    
    return 0;
}




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

typedef vector <long long> vi;
typedef vector <vi> vvi;
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define ll long long

int main(void)
{
    ll n;
    cin >> n;
    ll h[n];
    for (int i = 0; i < n; i++)
        cin >> h[i];
    ll dp[n];

    dp[0] = 0;
    dp[1] = llabs(h[0] - h[1]);

    for (int i = 2; i < n; i++)
        dp[i] = min(dp[i - 1] + llabs(h[i] - h[i - 1]), dp[i - 2] + llabs(h[i] - h[i - 2]));
    
    cout << dp[n - 1] << "\n";
}


Measured memory_bytes: 1792
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::*;
#[allow(dead_code)]
fn getline() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    return ret;
}
fn get_word() -> String {
    let mut stdin = std::io::stdin();
    let mut u8b: [u8; 1] = [0];
    loop {
        let mut buf: Vec<u8> = Vec::with_capacity(16);
        loop {
            let res = stdin.read(&mut u8b);
            if res.is_err() || res.ok().unwrap() == 0 || u8b[0] <= ' ' as u8 {
                break;
            } else {
                buf.push(u8b[0]);
            }
        }
        if buf.len() >= 1 {
            let ret = std::string::String::from_utf8(buf).unwrap();
            return ret;
        }
    }
}
fn parse<T: std::str::FromStr>(s: &str) -> T { s.parse::<T>().ok().unwrap() }

#[allow(dead_code)]
fn get<T: std::str::FromStr>() -> T { parse(&get_word()) }

#[allow(dead_code)]
macro_rules! d {
    ($e:expr) => {println!("{} = {:?}", stringify!($e), $e)}
}

fn count_del(g: &Vec<Vec<usize>>, r: usize, i: usize, j: usize) -> usize {
    let mut mark = vec![false; g.len()];
    let mut from = vec![i, j];
    let mut to = Vec::new();

    mark[i] = true;
    mark[j] = true;

    for _ in 0..r {
        for v in from {
            for w in &g[v] {
                let w = w.clone();
                if !mark[w] {
                    mark[w] = true;
                    to.push(w);
                }
            }
        }
        from = to;
        to = Vec::new();
    }

    mark.into_iter().map(|b| if b {0} else {1}).fold(0, std::ops::Add::add)
}

fn main() {
    let n: usize = get();
    let k: usize = get();
    let mut g = vec![Vec::new(); n];
    let mut e = Vec::new();
    
    for _ in 0..n-1 {
        let a = get::<usize>() - 1;
        let b = get::<usize>() - 1;
        g[a].push(b);
        g[b].push(a);
        e.push((a, b));
    }

    let ans = if k%2 == 0 {
        (0..n).map(|i| count_del(&g, k/2, i, i)).min().unwrap()
    } else {
        e.into_iter().map(|(i, j)| count_del(&g, k/2, i, j)).min().unwrap()
    };

    println!("{}", ans);
}


Measured memory_bytes: 636
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)

	var x, y int
	if sc.Scan() {
		v := strings.Split(sc.Text(), " ")
		x, _ = strconv.Atoi(v[0])
		y, _ = strconv.Atoi(v[1])
	}

	fmt.Printf("%d\n", x+y/2)
}


Measured memory_bytes: 640
#include <stdio.h>

int main(void)
{
 int n, q, i, left, right, mid;
 int a[100000];
 int b[50000];
 int k = 0;
 
 scanf("%d", &n);
 
 for(i = 0; i < n; i++)
  scanf("%d", &a[i]);

 scanf("%d", &q);

 for(i = 0; i < q; i++)
  scanf("%d", &b[i]);

 right = n;
 left = 0;

for(i = 0; i < q; i++) 
{
 while(left < right)
 {
  mid = (left + right) / 2;

   if(a[mid] == b[i])
{
    k++;
    break;
}
   else if(a[mid] > b[i])
{
    right = mid;
}
   else
{
    left = mid + 1;
}

 }

 right = n;
 left = 0;

}



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


 return 0;

}


 
 


Measured memory_bytes: 2340
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
        return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

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

        cout << n / (a + b) * a + min(n % (a + b), a) << endl;

        return 0;
}


Measured memory_bytes: 256
#C
N = map(int, input().split())
S = list(str(input()))


if len(S)==1:
    print(1)
else:
    value=1
    tmp = S[0]
    for i in S[1:]:
        if i==tmp:
            continue
        else:
            tmp=i
            value+=1
    print(value)

Measured memory_bytes: 4792
#include <bits/stdc++.h>
 
using namespace std;
 
template <typename A, typename B>
string to_string(pair<A, B> p);
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#endif


typedef long long ll; 
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef long double ld;
const ll mod = 998244353;
 
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define S second
#define F first
#define M_PI            3.14159265358979323846

ll sqr(ll n) {
	return n*n;
}

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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

bool prime(int n) {
	int i = 2;
	while (i*i <= n) {
		if (n % i == 0) return false;
		i++;
	}
	return true;
}
ll binpow(ll a, ll n) {
	if (n == 0)
		return 1;
	if (n % 2 != 0) return binpow(a, n-1)*a; else {
		ll b = binpow(a, n/2);
		return b*b;
	}
}

void solve() {
	int r;
	cin >> r;
	cout << 2*M_PI*r << endl;
}
 
int main() {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}

	return 0;
}

Measured memory_bytes: 3772
#include<bits/stdc++.h>
#define pb push_back
#define _x(i) v1[p[i].x]
#define _y(i) v2[p[i].y]

using namespace std;
typedef long long ll;

const int N=100005,M=4000005,L=8888888,K=16666666;

int n,a,b,dis;
ll ans;
int v1[N],m1,v2[N],m2,va[N];
struct node{
	int x,y,id;
	inline bool friend operator<(const node&a,const node&b){return a.x<b.x||a.x==b.x&&a.y<b.y;}
}p[N];
inline int abs_(int x){return x<0?-x:x;}

map<int,int>R1,R2;
int ls[M],rs[M],sz[M],id[M],ndc;
int num,h[L],nxt[K],to[K],ce;
inline void addedge(int u,int v){nxt[++ce]=h[u],to[ce]=v,h[u]=ce;}
inline int copynode(int x){
	int y=++ndc;
	ls[y]=ls[x],rs[y]=rs[x],sz[y]=sz[x];
	id[y]=++num;
	if(x)addedge(num,id[x]);
	return y;
}
void insert(int&x,int l,int r,int p,int u){
	x=copynode(x);
	sz[x]++;addedge(id[x],u);
	if(l==r)return;
	int mid=(l+r)>>1;
	if(p<=mid)insert(ls[x],l,mid,p,u);else insert(rs[x],mid+1,r,p,u);
}
int link(int x,int l,int r,int s,int t,int u){
	if(!x||s>t)return 0;
	if(l==s&&r==t){addedge(u,id[x]);return sz[x];}
	int mid=(l+r)>>1;
	if(t<=mid)return link(ls[x],l,mid,s,t,u);
	if(s>mid)return link(rs[x],mid+1,r,s,t,u);
	return link(ls[x],l,mid,s,mid,u)+link(rs[x],mid+1,r,mid+1,t,u);
}

bool vi[L];
void dfs(int x){
	if(vi[x])return;
	vi[x]=true;
	if(x<=n)ans+=va[x];
	for(int i=h[x];i;i=nxt[i])dfs(to[i]);
}

int main(){
	scanf("%d%d%d",&n,&a,&b);
	for(int i=1;i<=n;i++)scanf("%d%d",&p[i].x,&p[i].y),v1[++m1]=p[i].x,v2[++m2]=p[i].y;
	dis=abs_(p[a].x-p[b].x)+abs_(p[a].y-p[b].y);
	sort(v1+1,v1+m1+1);m1=unique(v1+1,v1+m1+1)-v1-1;
	sort(v2+1,v2+m2+1);m2=unique(v2+1,v2+m2+1)-v2-1;
	for(int i=1;i<=n;i++){
		p[i].x=lower_bound(v1+1,v1+m1+1,p[i].x)-v1;
		p[i].y=lower_bound(v2+1,v2+m2+1,p[i].y)-v2;
		p[i].id=i;
	}
	sort(p+1,p+n+1);num=n;
	ndc=0;R1.clear();R2.clear();
	for(int i=1;i<=n;i++){
		int X=v1[p[i].x],Y=v2[p[i].y];
		va[i]+=link(R1[X+Y-dis],1,m2,1,p[i].y,i);
		va[i]+=link(R2[X-Y-dis],1,m2,p[i].y+1,m2,i);
		insert(R1[X+Y],1,m2,p[i].y,i);
		insert(R2[X-Y],1,m2,p[i].y,i);
	}
	ndc=0;R1.clear();R2.clear();
	for(int i=n;i>=1;i--){
		int X=v1[p[i].x],Y=v2[p[i].y];
		va[i]+=link(R1[Y-X-dis],1,m2,1,p[i].y,i);
		va[i]+=link(R2[-Y-X-dis],1,m2,p[i].y+1,m2,i);
		insert(R1[Y-X],1,m2,p[i].y,i);
		insert(R2[-Y-X],1,m2,p[i].y,i);
	}
	for(int i=1;i<=n;i++)if(p[i].id==a||p[i].id==b)dfs(i);
	printf("%lld\n",ans/2);
	return 0;
}

Measured memory_bytes: 201344
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include<math.h>
#include<numeric>
#include<iomanip>
#define rep(i, n) rep2(i,0,n)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define PI acos(-1);
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
//scanf("%d", &a); '\n';

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	if (n!=m)cout << "No";
	else cout << "Yes";
}



Measured memory_bytes: 888
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include<algorithm>
#include<sstream>
#include<iomanip>
#include<deque>
#include<list>


using namespace std;

typedef long long ll;

typedef pair<int, int> pii;

const ll MOD_CONST = 1000000007;
const ll BIG_NUM = 1000000000000000000;
const int BIG_INT = 1000000000;



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

	vector<ll> v(n);
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}

	sort(v.begin(), v.end(),greater<ll>());

	ll sum = 0;
	for (int i = 0;i < a;i++) {
		sum += v[i];
	}

	double ave = sum / (1.0*a);

	cout << setprecision(22) << ave << endl;

	int cnt = 0;
	for (int i = a;i < n;i++) {
		if (v[i] == v[i - 1]) {
			cnt++;
		}
		else {
			break;
		}
	}


	/*
	vector<ll> facto(n+1);
	facto[0] = 1;
	for (int i = 1; i <= n;i++) {
		facto[i] = facto[i - 1] * i;
		cout << facto[i] << endl;
	}
	*/


	if (v[0] == v[a - 1]) {
		
		ll ans = 0;
		cnt += a;
		//cout << cnt << endl;
		for (int i = a; i <= min(b,cnt);i++) {
			map<ll,int> m;
			for (int j = 0; j < i;j++) {
				int num = cnt-j;
				//cout << num << " " << i << endl;
				for (int k = 2; k*k <= num;k++) {
					while (num %k == 0) {
						m[k]++;
						num /= k;
					}

					
				}
				if (num != 1) {
					m[num]++;
				}
				if (j > 0) {
					num = j + 1;
					for (int k = 2; k*k <= num;k++) {
						while (num %k == 0) {
							m[k]--;
							num /= k;
						}


					}
					if (num != 1) {
						m[num]--;
					}
				}
			}
			ll tmp = 1;

			for (auto it = m.begin();it != m.end();it++) {
				for (int j = 0; j < it->second;j++) {
					tmp *= it->first;
					
				}

				

				
				//cout << it->first << " " << it->second << endl;
			}
			//cout << endl;
			ans += tmp;
			//cout << tmp << endl;
		}

		cout << ans << endl;
	}
	else {

		ll ans = 1;
		int c = 0;
		
		for (int i = a;i > 0;i--) {
			if (v[i] == v[i - 1]) {
				c++;
			}
		}
		cnt += c;
		map<ll, int> m;
		for (int j = 0; j < c;j++) {
			int num = cnt - j;
			//cout << num << " " << i << endl;
			for (int k = 2; k*k <= num;k++) {
				while (num %k == 0) {
					m[k]++;
					num /= k;
				}


			}
			if (num != 1) {
				m[num]++;
			}
			if (j > 0) {
				num = j + 1;
				for (int k = 2; k*k <= num;k++) {
					while (num %k == 0) {
						m[k]--;
						num /= k;
					}


				}
				if (num != 1) {
					m[num]--;
				}
			}
		}
		ll tmp = 1;

		for (auto it = m.begin();it != m.end();it++) {
			for (int j = 0; j < it->second;j++) {
				tmp *= it->first;

			}
		}
		ans = tmp;
		
		
		cout << ans << endl;
	}

}





Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int x, y;
		while(true) {
			x = sc.nextInt();
			y = sc.nextInt();
			if(x > y) {
				System.out.println(+y + " " + x);
			}
			if(x == 0 && y == 0) {
				break;

			}

			if(x < y) {
				System.out.println(+x + " " + y);
			}
			if(x == y) {
				System.out.println(+x + " " + y);
			}
		}
	}
}



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

#define rep(i,n) for(ll i=0;i<(n);i++)
typedef long long ll;

int N;
int A[20], B[20], C[20];
int ans;

int main() {
    cin >> N;
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> B[i];
    rep(i, N-1) cin >> C[i];

    ans = B[A[0]-1];
    for (int i = 1; i < N; i++) {
	ans += B[A[i]-1];
	if (A[i] == A[i-1]+1) ans += C[A[i-1]-1];
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Numerics;

namespace AtCoderWorkspace
{
    public class Solver
    {
        public void Solve()
        {
            var cin = new Scanner();
            var n = cin.nextInt();
            var a = cin.ArrayLong(n);


            var set = new HashSet<long>();
            for (int i = 0; i < n; i++)
            {
                set.Add(a[i]);
            }

           
            Console.WriteLine(set.Count() == n? "YES":"NO");

        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public int[] DPArrayInt(int N, int ex)
        {
            int[] Array = new int[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextInt();
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public long[] DPArrayLong(int N, int ex)
        {
            long[] Array = new long[N + ex];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextLong();
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }

    class Program
    {
        static void Main(string[] s) => new Solver().Solve();
    }
}


Measured memory_bytes: 46284
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
	string S; cin >> S;
	if (S == "RRR") cout << 3 << endl;
	else if (S == "SRR" || S == "RRS") cout << 2 << endl;
	else if (S == "SSS") cout << 0 << endl;
	else cout << 1 << endl;
}


Measured memory_bytes: 3624
/*************************************************************************
  >         File: D.cc
  >       Author: Riho.Yoshioka
  >         Mail: riho.yoshioka@yandex.com
  > Created Time: Sun 28 Aug 2016 08:15:15 PM CST
*************************************************************************/
#include <bits/stdc++.h>
using LL = long long;

void OK(LL base) {
  std::cout << base << std::endl;
  exit(0);
}

int main() {
  std::ios::sync_with_stdio(0);
  LL n, s;
  std::cin >> n >> s;
  if (s == n) {
    OK(n + 1);
  }
  static const int K = 1e6;
  for (int base = 2; base < K; base++) {
    LL tmp = n, sum = 0;
    while (tmp) {
      sum += tmp % base;
      tmp /= base;
    }
    if (sum == s) {
      OK(base);
    }
  }
  LL answer = LLONG_MAX;
  for (int coef = K - 1; coef >= 1; coef--) {
    LL left = s - coef;
    if (left < 0) continue;
    if ((n - left) % coef == 0) {
      LL base = (n - left) / coef;
      if (left < base && coef < base) {
        answer = std::min(answer, base);
      }
    }
  }
  std::cerr << "answer: " << answer << std::endl;
  if (answer != LLONG_MAX) OK(answer);
  std::cout << -1 << std::endl;
  return 0;
}


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

char s[200][201];
int d1[200][200], d2[200][200];
bool b[200][200];
int dx[]{ 1,-1,0,0 }, dy[]{ 0,0,1,-1 };
int h, w;

void dfs(int x, int y) {
	b[x][y] = true;
	rep(i, 4) {
		int nx = x + dx[i], ny = y + dy[i];
		if (0 <= nx&&nx < h && 0 <= ny&&ny < w && !b[nx][ny] && d2[nx][ny] < d1[nx][ny])
			dfs(nx, ny);
	}
}
int main() { 
	scanf("%d%d", &h, &w);
	memset(d1, 0x3f, sizeof(d1));
	memset(d2, 0x3f, sizeof(d2));
	queue<P>que;
	int sx, sy, gx, gy;
	rep(i, h) {
		scanf("%s", s[i]);
		rep(j, w) {
			if (s[i][j] == '$') {
				d1[i][j] = 0; que.push(P(i, j));
			}
			if (s[i][j] == '@')sx = i, sy = j;
			if (s[i][j] == '%')gx = i, gy = j;
		}
	}
	while (!que.empty()) {
		P p = que.front(); que.pop();
		rep(i, 4) {
			int nx = p.first + dx[i], ny = p.second + dy[i];
			if (0 <= nx&&nx < h && 0 <= ny&&ny < w&&s[nx][ny] != '#'&&d1[nx][ny] == INF) {
				d1[nx][ny] = d1[p.first][p.second] + 1;
				que.push(P(nx, ny));
			}
		}
	}
	que.push(P(sx, sy));
	d2[sx][sy] = 0;
	while (!que.empty()) {
		P p = que.front(); que.pop();
		rep(i, 4) {
			int nx = p.first + dx[i], ny = p.second + dy[i];
			if (0 <= nx&&nx < h && 0 <= ny&&ny < w&&s[nx][ny] != '#'&&d2[nx][ny] == INF) {
				d2[nx][ny] = d2[p.first][p.second] + 1;
				que.push(P(nx, ny));
			}
		}
	}
	dfs(sx, sy);
	puts(b[gx][gy] ? "Yes" : "No");
}

Measured memory_bytes: 3744
#include <iostream>

using namespace std;

int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	if(a > b)
	{
		b = a+b;
		a = b-a;
		b = b-a;
	}
	while(b%a!=0)
	{
		b=b%a;
		b = a+b;
		a = b-a;
		b = b-a;
	}
	b = 2;
	while(c!=1)
	{
		while(a%b!=0)
		{
			b++;
		}
		b++;
		c--;
	}
	cout << a/(b-1) << endl;
  	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define forr(i,a,n)	for(long long int i=a; i<n; i++)
#define loop(i,a,n)	for(long long int i=a; i>=n; i--)
 
int main() 
{	
	ios_base :: sync_with_stdio(false),cin.tie(NULL),cout.tie(0);

	int a,b;
	cin>>a>>b;
	cout<<(ceil((double (a))/b));
	
	return 0;	
}

Measured memory_bytes: 256
N, M = map(int, input().split())

if abs(N-M)>=2:
    print(0)
else:
    mod = 10**9 + 7
    if abs(N-M)==1:
        w = 1
    else:
        w = 2
    nf = 1
    mf = 1
    
    while N > 1:
        nf *= N
        nf %= mod
        N -= 1

    while M > 1:
        mf *= M
        mf %= mod
        M -= 1
    
    ans = nf * mf % mod
    ans = ans * w % mod

    print(ans)

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

#define mem(a,n) memset(a,n,sizeof(a))
#define memc(a,b) memcpy(a,b,sizeof(b))
#define rep(i,a,n) for(int i=a;i<n;i++) ///[a,n)
#define pb push_back
#define mkp make_pair
#define mkt make_tuple
#define IO ios::sync_with_stdio(false)
#define fre freopen("in.txt","r",stdin)
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
typedef long long ll;
typedef unsigned long long ull;
const double PI=acos(-1.0);
const double E=2.718281828459045;
const double eps=1e-8;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int MOD=1e3;
const int N=1e2+5;
const ll maxn=2e5+5;
const int dir[4][2]= {-1,0,1,0,0,-1,0,1};
int n;
vector<tuple<int,int,int> >vec;
set<int>st;

void solve()
{
    int ans=0;
    for(auto v: vec)
    {
        int x,y,c;
        tie(x,y,c)=v;
        if(c == 0)
        {
            st.insert(y);
        }
        else
        {
            auto it = st.lower_bound(y);
            if(it != st.begin())
            {
                //cout<<(*it);
                st.erase(--it);
                ans++;
                //cout<<"  ans="<<ans<<endl;
            }
        }
    }
    cout<<ans<<endl;
}
int main()
{
    IO;
    cin>>n;
    rep(i,0,n)
    {
        int a,b;
        cin>>a>>b;
        vec.pb(mkt(a,b,0));
    }
    rep(i,0,n)
    {
        int c,d;
        cin>>c>>d;
        vec.pb(mkt(c,d,1));
    }
    sort(vec.begin(),vec.end());
    for(int i=0;i<vec.size();i++)
    {
        int x,y,c;
        tie(x,y,c)=vec[i];
        //cout<<x<<" "<<y<<" "<<c<<endl; 
    }
    solve();
    return 0;
}




Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
class Program{
  static void Main(string[] args){
    //SelectしたままだとIEnumerable型なので、indexは使えない。
    var vals = Console.ReadLine().Split().Select(x => int.Parse(x)).ToList();
    //または、以下。
    //var vals2 = Console.ReadLine().Split(); //これはSystem.Collections.Generic.List
    //var N = int.Parse(vals[0]);
    var N=vals[0];
    var A=vals[1];
    var B=vals[2];
    int ans=0;
    for(int i=0;i<=N;i++){
      string i_str=i.ToString();
      IEnumerable<int> i_int=i_str.Select(x=>int.Parse(x.ToString())); //Parse(x)だとcharなのでできない
	  //以下はできない。Convert.ToInt32()はcharも変換するが、Unicodeの(char)49='1'なので49を返す。
      //IEnumerable<int> i_int=i_str.Select(x=>Convert.ToInt32(x));
      if(i_int.Sum()>=A && i_int.Sum()<=B){
      	ans+=i;
      }
    }
	Console.WriteLine(ans);
  }
}

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

int main()
{
    long long a,b,c,d;
    cin >> a >> b >> c >> d;

    long long ac, ad, bc, bd, mx;

    ac = a*c; ad = a*d;
    bc = b*c; bd = b*d;

    mx = ac;
    if(mx < ad) mx = ad;
    if(mx < bc) mx = bc;
    if(mx < bd) mx = bd;

    printf("%lld\n",mx);

    return 0;
}


Measured memory_bytes: 3756
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using namespace std;

const int INF = 1e9 + 1;

int main(){
    int N;
    cin >> N;
    vector<double> t(N);
    vector<double> v(N);

    rep(i, N) {
        cin >> t[i];
    }

    rep(i, N) {
        cin >> v[i];
    }

    int T = 0;
    rep(i, N){
        T += t[i];
    }

    vector<double> maxV(2*T+1, (double)INF);

    int nowT = 0;
    rep(i, N){
        rep(ti, t[i]){
            int t1 = nowT + ti*2;
            int t2 = nowT + ti*2 + 1;
            maxV[t1] = min(maxV[t1], v[i]);
            maxV[t2] = min(maxV[t2], v[i]);
        }
        nowT += t[i]*2;
        maxV[nowT] = min(maxV[nowT], v[i]);
    }

    maxV[0] = maxV[T*2] = 0.0;

    rep(ti, 2*T+1) {
        maxV[ti+1] = min(maxV[ti+1], maxV[ti] + 0.5);
    }

    rep(ti, 2*T) {
        maxV[2*T-ti -1] = min(maxV[2*T-ti-1], maxV[2*T-ti] + 0.5);
    }

    double ans = 0.0;
    rep(i, 2*T+1) {
        ans += (maxV[i] + maxV[i+1]) * 0.5/2.0;
    }

    printf("%.4f\n", ans);
}

Measured memory_bytes: 512
N=int(input())
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))

import itertools
a=0
b=0
seq=range(1,N+1,1)
L=list(itertools.permutations(seq))
for i,l in enumerate(L):
  if P==l:
    a=i
  if Q==l:
    b=i
print(abs(a-b))

Measured memory_bytes: 8052
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
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; }
const int INF = 1 << 30;
int main(){
    int n,k,c;
    string s;
    cin >> n >> k >> c >> s;
    vector<int> front(n), back(n); //front[i]: 0-iまでで最大何日働けるか
    int next = -1;
    int now = 0;
    rep(i,n){
        if(s[i]=='o') {
            if(i>=next){
                next = i+c+1;
                now++;
            }
        }
        front[i] = now;

    }
    next = INF;
    now = 0;
    for(int i=n-1; i>=0; i--){
        if(s[i]=='o'){
            if(i<=next){
                next = i-c-1;
                now++;
            }    
        }
        back[i] = now;
    }
    rep(i,n){
        int mx = 0;
        if(i>0) mx += front[i-1];
        if(i<n-1) mx += back[i+1];
        if(mx<k) cout << i+1 << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3332
from collections import defaultdict, deque
import sys


def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


a, b = LI()
ans = 'Impossible'
if a % 3 == 0 or b % 3 == 0 or (a + b) % 3 == 0:
    ans = 'Possible'
print(ans)


Measured memory_bytes: 3444
#define  _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(20);
}


unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

#define int ll
void solve() {
    int n;
    cin >> n;
    vector<string> inputs;
    queue<pair<string, int>> gogo;
    gogo.push(mp(string{ 'a' }, 0));
    while (gogo.empty() == false) {
        pair<string, int> now = gogo.front();
        gogo.pop();
        if (now.first.length() == n) {
            inputs.push_back(now.first);
            continue;
        }
        for (int q = 0; q <= now.second; ++q) {
            now.first.push_back(q + 'a');
            gogo.push(mp(now.first, now.second));
            now.first.pop_back();
        }
        now.first.push_back('a' + now.second + 1);
        gogo.push(mp(now.first, now.second + 1));
    }
    sort(ALL(inputs));
    REP(i, inputs.size()) {
        cout << inputs[i] << endl;
    }
}

#undef int
int main() {
    init();
    solve();
}

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

int main()
{
    int N, M;
    int count1 = 0;
    int count2 = 0;
    int sum = 0;
    cin >> N >> M;
    count1 = (N * (N - 1)) / 2;
    count2 = (M * (M - 1)) / 2;
    sum = count1 + count2;
    cout << sum << endl;
}

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

#define MAX(X,Y) ((X)>(Y)?(X):(Y))

int main(){
  int x,n,s,m;
  
  s = m = 0;
  cin >> n;
  for (int i=0; i<n; i++){
    cin >> x;
    m = MAX(m,x);
    s += x;
  }
  s -= m;
  cout << (s>m?"Yes":"No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	double a,b;
	int ans;
	cin>>a>>b;
	for (double i=1;i<1250;i++)
		if (floor(i*0.08)==a&&floor(i*0.1)==b)
		{
			cout<<i<<endl;
			return 0;
		}
	cout<<-1<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main()
{ int L,R,d,co=0;
 cin >> L >> R >> d;
 
 for(int i=L;i<=R;i++)
 { if(i%d==0)
    {co++;
    }
     }
    cout << co << endl;
return 0;    
    }

Measured memory_bytes: 3108
import math

a,b,h,m = map(int,input().split())
tan_sin = math.pi * (h + m/60) / 6  # 時針が H + M/60 時間で動いた角度
cho_sin = math.pi * m/30   # 分針が M 分で動いた角度

theta = tan_sin - cho_sin
c = math.cos(theta)

ans = math.sqrt(a**2 + b**2 - 2*a*b*c)  # 余弦定理

print(ans)

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

int main(){
	string s;cin >>	s;
	int n = s.length();
	int b = 0;
	int r = 0;
	for(int i = 0;i < n;i++){
		if(s[i] == '0')b++;
		else r++;
	}
	cout << min(b, r) * 2;
}
// make pair, tuple
// make pair, tuple
// 
// __gcd(int, int);
// lcm = a * b / __gcd(a, b);
// 
// bool isPrime(int n){
//       if(n <= 1)return false;
//       if(n <= 3)return true;
//       if(n % 2 == 0 || n % 3 == 0)return false;
//       for(int i = 5;i * i <= n;i += 6){
//             if(n % i == 0 || n % (i + 2) == 0)return false;
//       }
//       return true;
// }
// int countSubString(string s, string temp){
//       int ans = 0;
//       size_t f = s.find(temp);
//       while(f != string::npos){
//             ans++;
//             f = s.find(temp, f + 1);
//       }
//       return ans;
// }
// 
// #Count leading & trailing zero of an integer bits
// __builtin_clz(n);
// __builtin_clzll(n);
//
// #Count 1s bits of an integer
// __builtin_popcount(n);
// __builtin_popcountll(n);
//
// #Error checking
// assert(n == 3);
// 
// #Error Printing
// cerr << "Some thing";

// #binary exponentiation
// long long binpow(long long a, long long b) {
//     long long res = 1;
//     while (b > 0) {
//         if (b & 1)
//             res = res * a;
//         a = a * a;
//         b >>= 1;
//     }
//     return res;
// }


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

int main() {
    long int N;
  	int count = 0, tc;
  	int num[8] = {1,3,6,10,15,21,28,36};
  	cin >> N;
  
	for (int i = 2; i < 1000001; i++){
      	tc = 0;
		while(N%i == 0){
        	tc++;
        	N = N/i;
        }
        for(int j = 0; j < 8; j++){
        	if(tc < num[j]) break;
          	count++;
        }
      	if (N == 1) break;
    }
  
  	if (N != 1) count++; //for upper 10^6
  
    cout << count << endl;
  return 0;
}

Measured memory_bytes: 3652
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
input = lines.pop(0)
acgt = tuple("ACGT")
max_num_list = []
max_num = 0
for c in input:
    if c in acgt:
        max_num += 1
    else:
        max_num_list.append(max_num)
        max_num = 0
max_num_list.append(max_num)
print(max(max_num_list))


Measured memory_bytes: 9112
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long
#define pb push_back
#define pf push_front
#define Mid ((l+r)/2)
#define pi pair<int,int>
#define pii pair<int,pi>
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
double a,b,c,teta,x,y;
double PI=acos(-1);
double g(double aa){
    return (aa*PI)/180.0;
}
int main()
{
    go;
    cin>>a>>b>>x>>y;
    x=x*30+y/2;
    y=y*6;
    if(x<y)
        swap(x,y);
    //cout<<x<<" "<<y<<endl;
    teta=g(x-y);
    c=sqrt(b*b+a*a-2*a*b*cos(teta));
    cout<<fixed<<setprecision(10)<<c;
    return 0;
}


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

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

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

#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
#define ALL(x) x.begin(), x.end()
#define X first
#define Y second
#define ACCEL ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef pair<pll,lli> p3l;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
typedef vector<p3l> v3L;
typedef vector<vcL> vvL;
//typedef priority_queue<T> prior_S<T>;
//typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
      lli   mod = 1000000007;

/// templates ///

const lli maxN = 2E5;

vcL inv(maxN+5, 1);
vcL fac(maxN+5, 1);

void ADD(lli &x, lli y) {
	x += y;
	if (x >= mod) x -= mod;
	if (x < 0) x += mod;
}

void MUL(lli &x, lli y) {
	x *= y;
	x = (x % mod + mod) % mod;
}

lli mypow(lli b, lli e) {
	lli ans = 1;
	while (e) {
		if (e & 1) MUL(ans, b);
		MUL(b, b);
		e >>= 1;
	}
	return ans;
}

lli modinv(lli n) {
	return mypow(n, mod - 2);
}

void calcInv(lli n) {
	for (int i = 2; i <= n; ++i) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
	}
}

void calcFac(lli n) {
	for (int i = 2; i <= n; ++i) {
		fac[i] = fac[i - 1] * i % mod;
	}
}

lli cm(lli a, lli b) {
	lli ans = 1;
	if (a < b) return 0;

	MUL(ans, inv[fac[a - b]]);
	MUL(ans, inv[fac[b]]);
	MUL(ans, fac[a]);

	return ans;
}

lli Lucas(lli n, lli m) {
	if (m == 0) return 1;
	return cm(n % mod, m % mod) * Lucas(n / mod, m / mod) % mod;
}

lli doLucas(lli n, lli m) {
	calcInv(mod);
	calcFac(mod);
	return Lucas(n, m);
}

/// coding area ///

const lli maxn = 1E5;

void precal() {

	return;
}

void solve() {
	lli h, w;
	cin >> h >> w;
	
	string grid[h];
	for (auto &s : grid) cin >> s;
	
	lli dp[h + 1][w + 1];
	memset(dp, 0, sizeof(dp));
	dp[1][1] = 1;
	
	for (int i = 1; i <= h; ++i) {
		for (int j = 1; j <= w; ++j) {
			if (grid[i - 1][j - 1] == '#') continue;
			if (i == 1 and j == 1) continue;
			dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
		}
	}
	
	cout << dp[h][w] << '\n';
}

int main() {
	precal();
	int t = 1;
	#ifdef LOCAL
		t = INT_MAX;
	#else
		ACCEL;
	#endif
//	cin >> t;
	for (int i = 1; i <= t; ++i) {
//		printf("Case #%d: ", i );
		solve();
	}
	return 0;
}




Measured memory_bytes: 12288