akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Objects;
import java.util.stream.Collectors;

class Card {
    String color;
    int num;

    static Card of(String s) {
        Card c = new Card();
        c.color = s.substring(0, 1);
        c.num = Integer.parseInt(s.substring(1));
        return c;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Card card = (Card) o;
        return num == card.num &&
                Objects.equals(color, card.color);
    }

    @Override
    public int hashCode() {
        return Objects.hash(color, num);
    }

    @Override
    public String toString() {
        return color + num;
    }
}

public class Main {
    static void bubbleSort(int N, Card[] A) {
        for (int i = 0; i < N; i++) {
            for (int j = N - 1; j > i; j--) {
                if (A[j].num < A[j - 1].num) {
                    Card tmp = A[j];
                    A[j] = A[j - 1];
                    A[j - 1] = tmp;
                }
            }
        }
    }

    static void selectionSort(int N, Card[] A) {
        for (int i = 0; i < N; i++) {
            int minj = i;
            for (int j = i; j < N; j++) {
                if (A[j].num < A[minj].num) {
                    minj = j;
                }
            }
            if (minj != i) {
                Card tmp = A[i];
                A[i] = A[minj];
                A[minj] = tmp;
            }
        }
    }

    public static void main(String[] args) {
        try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
            int N = Integer.parseInt(in.readLine());
            Card[] A = Arrays.stream(in.readLine().split(" ")).map(Card::of).toArray(Card[]::new);
            Card[] A2 = Arrays.copyOf(A, N);

            bubbleSort(N, A);
            selectionSort(N, A2);

            System.out.println(Arrays.stream(A).map(Card::toString).collect(Collectors.joining(" ")));
            System.out.println("Stable");

            System.out.println(Arrays.stream(A2).map(Card::toString).collect(Collectors.joining(" ")));
            if (Arrays.equals(A, A2)) {
                System.out.println("Stable");
            } else {
                System.out.println("Not stable");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


Measured memory_bytes: 31248
#include <iostream>

using namespace std;

int main() {
    int x,y;
    while(true) {
        cin >> x >> y;

        if (x == 0 && y == 0)
            break;

        if (x < y) {
            cout << x << " " << y << endl;
        } else {
            cout << y << " " << x << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1160
fun main(args: Array<String>) {
    abc126C()
}

fun abc126C() {
    val (n, requiredPoint) = readLine()!!.split(" ").map { it.toInt() }

    var probabilitySum = 0.toDouble()
    (1..n).map {
        var currentPoint = it
        var needContinuousFront = 0
        var probability = 1.toDouble()
        while (currentPoint < requiredPoint) {
            currentPoint *= 2
            needContinuousFront++
            probability /= 2.toDouble()
        }
        probabilitySum += probability / n.toDouble()
    }

    println(probabilitySum)
}


Measured memory_bytes: 38628
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		 int n=in.nextInt();
		 List<Integer> A=new ArrayList<>();
		 
		 for(int i=0;i<n;i++)A.add(Integer.parseInt(in.next()));
		 in.close();
		 
		 int swap=bubble(A);
		 for(int i=0;i<n-1;i++)System.out.print(A.get(i)+" ");
		 System.out.println(A.get(n-1));
		 System.out.println(swap);
	}
	
	static int bubble(List<Integer> A) {
		boolean f=true;
		int sw=0;
		
		while(f) {
			f=false;
			for(int i=A.size()-1;i>0;i--) {
				if(A.get(i)<A.get(i-1)) {
					Collections.swap(A, i, i-1);
					sw++;
					f=true;
				}
			}
		}
		
		return sw;
	}

}



Measured memory_bytes: 26328
from itertools import accumulate
from collections import defaultdict


def main():
    n = int(input())
    prime_counter = defaultdict(int)
    acc = tuple(accumulate(range(1, 42)))  # 10^12 < 2^39

    def facs():
        yield 2
        for x in range(10 ** 6):
            yield x * 2 + 3

    for fac in facs():
        while fac * fac <= n:
            if n % fac == 0:
                n //= fac
                prime_counter[fac] += 1
            else:
                break
    if n != 1:
        prime_counter[n] += 1

    ans = 0
    for c in prime_counter.values():
        for i, x in enumerate(acc):
            if c < x:
                tmp = i
                break
        ans += tmp
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9320
val1= input()
val2= input()
num1= list(map(int,val1.split()))
num2= list(map(int,val2.split()))
n= num1[0]
m= num1[1]
sumup=0;
for i in range(0,n):
    sumup= sumup+ num2[i]

border= sumup/ (4* m)
judge=0
for j in range(0,n):
    if num2[j] >= border:
        judge= judge + 1
if judge >= m:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
//***___*********___*****___****___***___*********//
/*  |   \  |   | |   |   |   \  |     |     |   |  **
/*  |   |  |   | |___|   |   _  |__   |___  |___|  **
/*  |   |  |   | |   \   |  | | |         | |   |  **
/*  |___/  |___| |    \  |__| | |___  ____| |   |  **
//*************************************************/
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#define ff double
#define endl "\n"
#define M 1000000007
#define forever while(1)
#define ll long long
#define pb push_back
#define vi vector<long long>
#define mii map<int,int>
#define pii pair<int,int>
#define test ll t;cin>>t;while(t--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define buffer cin.ignore(numeric_limits<streamsize>::max(),'\n');
using namespace std;
void fastscan(int &x)
{
        bool neg=false;
        register int c;
        x =0;
        c=getchar();
        if(c=='-')
        {
            neg = true;
            c=getchar();
        }
        for(;(c>47 && c<58);c=getchar())
            x = (x<<1) + (x<<3) +c -48;
        if(neg)
            x *=-1;
}
int main()
{
     ll n;
     cin>>n;
     ll arr[n];
     REP(i,n)
     cin>>arr[i];

     ll ans=0;
     for(ll i=0;i<n;i++)
     {
         for(ll j=i+1;j<n;j++)
            ans+=arr[i]*arr[j];
     }
     cout<<ans<<endl;
    return 0;
}



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

using namespace std;

int main(){
	int f[4];
	int ans = 99999999;
	cin >> f[1] >> f[2] >> f[3];
	for(int i = 1; i <= 3; ++i)
		for(int j = 1; j <= 3; ++j)
			if(i != j) 
			ans = min(ans,f[i] + f[j]);
	cout << ans << endl;
	return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll, ll> pair_t;
using Graph = vector<vector<ll>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = 1 << 29;
/****** define constant end ********/
/****** define variable start ******/
string n;
/******* define variable end *******/
int solve() {
	cin >> n;
	if(n.substr(0, 1) == "7" || n.substr(1,1) == "7" || n.substr(2,1) == "7"){
		cout <<"Yes" << endl;
	}else{
		cout <<"No" << endl;
	}
	return 0;
}

int main() {
	// clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


Measured memory_bytes: 3644
#include <valarray>
#include <cstdio>
using namespace std;
typedef valarray<int>V;
int N,M,A,B,C,T;
V mul(const V &a, const V &b){
    V c(N*N);
    int i=0,j;
    for(;i<N;i++)for(j=0;j<N;j++)c[i*N+j]=(a[slice(i*N,N,1)]*b[slice(j,N,N)]).sum()%M;
    return c;
}
V exp(const V &a, const int n){
    if(n==1)return a;
    if(n&1)return mul(exp(a,n-1),a);
    V b=exp(a,n>>1);
    return mul(b,b);
}
V s,x;
void output(const V &r){
    int i=0;
    for(;i<N-1;i++)printf("%d ",(r[slice(i*N,N,1)]*s).sum()%M);
    printf("%d\n",(r[slice(i*N,N,1)]*s).sum()%M);
}
main(){
    int i;
    for(;scanf("%d%d%d%d%d%d",&N,&M,&A,&B,&C,&T),N;){
        s.resize(N);
        for(i=0;i<N;i++)scanf("%d",&s[i]);
        x.resize(0);
        x.resize(N*N);
        if(T){
            x[0]=B;
            x[1]=C;
            for(i=1;i<N-1;i++){
                x[i*N+i-1]=A;
                x[i*N+i]=B;
                x[i*N+i+1]=C;
            }
            x[i*N+i-1]=A;
            x[i*N+i]=B;
            output(exp(x,T));
        }else{
            for(i=0;i<N;i++)x[i*N+i]=1;
            output(x);
        }
    }
}

Measured memory_bytes: 1084
S = input()

a = int(S[:2])
b = int(S[2:])

am = False
bm = False
if a >= 1 and a <= 12:
  am = True
if b >= 1 and b <= 12:
  bm = True

if am and bm:
  print("AMBIGUOUS")
elif am:
  print("MMYY")
elif bm:
  print("YYMM")
else:
  print("NA")

Measured memory_bytes: 3064
{-# LANGUAGE FlexibleContexts #-}
import Control.Monad
import Control.Monad.State
import Control.Monad.Reader
import Control.Arrow
-- import Control.Comonad
import Data.Maybe
import Data.List
import Data.Either
import Data.Bool
import Data.Fixed
import Data.Tuple
import Data.Ratio
import qualified Data.Map.Strict as M
import qualified Data.Array.IO as IA
import qualified Data.Vector as V
 
getI = read <$> getLine :: IO Int
getIs = map read . words <$> getLine :: IO [Int]
getD = read <$> getLine :: IO Double
getDs = map read . words <$> getLine :: IO [Double]
getInt = read <$> getLine :: IO Integer
getInts = map read . words <$> getLine :: IO [Integer]
 
type Row = Integer
type Col = Integer
type PointI = (Integer, Integer)
type Point = (Int, Int)
 
mmm = 1000000007
fact n
    | n < 1 = 1
    | True = foldr1 (*) [1..n]
fi = fromInteger
fig = fromIntegral
rf = realToFrac
 
(.<.) f g -- combination
    | f < g = 0 
    | g < 1 || f < 1 = 1
    | True = foldr1 (*) (take g [f,f-1..]) `div` fact g
(.>.) f g --combination with repetition
    | g < 1 || f < 1 = 1
    | True = fact (f + g - 1) `div` (fact (f - 1) * fact g)
comb = (.<.)
combWp = (.>.)
 
unique a = unique_ (reverse . sort $ a) [] Nothing
    where
        unique_ [] arr _ = arr
        unique_ (x:xs) arr n
            | n == Just x = unique_ xs arr n
            | otherwise = unique_ xs (x:arr) $ Just x
 
zeroume keta num
    | (length . show $ num) > keta = show num
    | otherwise = do 
        let zeros = take keta $ repeat '0'
        reverse . take keta $ (reverse . show $ num) ++ zeros
 
i2b num
    | num < 2 = show num
    | otherwise = i2b_ num []
        where
            i2b_ num str
                | num == 0 = str
                | num == 1 = '1':str
                | otherwise = do
                    let next = num `div` 2
                    let this = if odd num then '1' else '0'
                    i2b_ next (this:str)
 
mapIncr = mapPlus 1
mapPlus n Nothing = Just n
mapPlus n a = (+) n <$> a
 
countIf f = length . filter f
 
-- 
--
--

main = do
  inp<-getLine >> getIs
  putStrLn . show $ mizuyari inp

mizuyari :: [Int] -> Int
mizuyari arr
  | all (==0) arr = 0
  | length arr == 1 = head arr
  | True = do
    let m = minimum arr
        mizuyarare = map (flip (-) m) arr
        newArr = filter (/=[]) $ splitIntoSubGroupes mizuyarare []
    (sum $ map mizuyari newArr) + m
    where 
      splitIntoSubGroupes arr summed
        | all (/= 0) arr = arr:summed
        | True = do
          let (l,r) = span (/=0) (dropWhile (==0) arr)
          splitIntoSubGroupes r (l:summed)
        



Measured memory_bytes: 1020
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

const ll INF = 1LL << 50;

const ll mod = 1e9 + 7;

struct UnionFind {
  vector<ll> par, sizes;
  ll cnt;
  UnionFind(ll N) : par(N), sizes(N, 1), cnt(N) {
    for (ll i = 0; i < N; i++) par[i] = i;
  }

  ll find(ll x) { return par[x] == x ? x : par[x] = find(par[x]); }

  bool same(ll x, ll y) { return find(x) == find(y); }

  ll size(ll x) { return sizes[find(x)]; }

  void unite(ll x, ll y) {
    x = find(x);
    y = find(y);
    if (x == y) return;
    if (sizes[x] < sizes[y]) swap(x, y);
    par[y] = x;
    sizes[x] += sizes[y];
    cnt--;
  }

  ll count() const { return cnt; }
};

int main() {
  ll n, m;
  cin >> n >> m;

  vvP eds(n);

  UnionFind uf(n);

  priority_queue<T, vT, greater<T>> pq;

  rep(i, m) {
    ll u, v, w;
    cin >> u >> v >> w;
    pq.emplace(w, u, v);
  }

  ll ans = 0;
  while (!pq.empty()) {
    ll w, u, v;
    tie(w, u, v) = pq.top();
    pq.pop();
    if (!uf.same(u, v)) {
      uf.unite(u, v);
      ans += w;
    }
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 6356
#include <stdio.h>
int main()
{
    int n,s=0;
    int a[3005];
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        s+=a[i]-1;
    }
    printf("%d\n",s);
    return 0;
}


Measured memory_bytes: 128
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension [String] {
//    func joined() -> String {
//        return self.joinWithSeparator("")
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/



/*************** メインプログラム ***************/

let N = readInt()!
let S = readLine()!.toArray()
let alphabet = "abcdefghijklmnopqrstuvwxyz".toArray()
var ans = [Int]()

for i in 1..<N {
    ans += [0]
    for c in alphabet {
        var left = false
        var right = false
        for j in 0..<i {
            if S[j] == c {
                left = true
            }
        }
        for j in i..<N {
            if S[j] == c {
                right = true
            }
        }
        if left && right {
            ans[i-1] += 1
        }
    }
}

print(ans.max())


Measured memory_bytes: 6888
#include <bits/stdc++.h>
 using namespace std;
 #define rep(i,N) for(int i=0;i<int(N);++i)
 using ll = long long;
 const int MOD = 1e9 + 7;
 const int INF = 2147483647;
 // const ll INF = 1000000000000000000LL;
 
 int main(){
   int n;
   cin >> n;
   if(n==1){
       cout << 1 << endl;
       return 0;
   }
   vector<ll> x(n);
   vector<ll> y(n);
   rep(i,n){
       cin >> x[i] >> y[i];
   }
    map<pair<ll,ll>,ll> cur;
   rep(i,n){
       rep(j,n){
           if(i!=j){
               cur[make_pair(x[j]-x[i],
               y[j]-y[i])]++;
           }
       }
   }
   ll max = -INF;
   pair<ll,ll> max_pr;
   for(auto a:cur){
       if(max<a.second){
         max = a.second;
         max_pr = a.first;
       }
   }
   ll ans = n-max;
   cout << ans << endl;
   return 0;
 }

Measured memory_bytes: 3632
#include<stdio.h>

    char prime[10000001];

int main()
{
    int i,j,n;


    for(i = 2;i < 10000000;i++) prime[i]=1;

    for(i = 2;i <= 10000000;i++) if(prime[i]) for(j=i+i;j<=10000000;j+=i) prime[j]=0;

    while(scanf("%d",&n),n){

        if(n%2==0)n--;

        for(i=n;i>13;i-=2){
            if(prime[i]+prime[i-2]+prime[i-6]+prime[i-8]==4) {
                break;
            }   
        }   

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

    }   
    return 0;
}

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



int main() {
  int n,k;
  string s;
  cin>>n>>k>>s;
  vector<int> l;
  vector<int> suml;
  int a=1;
  int cnt=0;
  rep(i,n){
    int now=s[i]-'0';
    if (now==a){
      cnt++;
    }
    else{
      l.emplace_back(cnt);
      cnt=1;
      a=now;
    //  cout<<a<<'a'<<endl;
    }
  }
  l.emplace_back(cnt);
  if (l.size()%2==1)l.emplace_back(0);
  int c=0;
  suml.emplace_back(0);
  rep(i,l.size()){
    c+=l[i];
    suml.emplace_back(c);
  }
  int len=suml.size();
  int ans=0;
  rep(i,len-1){
  //  cout<<l[i]<<endl;
  }
  for(int i=1;i<len;i+=2){
    int ne=suml[min(i+2*k,len-1)]-suml[i-1];
    ans=max(ans,ne);
  }

  cout<<ans;
  }


Measured memory_bytes: 1528
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a, b;
  cin >> a;
  cin >> b;
  
  if(a % 2 == 0 || b % 2 == 0) {
    cout << " Even " << endl;
  }
  else {
    cout << " Odd " << endl;
  }
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　 |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/




int D, L;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> D >> L;
    int ans = D / L + (D % L);
    cout << ans << endl;
}


Measured memory_bytes: 3212
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define elnd endl //* missspell check
const ll INF = 1LL << 60;

void solve(long long N, long long M, long long Q, std::vector<long long> L, std::vector<long long> R, std::vector<long long> p, std::vector<long long> q){
    vector<vll> d(N+1, vll(N+1, 0));
    REP(i, M){
        d[L[i]][R[i]]++;
    }
    REP(i, N+1) REP(j, N) d[i][j+1] += d[i][j];
    REP(i, N) REP(j, N+1) d[i+1][j] += d[i][j];
    REP(k, Q){
        cout<< d[q[k]][q[k]] + d[p[k]-1][p[k]-1] - d[p[k]-1][q[k]] - d[q[k]][p[k]-1]<<endl;
    }

}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    long long Q;
    scanf("%lld",&Q);
    std::vector<long long> L(M);
    std::vector<long long> R(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&L[i]);
        scanf("%lld",&R[i]);
    }
    std::vector<long long> p(Q);
    std::vector<long long> q(Q);
    for(int i = 0 ; i < Q ; i++){
        scanf("%lld",&p[i]);
        scanf("%lld",&q[i]);
    }
    solve(N, M, Q, std::move(L), std::move(R), std::move(p), std::move(q));
    return 0;
}


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

int main()
{
	ll a;
	double b;
	scanf("%lld %lf",&a,&b);
	b=b+1e-7;
	ll c=b*100;
	ll d=c*a/100;
	printf("%lld",d);
	return 0;
}

Measured memory_bytes: 3784
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define ll long long
#define P pair<int, int>

using namespace std;
int mod = 1000000007;

string s;

int main() {
  cin >> s;
  auto N = s.size();
  bool ans = true;
  if (s.at(0) != 'A') {
    ans = false;
  }
  bool hasC = false;
  for(int i=1; i<N; i++) {
    if (i==1 || i==N-1) {
      if (s.at(i) < 'a' || 'z' < s.at(i)) {
        ans = false;
      }
    } else {
      if (s.at(i) == 'C') {
        if (!hasC) {
          hasC = true;
        } else {
          ans = false;
        }
      } else if (s.at(i) < 'a' || 'z' < s.at(i)) {
        ans = false;
      }
    }
  }
  ans = ans && hasC;
  cout << (ans ? "AC" : "WA") << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
def func(S):
	A, B, C = map(int, S.split())
	return B // A if B // A < C else C

def main():
	#print(func("2 11 4"))
	#print(func("3 9 5"))
	#print(func("100 1 10"))
	print(func(input()))
	return

if __name__ == '__main__':
	main()


Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
long long mmin(long long &a,long long b) {
	a = min(a, b);
	return a;
}
long long mmax(long long &a,long long b) {
	a = max(a, b);
	return a;
}
int nibu(vector<int> &v, int tan) {
	int up = v.size()-1;
	int lo = 0;
	if (tan <= v[0]) {
		return 0;
	}
	while (up - lo > 1) {
		int mi = (up + lo) / 2;
		if (tan <= v[mi]) {
			up = mi;
		}
		if (v[mi] < tan) {
			lo = mi;
		}
	}
	return up;
}
long long mo(vector<long long> &v, int i) {
	int n = v.size();
	return v[(i + n) % n];
}
int main() {
	int n;
	cin >> n;
	vector<long long> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	vector<vector<long long> > cag(n+1, vector<long long>(n));
	int st = n % 2;
	if (st == 0) {
		vector<long long> ze(n, 0);
		cag[st] = ze;
	}
	else{
		cag[st] = a;
	}
	for (int i = st + 2; i <= n; i = i + 2) {
		for (int j = 0; j < n; j++) {
			if (i == 2) {
				cag[i][j] = max(a[j], mo(a, j + 1));
			}
			else {
				vector<long long> ba = cag[i - 2];
				long long x, y;
				if (mo(a, j + 1) > mo(a, j + i - 1)) {
					x = mo(ba, j + 2) + a[j];
				}
				else {
					x = mo(ba, j + 1) + a[j];
				}
				if (a[j] > mo(a, j + i - 2)) {
					y = mo(ba, j + 1) + mo(a, j + i - 1);
				}
				else {
					y = ba[j] + mo(a, j + i - 1);
				}
				cag[i][j] = max(x, y);
			}
		}
	}
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		mmax(ans, cag[n][i]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 34320
use io::*;

fn main()
{
    let con =read_string();
    let mut sc =Scanner::new(&con);

    let N:i32 = sc.next();
    let mut check:bool =false;
    for x in 0..25
    {
        for y in 0..15
        {
            if x*4+y*7==N
            {
                check=true;
                break;
            }
        }
        if check
        {
            break;
        }
    }

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

pub mod io {
    use std;
    use std::str::FromStr;
 
    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }
 
    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }
 
        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }
 
        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }
 
        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }
 
    pub fn read_string() -> String {
        use std::io::Read;
 
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }
 
    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}

Measured memory_bytes: 4352
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int H = stdIn.nextInt();
	int A = stdIn.nextInt();
	int count=0;
	do{
	    H-=A;
	    count++;
	}while(H>0);
	System.out.println(count);
    }
}


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

int main(void)
{
	int n, a;
	int ans;
	cin >> n >> a;

	n -= (n / 500) * 500;
	if (n <= a)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1e12

#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>
#define vll vector<ll>
#define vpl vector<pll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pr_d(x) cout << fixed << setprecision(15) << x << endl
#define ud(c, x) distance(c.begin(), upper_bound(all(c), x))
#define ld(c, x) distance(c.begin(), lower_bound(all(c), x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep3(i, n) for (int i = (n - 1); i >= 0; --i)
#define rep4(i, a, b) for (int i = (a); i > (b); --i)
#define pb push_back
#define out(x) cout << x << "\n"
bool odd(int i) { return i % 2; }

#define all(v) v.begin(), v.end()
#define size(x) int(x.size())

int gcd(int a, int b) { return __gcd(a, b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
void Yes_No(bool f) {
  if (f)
    printf("Yes\n");
  else
    printf("No\n");
}
void YES_NO(bool f) {
  if (f)
    printf("YES\n");
  else
    printf("NO\n");
}

template <typename T>
void deb1(T x) {
  cout << x << "\n";
}

template <typename T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
//-------------------ここから回答する-----------------------

void solve(void) {
  int h, w;
  cin >> h >> w;
  vector<string> v(h);

  rep(i, h) cin >> v[i];
  string tmp;
  rep(i, w + 2) tmp += '#';
  rep(i, h + 2) {
    if (i == 0 or i == h + 1)
      out(tmp);
    else
      out('#' + v[i - 1] + '#');
  }
}
int main(void) { solve(); }

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

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

typedef long long ll;

int N;

int main() {
   cin >> N;
   for (int i=N;i<=999;i++) {
      int a = (i / 10) % 10;
      int b = (i / 100) % 10;
      int c = i % 10;
      if (a == b && b == c) {
         printf("%d\n", i);
         return 0;
      }
   }
   return 0;
}


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

using namespace std;

using ll = long long;

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

    int n, k;
    cin >> n >> k;

    vector<vector<int>> b(k + 2, vector<int>(k + 2));
    vector<vector<int>> w(k + 2, vector<int>(k + 2));
    for (int i = 0, x, y; i < n; ++i) {
        char c;
        cin >> x >> y >> c;

        int p = (((x - (x % k)) / k) + (( y - (y % k)) / k)) % 2;
        if (p) c = (c == 'B' ? 'W' : 'B');
        x = (x % k) + 1;
        y = (y % k) + 1;
        if (c == 'B') ++b[y][x];
        else ++w[y][x];
    }

    for (int y = 1; y <= k + 1; ++y) {
        for (int x = 1; x <= k + 1; ++x) {
            b[y][x] += (b[y - 1][x] + b[y][x - 1] - b[y - 1][x - 1]);
            w[y][x] += (w[y - 1][x] + w[y][x - 1] - w[y - 1][x - 1]);
        }
    }

    int ans = 0;
    for (int y = 1; y <= k; ++y) {
        for (int x = 1; x <= k; ++x) {
            // black
            int cnt_b = b[y][x] + (b[k][k] - b[y][k] - b[k][x] + b[y][x]);
            cnt_b += (w[y][k] - w[y][x] + w[k][x] - w[y][x]);

            // white
            int cnt_w = w[y][x] + (w[k][k] - w[y][k] - w[k][x] + w[y][x]);
            cnt_w += (b[y][k] - b[y][x] + b[k][x] - b[y][x]);

            ans = max({ans, cnt_b, cnt_w});
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  char c;
  cin>>c;
  if('A'<=c&&c<='Z'){
    cout<<'A';
  }
  else{
    cout<<'a';
  }
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long
#define pub push_back 
#define pob pop_back 
#define puf push_front
#define pof pop_front
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
using namespace std ;
int main()
{
	ll n ; 
	cin >> n ;
	ll arr[n] , sor[n];
	fo(i , n)
	{
		cin >> arr[i] ;
		sor[i] = arr[i] ;
	}
	sort(sor , sor+n);
	ll a = 0 ;
	fo(i , n)
		if(sor[i] != arr[i])
			a++ ;
	if(a == 0 || a == 2)
		cout << "YES" << endl ;
	else
		cout << "NO" << endl ;
		

	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int[] array;
    static int[][][] data;
    static int n;
    static int ans = 0;
    
    public static void main(String[] args) throws Exception {
        // Your code here! 
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        // array: 長さnのbit列
        array = new int[n];
        
        // 全探索する時のデータを取得
        data = new int[n][n-1][2];
        for (int i = 0; i < n; i++) {
            int k = sc.nextInt();
            for (int j = 0; j < k; j++) {
                data[i][j][0] = sc.nextInt() - 1;
                data[i][j][1] = sc.nextInt();
            }
            
            for (int j = k; j < n-1; j++) {
                data[i][j][0] = -1;
                data[i][j][1] = -1;
            }
        }
        
        // arrayのパターンを全探索
        // ex.[1, 1, 1], [1, 1, 2], ... , [m, m, m]
        dfs(0, 0);
        
        // ans: costの最小値
        System.out.println(ans);
    }
    
    public static void dfs(int index, int now) {
        // 終了条件
        if (index == n) {
            // できあがったarrayで計算
            boolean ok = true;
            for (int i = 0; i < n; i++) {
                if (array[i] == 1) {
                    for (int j = 0; j < n-1; j++) {
                        if (data[i][j][0] == -1) break;
                        
                        int p = data[i][j][0];
                        int s = data[i][j][1];
                        if (array[p] != s) {
                            return;
                        }
                    }
                }
            }
            
            int count = 0;
            if (ok) {
                for (int i = 0; i < n; i++) {
                    if (array[i] == 1) count++;
                }
            }
            ans = Math.max(ans, count);
            return;
        }
        
        // 次項の取る値: 0 or 1
        for (int i = 0; i < 2; i++) {
            array[index] = i;
            dfs(index + 1, i);
        }
    }
}

Measured memory_bytes: 22356
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
 int n,k,m,kakeru,tasu;
  cin>>n;
  cin>>k;
  m=1;
  //毎回の操作で最小をかけるまたは、足していく
 
  for(int i=0;i<n;i++){
    kakeru=m*2;
    tasu=m+k;
    
    if(kakeru<=tasu){
      m=kakeru;
    }else{
      m=tasu;
    }
  }
  cout<<m<<endl;
}

Measured memory_bytes: 256
/*  -*- coding: utf-8 -*-
 *
 * b.cc: B: Template Matching
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 50;
const int MAX_M = 50;

/* typedef */

/* global variables */

string as[MAX_N], bs[MAX_M];

/* subroutines */

/* main */

int main() {
  int n, m;
  cin >> n >> m;
  for (int y = 0; y < n; y++) cin >> as[y];
  for (int y = 0; y < m; y++) cin >> bs[y];

  bool ng = true;
  for (int dy = 0; ng && dy + m <= n; dy++)
    for (int dx = 0; ng && dx + m <= n; dx++) {
      bool ok = true;
      for (int y = 0; ok && y < m; y++)
	for (int x = 0; ok && x < m; x++)
	  ok = (bs[y][x] == as[y + dy][x + dx]);
      ng = (! ok);
    }

  if (ng) puts("No");
  else puts("Yes");
  return 0;
}


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

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

vector<ll> A;
// vectorのリサイズ
// A.resize(N);

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

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

  ll n;
  cin >> n;
  vector<ll> a(n);
  deque<ll> deq;
  rep(i, n) cin >> a[i];
  rep(i, n) a[i]--;
  rep(i, n) deq.push_back(a[i]);
  ll ans = 0;
  int i = 0;
  while(!deq.empty()) {
    ll tmp = deq.front();
    if (tmp != i) {
      deq.pop_front();
      ans++;
    }else {
      deq.pop_front();
      i++;
    }
  }
  if (ans == n) {
    cout << -1 << endl;
    return 0;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3456
#include<cstdio>
#include<algorithm>
using namespace std;

int A,B,K;

int main() {
	#ifdef LOACL
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif
	scanf("%d %d %d",&A,&B,&K);
	for(int i=1;i<=K;i++) {
		if(i%2) {
			if(A%2)A--;
			B+=A/2,A/=2;
		} else {
			if(B%2)B--;
			A+=B/2,B/=2;
		}
	}
	printf("%d %d",A,B);
	return 0;
}

Measured memory_bytes: 128
package main

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

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

	scanner.Scan()
	s := scanner.Text()
	values := strings.Split(s, "S")

	maxRainnyLength := 0

	for _, value := range values {
		if len(value) > maxRainnyLength {
			maxRainnyLength = len(value)
		}
	}

	fmt.Println(maxRainnyLength)
}


Measured memory_bytes: 1776
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(1000000)

A, B, C, X, Y = map(int, input().split())
# A, B, C, X, Y = 1500, 2000, 1600, 3, 2


def calcBestPrice(A, B, C, X, Y):

    if(X > 0 and Y > 0):
        if(A + B > 2 * C):
            return 2 * C + calcBestPrice(A, B, C, X - 1, Y - 1)
        elif(A > 2 * C):
            return 2 * C * X + calcBestPrice(A, B, C, 0, Y)
        elif(B > 2 * C):
            return 2 * C * Y + calcBestPrice(A, B, C, X, 0)
        else:
            return A * X + B * Y
    elif(X == 0):
        if(B > 2 * C):
            return 2 * C * Y
        else:
            return B * Y
    elif(Y == 0):
        if(A > 2 * C):
            return 2 * C * X
        else:
            return A * X


print(calcBestPrice(A, B, C, X, Y))


Measured memory_bytes: 102368
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#define re register
#define il inline
using namespace std;
const int N=310,mod=1e9+7;
int n,m,a[N],h[N],cnt,ans,f[N][N][N];
struct Edge{int to,nxt,w;}e[N<<1];
il void add(re int u,re int v,re int w){e[++cnt]=(Edge){v,h[u],w};h[u]=cnt;}
il int gi()
{
  re int x=0,t=1;
  re char ch=getchar();
  while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
  if(ch=='-') t=-1,ch=getchar();
  while(ch>='0'&&ch<='9') x=x*10+ch-48,ch=getchar();
  return x*t;
}
il void add(re int &x,re int y){x+=y;if(x>=mod) x-=mod;}
int main()
{
  memset(h,-1,sizeof(h));
  n=gi();m=gi();
  for(re int i=1;i<=m;++i)
    {
      re int l=gi(),r=gi(),x=gi();
      add(r,l,x);
    }
  f[0][0][0]=1;
  for(re int i=0;i<=n;++i)
		for(re int j=0;j<=n;++j)
			for(re int k=0;k<=n;++k)
    {
      re int &x=f[i][j][k],l=max(i,max(j,k));
      if((i&&i==j)||(j&&j==k)||(k&&k==i)) x=0;
      if(x) 
      for(re int o=h[l];o+1;o=e[o].nxt)
    {
      re int v=e[o].to,w=e[o].w;
      if((i>=v)+(j>=v)+(k>=v)!=w) {x=0;break;}
    }
      if(!x) continue;
      add(f[l+1][j][k],x);
      add(f[i][l+1][k],x);
      add(f[i][j][l+1],x);
      if(l==n) add(ans,f[i][j][k]);
    }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 114944
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
using namespace std;
using ll = long long;
using ld = long double;

ll n, k;

const ld PI = acos(-1);

ld len_m[234567];
inline ld len(int d)
{
	if (len_m[d] >= 0)return len_m[d];
	return len_m[d] = sqrt(2 - 2 * cos(PI * 2 / n * d));
}

inline ld cosform(int a_, int b_, int c_)
{
	ld a = len(a_);
	ld b = len(b_);
	ld c = len(c_);
	ld up = a * a + b * b - c * c;
	ld dn = a * b * 2;
	return (ld)up / dn;
}

bool cond(ld s)
{
	ll cnt = 0;
	for (int f = 1; f < n - 1; ++f)
	{
		int hi = (n - f) / 2. + 1;
		int lo = 0;
		while (lo + 1 < hi)
		{
			int md = (hi + lo) / 2;
			int oth = n - md - f;
			ld costh = cosform(md, f, oth);
			ld sinth = sqrt(1. - costh * costh);
			ld area = len(md) * len(f) * sinth / 2.;
			if (area <= s)
			{
				lo = md;
			}
			else
			{
				hi = md;
			}
		}
		ll plus = lo + lo;
		if (plus > n - f - 1)plus = n - f - 1;
		cnt += plus;
	}
	return (cnt > k);
}

const ld EPS = 1e-15;

int main(void)
{
	cin >> n >> k;
	k--;
	k *= 3;
	k /= (n);
	fill(len_m, len_m + 234567, -1.);
	ld hi = PI, lo = 0;
	while(hi - lo >= EPS)
	{
		ld md = (hi + lo) / 2;
		if (cond(md))
		{
			hi = md;
		}
		else
		{
			lo = md;
		}
	}
	cout.precision(20);
	cout << hi << endl;
	return 0;
}


Measured memory_bytes: 3968
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    int d = sc.nextInt();
    
    if(Math.abs(a-c) <= d || Math.abs(c-a) <= d){
      System.out.println("Yes");
    }else if(Math.abs(b-a) <= d && Math.abs(c-b) <= d ){
      System.out.println("Yes");
    }else if(Math.abs(a-b) <= d && Math.abs(b-c) <= d ){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Measured memory_bytes: 35624
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#define ll long long int
int main()
{
    int A , B , T;
    scanf("%d %d %d",&A,&B,&T);
    int div = T / A;

    printf("%d",div*B);

    return 0;
}


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

int main()
{
    double d, t, s;
    cin >> d >> t >> s;

    if (d/s > t) cout << "No" << endl;
    else cout << "Yes" << endl;
}

Measured memory_bytes: 3716
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;

ll lcm(ll x, ll y){
	if(x==y) {return x;}
	ll temp;
    if(x<y){
    	temp = y;
        y = x;
        x = temp;
	}
    ll X = x;
    ll Y = y;
    ll R;
    // X > Y
    // gcd(X,Y) を求める
    while(1){
		R = X%Y;
        if(R==0){break;}
        X = Y;
        Y = R;        
	}    
	return x*(y/Y);
}

void Main()
{
	ll A, B, C, D;
  	cin >> A >> B >> C >> D;
	
    auto f = [&](ll x){
    	ll temp = x/(lcm(C,D));
    	return (x - x/C - x/D + temp);
    };
	
    ll ans = f(B) - f(A-1);
    cout << ans << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long ans=0;
int main()
{
  string a;
  cin>>a;
  for(int i=0;i<a.size();++i)
  {
     ans+=a[i]-'0';
  }
  if(ans%9==0)
  {
    cout<<"Yes";
  }
  else
  cout<<"No";
   return 0;
}


Measured memory_bytes: 3724
# coding: utf-8
N, M, X = map(int, input().split())
A = sorted(list(map(int, input().split())))
cst = [0, 0]
for a in A:
    if a < X:
        cst[0] += 1
    else:
        cst[1] += 1
print(min(cst))

Measured memory_bytes: 3060
/*
Time never waits.
It delivers all equally to the same end.
You, who wish to safeguard the future, however limited it may be...
You will be given one year;
go forth without falter, with your heart as your guide...
*/

#include<bits/stdc++.h>
using namespace std;
#define RI register int
const int mod=1e9+7;
int n,cnt,js,ans;
int a[605],b[605],vis[605],f[605][305][305];

int qm(int x) {return x>=mod?x-mod:x;}
void DP() {
	f[0][0][0]=1;
	for(RI i=1;i<=js;++i) {
		for(RI j=0;j<=n;++j)
			for(RI k=0;k<=n;++k) {
				if(!f[i-1][j][k]) continue;
				if(vis[b[i]]) {
					f[i][j][k+1]=qm(f[i][j][k+1]+f[i-1][j][k]);
					if(j) f[i][j-1][k]=qm(f[i][j-1][k]+f[i-1][j][k]);
				}
				else {
					f[i][j+1][k]=qm(f[i][j+1][k]+f[i-1][j][k]);
					if(j) f[i][j-1][k]=qm(f[i][j-1][k]+f[i-1][j][k]);
					if(k) f[i][j][k-1]=qm(f[i][j][k-1]+1LL*k*f[i-1][j][k]%mod);
				}
			}
	}
}
int main()
{
	scanf("%d",&n);
	for(RI i=1;i<=n+n;++i) scanf("%d",&a[i]);
	for(RI i=1;i<=n+n;i+=2) {
		if(a[i]==-1&&a[i+1]==-1) ++cnt;
		else if(a[i]==-1) vis[a[i+1]]=1;
		else if(a[i+1]==-1) vis[a[i]]=1;
		else vis[a[i+1]]=vis[a[i]]=2;
	}
	for(RI i=n+n;i>=1;--i) if(vis[i]!=2) b[++js]=i;
	DP(),ans=f[js][0][0];
	for(RI i=1;i<=cnt;++i) ans=1LL*ans*i%mod;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 217344
N = int(input())
from copy import copy,deepcopy
dist = [list(map(int,input().split())) for _ in range(N)]
dist2 = deepcopy(dist)
seen = [[False]*N for _ in range(N)]
for k in range(N):
    for i in range(N):
        for j in range(N):
            if (i!=k and k!=j) and dist[i][j]>=dist[i][k]+dist[k][j]:
                dist[i][j]= dist[i][k]+dist[k][j]
ans = 0
for i in range(N):
    for j in range(N):
        flag = True
        if i ==j: continue
        for k in range(N):
            if i==k or j ==k: continue
            if dist2[i][j]>dist[i][k]+dist[k][j]:
                print(-1);exit()
            if dist2[i][j]==dist[i][k]+dist[k][j]:
                flag = False
                break
        if flag:
            ans += dist[i][j]
print(ans//2)

Measured memory_bytes: 78168
#include<bits/stdc++.h>
using namespace std;
struct dd{
	double d;
	int num;
}c[1000];
bool cmp(dd a,dd b){
	return a.d<b.d;
}
int main(){
	int n,k,t;
	cin>>n>>k>>t;
	for(int i=0;i<n;i++){
		cin>>c[i].d;
		c[i].d=c[i].d*0.006;
		c[i].d=k-c[i].d;
		c[i].d=abs(t-c[i].d);
		c[i].num=i;
	}
	sort(c,c+n,cmp);
	cout<<c[0].num+1;
	return 0;
}

Measured memory_bytes: 256
n, k = gets.chomp.split.map(&:to_i)

@nega_candles = []
@posi_candles = []
gets.chomp.split.each do |candle|
  if candle.to_i  <= 0
    @nega_candles.push candle.to_i
  else
    @posi_candles.push candle.to_i
  end
end

# 0から近い順にしておく
@nega_candles.reverse!

ans_list = []
cal_distance = lambda do |l, r|
  if l.zero?
    @posi_candles[r - 1]
  elsif r.zero?
    @nega_candles[l - 1].abs
  else
    [
      2 * @posi_candles[r - 1] + @nega_candles[l - 1].abs,
      @posi_candles[r - 1] + 2 * @nega_candles[l - 1].abs
    ].min
  end
end

ans_list = (k + 1).times.each_with_object([]) do |i, result|
  l = i
  r = k - i
  next if r > @posi_candles.size
  break result if l > @nega_candles.size
  result.push cal_distance.(l, r)
end

puts ans_list.min

Measured memory_bytes: 22180
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{

    static void Main(string[] args)
    {
        var inputs = Console.ReadLine().Split(' ');
        int A = int.Parse(inputs[0]);
        int B = int.Parse(inputs[1]);
        int C = int.Parse(inputs[2]);

        var result = "No";
        if((A < C && C < B) || (B < C && C < A))
        {
            result = "Yes";
        }

        Console.WriteLine(result);
    }

}



Measured memory_bytes: 11092