jiahuimbzuai/CoQuIR huggingface dataset:
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	int N,D;
	int i,ans;
	char str[100000];
 
	fgets(str, sizeof(str), stdin);
	N=atoi(strtok(str," "));
	D=atoi(strtok(NULL," "));

	ans=0;
	for(i=0;i<N;i++){
		int x,y;
		fgets(str, sizeof(str), stdin);
		x=atoi(strtok(str," "));
		y=atoi(strtok(NULL," "));
		if( ((long long)x*x+(long long)y*y) <= ((long long)D*D) ) ans++;
	}

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

	return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {
	const char *SEP = " ";
	long long int n, d, sq_d, x, y, cnt = 0;
	char input_str[256];
	char *num_str;
	int i;

	fgets(input_str, sizeof(input_str), stdin);
	num_str = strtok(input_str, SEP);
	n = atoi(num_str);
	num_str = strtok(NULL, SEP);
	d = atoi(num_str);

	sq_d = d * d;
	for ( i = 0; i < n; i++ ) {
		fgets(input_str, sizeof(input_str), stdin);
		num_str = strtok(input_str, SEP);
		x = atoi(num_str);
		num_str = strtok(NULL, SEP);
		y = atoi(num_str);

		if ( (x*x) + (y*y) <= sq_d ) {
			cnt++;
		}
	}

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

	return 0;
}
//  [c]
#include <stdio.h>

int main(){
  int n;
  long long d;
  scanf("%d%lld",&n,&d);
  int ans = 0,i=0;
  for(i;i<n;++i){
    long long x,y;
    scanf("%lld%lld",&x,&y);
    if(x*x+y*y<=d*d)ans++;
  }
  printf("%d\n",ans);
  return 0;
}
//  [c]
#include<stdio.h>
int main(){
	int N,D,x,y,n=0;
	scanf("%d %d",&N,&D);
	for(int i=0;i<N;i++){
		scanf("%d %d",&x,&y);
		if(x*x+y*y<=D*D)
		n++;
	}
	printf("%d\n",n);
}
//  [c]
#include<stdio.h>
int main(){
	int N,D,x,y,n=0;
	scanf("%d %d",&N &D);
	for(int i=0;i<N;i++){
		scanf("%d %d",&x,&y);
		if(x*x+y*y<=D*D)
		n++;
	}
	printf("%d\n",n);
}
//  [c]
#include<stdio.h>
int main(){
	int N,D,x,y,n=0;
	scanf("%d",&N &D);
	for(int i=0;i<N;i++){
		scanf("%d %d",&x,&y);
		if(x*x+y*y<=D*D)
		n++;
	}
	printf("%d\n",n);
}
//  [javascript]
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var n = next(), d = next();
  var ans = 0;
  var dd = d*d;
  for(var i = 0; i < n; i++){
    var x = next(), y = next();
    if(x*x + y*y <= dd)ans++;
  }
  return ans;
}
//  [javascript]
function Main(input) {
    input = input.split("\n");
    const nd = input[0].split(" ");
    const n = parseInt(nd[0], 10);
    const d = parseInt(nd[1], 10);

    let count = 0;
    for(let i = 1; i <= n; i++) {
        const xy = input[i].split(" ");
        const x = parseInt(xy[0], 10);
        const y = parseInt(xy[1], 10);

        const r = Math.sqrt(x ** 2 + y ** 2);
        if(r <= d) {
            count++;
        }
    }

    console.log(count);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const [N, D] = input[0].split(' ')
  let ans = 0
  for (let i = 1; i < input.length; i++) {
    const [X, Y] = input[i].split(' ')
    if (Math.sqrt(X ** 2 + Y ** 2) <= D) {
      ans++
    }
  }
  console.log(ans)
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
//  [javascript]
const main = (stdin) => {
    const input = stdin.split("\n");
    const init = input[0].split(' ');
  	
    let c = 0;
  	for(let i=1;i<parseInt(init[0]);i++) {
	  const xy = input[i].split(' ');
	  if(Math.sqrt((parseInt(xy[0])^2) + (parseInt(xy[1])^2)) <= parseInt(init[1])) c++;
    }
  console.log(c);
 
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const main = (stdin) => {
    const input = stdin.split("\n");
    const init = input[0].split(' ');
  	
    let c = 0;
  	for(let i=1;i<Number(init[0]);i++) {
	  const xy = input[i].split(' ');
	  if(Math.sqrt((Number(xy[0])^2) + (Number(xy[1])^2)) <= Number(init[1])) c++;
    }
  console.log(c);
 
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const main = (stdin) => {
    const input = stdin.split("\n");
    const { count, distance } = Number(input[0].split(' '));
  	
    let c = 0;
  	for(let i=1;i<count;i++) {
	  const { x, y } = input[i].split(' ');
	  if(Math.sqrt(x^2 + y^2) <= distance) c++;
    }
  console.log(c);

}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	. "fmt"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func main() {
	buf := make([]byte, 4096)
	_i := len(buf)
	rc := func() byte {
		if _i == len(buf) {
			os.Stdin.Read(buf)
			_i = 0
		}
		b := buf[_i]
		_i++
		return b
	}
	r := func() (x int) {
		b := rc()
		neg := false
		for ; '0' > b ; b = rc() {
			if b == '-' {
				neg = true
			}
		}
		for ; '0' <= b; b = rc() {
			x = x*10 + int(b&15)
		}
		if neg {
			return -x
		}
		return
	}
	n,d,s :=r(),r(),0
	d*=d
	for ; n > 0; n-- {
		if x,y:=r(),r(); x*x+y*y <= d {
			s++
		}
	}
	Print(s)
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)

	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	sc.Scan()
	d, _ := strconv.Atoi(sc.Text())

	var ans int
	for i := 0; i < n; i++ {
		sc.Scan()
		f, _ := strconv.Atoi(sc.Text())
		sc.Scan()
		s, _ := strconv.Atoi(sc.Text())
		if d >= int(math.Ceil(math.Sqrt(float64((f*f)+(s*s))))) {
			ans++
		}

	}
	fmt.Println(ans)
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func newInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {

	var n, cnt, d int
	sc.Split(bufio.ScanWords)
	n = newInt()
	d = newInt()
	d = d * d
	for i := 0; i < n; i++ {
		x := newInt()
		y := newInt()
		if x*x+y*y <= d {
			cnt++
		}
	}
	fmt.Println(cnt)
}
//  [go]
package main

import (
	"bufio"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextFloat() float64 {
	sc.Scan()
	v, _ := strconv.ParseFloat(sc.Text(), 64)
	return v
}

func nextInt() int64 {
	sc.Scan()
	v, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return v
}

func main() {
	sc.Split(bufio.ScanWords)
	N := int(nextInt())
	D := nextFloat()
	ans := 0
	for i := 0; i < N; i++ {
		x := nextFloat()
		y := nextFloat()
		if x * x + y * y <= D * D {
			ans += 1
		}
	}
	println(ans)
}
//  [go]
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
  	p := strings.Split(scanner.Text())
	n, _ := strconv.Atoi(p[0])
	d, _ := strconv.Atoi(p[1])
	result := 0
	for i := 0; i < n; i++ {
		scanner.Scan()
      	p = strings.Split(scanner.Text())
		x, _ := strconv.Atoi(p[0])
		y, _ := strconv.Atoi(p[1])
      	v := int(math.Cbrt(float64(x*x + y*y)))
		if v < d {
			result++
		}
	}
	fmt.Println(result)
}
//  [go]
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	p := strconv.Atoi(scanner.Text())
	n, _ := strconv.Atoi(p[0])
	d, _ := strconv.Atoi(p[1])
	result := 0
	for i := 0; i < n; i++ {
		scanner.Scan()
		p = strconv.Atoi(scanner.Text())
		x, _ := strconv.Atoi(p[0])
		y, _ := strconv.Atoi(p[1])
      	v := int(math.Cbrt(float64(x*x + y*y)))
		if v < d {
			result++
		}
	}
	fmt.Println(result)
}
//  [ruby]
N,d,*P = $<.read.split.map &:to_i
D = d*d
p P.each_slice(2).count {|x,y| x*x + y*y <= D }
//  [ruby]
n,d=gets.split.map &:to_i
p$<.count{|e|x,y=e.split.map &:to_i
x*x+y*y<=d*d}
//  [ruby]
N,D = gets.split.map(&:to_i)
p $<.count{|ln|
	x,y = ln.split.map(&:to_i)
	x*x+y*y <= D*D
}
//  [ruby]
n,d=gets.split.map &:to_i
p$<.map{|e|x,y=e.split.map &:to_i
x*x+y*y<=d*d}
//  [ruby]
num, score = gets.chomp.split.map(&:to_i)
ans = 0
(1..num).each do |n|
  sum = gets.chomp.split.map(&:to_i).map{ |n| n**2}.sum
  if score**2 <= sum
    ans += 1
  end
end
puts ans
//  [ruby]
n,d = gets.split.map(&:to_i)
cnt = 0
for i in 0...n
  a,b = gets.split.map(&:to_i)
  if a*a+b*b<=d
    cnt += 1
  end
end

puts cnt
//  [rust]
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::Integer;
#[allow(unused_imports)]
use proconio::derive_readable;
use proconio::fastout;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::collections::*;

#[fastout]
fn main() {
    input! {
        n: usize,
        d: i64,
        ps: [(i64, i64); n],
    }
    let ans = ps
        .into_iter()
        .filter(|&(x, y)| x * x + y * y <= d * d)
        .count();

    println!("{}", ans);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        d: usize,
        p: [(isize, isize); n],
    }

    let mut ans = 0;
    for (x, y) in p {
        if x.pow(2) + y.pow(2) <= d.pow(2) as isize {
            ans += 1;
        }
    }
    println!("{}", ans);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize,
        d: i64,
        xy: [(i64, i64); n],
    };
    let ans = xy
        .iter()
        .filter(|(x_i, y_i)| x_i*x_i + y_i*y_i <= d*d)
        .count();
    println!("{}", ans);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        count: i32,
        target: i32,
        points: [(i32, i32); count]
    }

    let mut result = 0;
    for (x, y) in points {
        let distance = (((x*x) + (y*y)) as f64).sqrt();

        if target as f64 >= distance {
            result += 1;
        }
    }

    println!("{}", result);
}
//  [rust]
use std::io::*;
use std::str::FromStr;

fn main() {
    let n: u32 = read();
    let d: u32 = read();
    let mut count: u32 = 0;
    for i in 0..n {
        let x: i32 = read();
        let y: i32 = read();
        let tmp = x.pow(2) + y.pow(2);
        if (tmp as f32).sqrt() <= (d as f32) {
            count+=1
        }
    }
    println!("{}", count)
}

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

fn main() {
    input! [
	N: i32,
	D: f32,
    ];

    let mut ans = 0;
    for i in 0..N {
	input![
	    X: f32,
	    Y: f32,
	];
	let tmp = X * X + Y * Y;
	let dist = tmp.sqrt();
	if dist <= D {
	    ans += 1;
	}
    }
    println!("{}", ans);
}
//  [swift]
import Foundation

func main() {
    let input1 = readLine()!.split(separator: " ")
    let n = Int(input1[0])!
    let d = Double(input1[1])!
    
    var count = 0
    for _ in 1...n {
        let input = readLine()!.split(separator: " ")
        let x = Double(input[0])!
        let y = Double(input[1])!
        let distance = sqrt(pow(x, 2) + pow(y, 2))
        if distance <= d {
            count += 1
        }
    }
    print(count)
}
 
main()
//  [swift]
import Foundation
let input = readLine()!
let inputs: [String] = input.components(separatedBy: " ")
let times = Int(inputs[0])!
let limit = Int(inputs[1])!
var count: Int = 0
for _ in 0..<times {
  let xy = readLine()!
  let x = Int(x)!
  let y = Int(y)!
  if(sqrt(x*x+y*y) <= limit){
    count += 1
  }
}
print(count)
//  [swift]
func main() {
    let input1 = readLine()!.split(separator: " ")
    let n = Int(input1[0])!
    let d = Double(input1[1])!
    
    var count = 0
    for _ in 1...n {
        let input = readLine()!.split(separator: " ")
        let x = Double(input[0])!
        let y = Double(input[1])!
        let distance = sqrt(pow(x, 2) + pow(y, 2))
        if distance <= d {
            count += 1
        }
    }
    print(count)
}

main()
//  [swift]
import Foundation

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func mainB() {
    let (N, D) = readTwoInts()

    var count = 0
    for i in 0..<N {
        let (x, y) = readTwoInts()

        if Float((x * x) + (y * y)).squareRoot() <= Float(D) {
            count += 1
        }
    }

    print(count)
}
mainB()
//  [typescript]
import * as fs from "fs";

function strArr2numArr(strArr: string[]): number[] {
    let numArr: number[] = [];
    strArr.map((item) => {
        numArr.push(+item);
    });
    return numArr;
}

const MOD: number = 1e9 + 7;

const input = fs.readFileSync("/dev/stdin", "utf8").split("\n");

let n: number;
let d: number;
let x: number[] = [];
let y: number[] = [];

input.map((line, i) => {
    var [a, b] = line.split(" ");
    if (i == 0) {
        n = +a;
        d = +b;
    } else if (i <= n) {
        x.push(+a);
        y.push(+b);
    }
});

let ans: number = 0;
for (let i = 0; i < n; i++) {
    if (x[i] * x[i] + y[i] * y[i] <= d * d) ans++;
}
console.log(ans);
//  [typescript]
{
  const run = (input: string) => {
    let split = input.trim().split("\n")
    const [n, d] = split[0].split(" ").map(v => parseInt(v))

    let count = 0

    for (let i = 1; i <= n; i++) {
      const [a, b] = split[i].split(" ").map(v => parseInt(v))
      if (Math.sqrt(a ** 2 + b ** 2) <= d) count++
    }

    return count
  }

  const Main = (input: string) => {
    console.log(run(input))
  };

  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [typescript]
{
  const lines = [];
  const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout,
  });

  reader.on('line', function (line) {
    lines.push(line);
  });
  reader.on('close', function () {
    const input1 = (lines[0] as string).split(' ');
    const N: number = Number(input1[0]);
    const D: number = Number(input1[1]);
    let count = 0;
    for (let i = 1; i <= N; i++) {
      const input = (lines[i] as string).split(' ');
      const X: number = Number(input[0]);
      const Y: number = Number(input[1]);
      const distance2: number = X * X + Y * Y;
      if (distance2 <= D * D) count += 1;
    }
    console.log(count);
  });
}
//  [typescript]
import { readFileSync } from 'fs'
import { reverse } from 'dns'
import { start } from 'repl'
 
let lines: string[] = [];
const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
 
reader.on('line', function (line: string) {
    lines.push(line);
});
reader.on('close', function () {
    let [n, d] = lines[0].split(' ').map( _ => parseInt(_))
    let ans = 0

    for(let i = 0; i < n; i++) {
        let[x, y] = lines[i+1].split(' ').map( _ => parseInt(_))
        if(d * d <= x * x + y * y) ans++
    }
    console.log(ans)
});
//  [python]
s = str(input())
print(s[::2])
//  [python]
import sys
a = sys.stdin.readline().strip()
print (a[::2])
//  [python]
s=input()

print(s[0::2])
//  [python]
s = input()
odd_num = list()

for i in range(len(s)):

    if i % 2 == 0:
        odd_num.append(s[i])

answer = ''.join(odd_num)
print(answer)



s = input()
print(s[::2])
//  [python]
OddString
//  [python]
s = input()
x = ''
for i in range(0, len(s)):
    if i % 2 != 0:
        x = x + s[i]
print(x)
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn Agrawal coderbond007  PLEASE!! PLEASE!! HACK MY SOLUTION!!
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            char[] s = in.nextString().toCharArray();
            int n = s.length;
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < n; i += 2) {
                stringBuilder.append(s[i]);
            }
            out.println(stringBuilder.toString());
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = pread();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        private boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        private static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}
//  [java]
import java.util.*;
public class Main{
  	public static void main (String [] args){
      	Scanner scanner = new Scanner (System.in);
        String in = scanner.next();
     	String out = "";
      	for (int i = 0; i < in.length; i+=2){
          	out = out + in.charAt(i);
        }
      	System.out.println(out);
    }
}
//  [java]
import java.util.*;
public class Main{
  	public static void main (String [] args){
      	Scanner scanner = new Scanner (System.in);
        String in = scanner.next();
     	String out = "";
      	for (int i = 0; i < in.length; i+2){
          	out = out + in.charAt(i);
        }
      	System.out.println(out);
    }
}
//  [java]
import java.io.*;
public class Main {

	public static void main(String[] args)throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
		
		String StartString = br.readLine();
		char[]arr = StartString.toCharArray();
		for(int i =0; i<StartString.length(); i++) {
			if(i%2 == 0) {
				System.out.println(arr[i]);
			}
		}
		System.out.println();
	}

}
//  [cpp]
//ID:computerbox --> Hajiyev Huseyn
#include <bits/stdc++.h>
#define FAST_READ ios_base::sync_with_stdio(false);
#define in freopen("input.txt", "r", stdin);
#define out freopen("output.txt", "w", stdout);
#define ll long long
#define debt(x,y)cout<<"#x = "<<(x)<<" and "<<"#y = "<<(y)<<endl;
#define deb(x)cout<<"#x = "<<(x)<<endl;
#define COUT(n, a) cout<< fixed << setprecision(a) << n<<endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define arr(a,n) for(ll i=1;i<=n;i++) cout<<a[i]<<" "; cout << "\n";
#define vecc(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout << "\n";
#define CURTIME() cerr << clock() * 1.0 / CLOCKS_PER_SEC << endl
#define DTIME(ccc) __begin = clock(); ccc; cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<endl;
#define MAXN 200010

using namespace std;

string nujno;
string odd="";

int main(){
FAST_READ;
cin>>nujno;
for(ll i=0;i<nujno.size();i++)
{
	ll id=i+1;
	if(id%2!=0)
	{
		odd+=nujno[i];
	}
}

cout<<odd<<endl;




return 0;
}
//  [cpp]
#include<cstdio>
#include<cstring>
using namespace std;
int i,l;
char s[100010];
int main()
{
	scanf("%s",s);
	l=strlen(s);
	for (i=0;i<l;i++)
	{
		if (i%2==0) printf("%c",s[i]);
	}
	printf("\n");
}
//  [cpp]
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector> 
#include <cstring>
#include <queue>
#include <ctime>
#include <set>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const ll INF = 10e16;
const int maxN = 100010;
const int maxD = 400;
const int maxH = 100; 
const int MOD = 1000000007;

char a[maxN];
char b[maxN];
ll ps[maxN];
ll ss[maxN];
ll sum[maxN];
int main()
{
	scanf("%s",a+1);
	int n = strlen(a+1);
	int j = 1;
	for(int i=1;i<=n;i+=2)
	{
		b[j] = a[i];
		j++;
	}
	puts(b+1);
	return 0;
}
//  [cpp]
#include <array>
#include <iostream>
#include <vector>

int main()
{
    std::string s;
    std::cin >> s;
    for (int a = 1; a < s.size(); a += 2) {
        std::cout << s.at(a);
    }
    std::cout << std::endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() { 
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s; int ss=0;
  cin>>s;
  for(int i=1;i<=s.size();i+=2) { 
    ss+=s[i];
    }
  cout<<ss<<endl;
  
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main() { 
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s,ss;
  cin>>s;
  for(int i=1;i<=s.size();i+=2) { 
    ss+=s[i];
    }
  cout<<ss<<endl;
  
  return 0;
}
//  [c]
#include <stdio.h>

#define STRING_LENGTH 100000
#define ARRAY_SIZE (STRING_LENGTH + 1)

void printOdds(char s[ARRAY_SIZE]);


int main()
{
  char s[ARRAY_SIZE];

  scanf("%s", &s);

  printOdds(s);

  return 0;
}

void printOdds(char s[ARRAY_SIZE])
{
  int i;

  i = 0;
  while (s[i] != '\0')
    {
      printf("%c", s[i]);
      i++;
      if(s[i] == '\0')
	{
	  break;
	}
      i++;
    }
  printf("\n");
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

int main() {

    char s[100001];
    scanf("%s", s);

    int l = strlen(s);
    for (int i = 0; i < l; i += 2) {
        printf("%c", s[i]);
    }

    return 0;

}
//  [c]
#include <stdio.h>

int main(void)
{
  char s[100001];
  scanf("%s",s);
  
  for(int i = 0;s[i]!='\0';i++){
    if(i%2==0){
    printf("%c",s[i]);
   }
  }

  
  return 0;
}
//  [c]
#include<stdio.h>
#include<string.h>
int main(void){
  int i;
  char s[100001];
  char t[50001];
  
  scanf("%s",s);
  
  int lt=(strlen(s)+1)/2;
  
  for(i=0;s[i]!='\n';i++){
    if(i%2==0){
      t[(int)i/2]=s[i];
    }
  }
  
  t[lt]='\0';
  
  printf("%s",t);
  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int i;
  char s[100001];
  char t[50001];
  
  scanf("%s",s);
  
  for(i=0;s[i]!='\n';i++){
    if(i%2==0){
      t[(int)i/2]=s[i];
    }
  }
  
  printf("%s",t);
  return 0;
}
//  [c]
#include<stdio.h>
int main(void){
  int i;
  char s[100001];
  
  scanf("%s",s);
  
  for(i=0;s[i]!='\n';i++){
    if(i%2==0)printf("%c",s[i]);
  }
  
  return 0;
}
//  [javascript]
function Main(input) {
	input = input.split(" ");
	var x = input[0];
    
    var num = x.length;
    var count = Math.ceil(num/2);
    
    var ans = [];
    for(var i = 0; i < count; i++){
        var kisu = x[i*2];
        ans.push(kisu);
    }
    
    ans = ans.join("");
    console.log(ans);
    
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
  var s = input.split("\n")[0];
  var oddstr = "";
  for(var i = 0; i < s.length; i++) if((i + 1) % 2 === 1) oddstr += s[i];
  console.log(oddstr);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

function Main(args){
    const input = args.split("\n");
  	const tmp = input[0];
    var result = '';

    for(var i=0; i<tmp.length; i++){
        result += (i%2 == 0 ? tmp[i] : '');
    }

    console.log(result);
}
//  [javascript]
function Main(input){
	input = input.split("");
	var ans = ""
	for(var i=0;i<input.length;i++){
		if(i%2==1) ans += input[i];
	}
  console.log(ans)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function main(input) {
  input=input.trim();
  var s=input
  var ans=[]
  for(var i=0; i<Math.floor(s.length/2)+Math.floor(s.length%2); i++){
    ans.push(s.substr(i*2+1,1))
  }
  console.log(ans.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function Main(input){
	var tmp = input.split("");
	var count = 0;
	while(count<tmp.length){
		console.log(tmp[count]);
		count += 2;
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	strByte := make([]byte, 100000)
	readLen, _ := reader.Read(strByte)
	ans := make([]byte, 0, readLen/2)
	for i := 0; i < readLen; i += 2 {
		ans = append(ans, strByte[i])
	}
	fmt.Println(string(ans))
}
//  [go]
package main

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

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 100000)
	strByte := make([]byte, 100000)
	readLen, _ := reader.Read(strByte)
	ans := make([]byte, 0, readLen/2)
	for i := 0; i < readLen; i += 2 {
		ans = append(ans, strByte[i])
	}
	fmt.Println(string(ans))
}
//  [go]
package main

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

var reader = bufio.NewReader(os.Stdin)

func nextLine() string {
	var buf, line []byte
	isPrefix := true
	var err error
	for isPrefix {
		buf, isPrefix, err = reader.ReadLine()
		if err != nil {
			panic(err)
		}
		line = append(line, buf...)
	}
	return string(line)
}
func main() {
	s := nextLine()
	l := len(s)/2 + 1
	if len(s)%2 == 0 {
		l = len(s) / 2
	}
	bs := make([]byte, l)
	for i := 0; i < len(s); i += 2 {
		bs[i/2] = s[i]
	}
	fmt.Println(string(bs))
}
//  [go]
package main

import "fmt"

func main() {
	var str string

	fmt.Scanf("%s", &str)
	strRune := []rune(str)

	for i := 1; i < len(str); i += 2 {
		fmt.Print(string(strRune[i]))
	}
	fmt.Print("\n")
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	s := next()
	ans := ""
	for i := 0; i < len(s); i += 2 {
		ans += string(s[i])
	}
	fmt.Println(ans)
}
//  [ruby]
s = gets.chomp
d = ""
for i in 0..s.length-1
  if i.even? 
    d << s[i]
  end
end
puts d
//  [ruby]
s=gets.to_s
ss=''
s.size.times do |i|
  ss<< s[i] if i.even?
end
puts ss
//  [ruby]
s = gets.chomp
0.step(s.size - 1, 2) do |i|
    print s[i]
end
puts ""
//  [ruby]
puts gets.chomp.split('').map.with_index{|s,i|i%2==0&&s}.compact.join
//  [ruby]
s = gets.chomp.chars
ans = []
s.each.with_index |chr,id|
  if id % 2 == 0
    ans << chr
  end
end
puts ans.join
//  [ruby]
n = gets.chomp.split(" ")
arr = []
n.each_with_index do |item,j|
  if j % 2 == 0
    arr << item
  end
end
puts arr.join("")
//  [rust]
use std::io::*;

fn main() {
    let mut s: String = String::new();
    stdin().read_to_string(&mut s).ok();
    println!(
        "{}",
        s.char_indices()
            .filter(|&(i, _)| i % 2 == 0)
            .map(|(_, c)| c)
            .collect::<String>()
    );
}
//  [rust]
use std::str::FromStr;

fn get_one<T : FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    return s.trim().parse().ok().unwrap();
}

fn main() {
    let s : String = get_one();
    let mut t = "".to_string();
    let mut i = 0;
    for x in s.chars() {
        if i % 2 == 0 {
            t.push(x);
        }
        i += 1;
    }
    println!("{}", t);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        s: chars,
    };
    // println!("{}", s.iter().step_by(2).collect::<String>());
    let ans: String = s
    .iter()
    .enumerate()
    .filter(|&(i, _)| i % 2 == 0)
    .map(|(_, v)| v)
    .collect();
    println!("{}", ans);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        s: chars,
    };
    // println!("{}", s.iter().step_by(2).collect::<String>());
    let ans: String = s
    .iter()
    .enumerate()
    .filter(|&(i, _)| i % 2 == 0)
    .map(|(_, v)| v)
    .collect::<String>();
    println!("{}", ans);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        s: chars,
    };
    // println!("{}", s.iter().step_by(2).collect::<String>());
    println!("{}",
    s
    .iter()
    .enumerate()
    .filter(|&(i, _)| i % 2 == 0)
    .map(|(_, v)| v)
    .collect::<String>());
}
//  [swift]
print(readLine()!.map { String($0) }.enumerated().filter { ($0.0+1) % 2 != 0 }.map { $0.1 }.joined())
//  [swift]
let s = readLine()!
for (i,c) in s.characters.enumerate() {
    if i % 2 == 0 {
        print(c,terminator:"")
    }
}
print("")
//  [swift]
for (i,c) in readLine()!.characters.enumerate(){if i%2<1{print(c,terminator:"")}}
//  [swift]
import Foundation
let a = readLine()!

var text = ""
for i in stride(from: 0, to: a.count, by: 2) {
var b = a.index(a.startIndex, offsetBy: i)
    text += String(a[b])
}
print(text)
//  [swift]
import Foundation
let a = readLine()!
var text = ""

for i in stride(from: 0, to: a.count, by: 2) {
var b = a.index(a.startIndex, offsetBy: i)
    text += String(a[b])
}
print(text)
//  [swift]
let TestString = readLine()!

var i = 0
while i < TestString.count {
let ShiftOneTestString = TestString.index(TestString.startIndex, offsetBy: i)
let SecondCharacter = TestString[ShiftOneTestString]
    print(SecondCharacter, terminator: " ")
i += 2

}
//  [typescript]
"use strict";

main(require("fs").readFileSync("/dev/stdin", "utf8"));

function main(input) {
  const s = input;

  let ans = "";
  for (let i = 0; i < s.length; i++) {
    if (i % 2 === 0) {
      ans += s[i];
    }
  }
  console.log(ans);
}
//  [typescript]
const log = console.log;

// ----

function Main(input: string): void {
  const characters = input.trim();
  const len = characters.length;
  let newStr = "";

  for (let i = 0; i < len; i += 2) {
    newStr += characters[i];
  }

  log(newStr);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const ceil=(a)=>{return Math.ceil(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const sw=(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]};const near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const gojo=(a:number,b:number):number=>{if(a%b===0)return b;return gojo(b,a%b)};const deduplicate=(a:number[])=>{return Array.from(new Set(a))};
const main=()=>{
  let s=ts(),ans=''
  for(let i=0;i<s.length;i++){
    if(i%2==0){
      ans+=s[i]
    }
  }
  to(ans)
}
main()
//  [typescript]
"use strict";
const App6 = (arg: any) => {
  const value = arg.trim();
  const length = value.length;
  let result;
  for (let i = 0; i < length; i += 2){
    let result = value[i];
  }
  console.log(result);
};

App6(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [python]
a,b,n=map(int,input().split())

if b-1<=n:
  x=b-1
else:
  x=n
  
print(str((a*x)//b-a*(x//b)))
//  [python]

import math



a,b,n=map(int, input().split()) 

x = 1

num = math.floor(n/b)

if num == 0:
    x = n
    print(math.floor(a*x/b)-a*math.floor(x/b))
    exit()
if num >= 100000:
    print(b-1)
    exit()
else:
    ans = 0
    for i in range(1,num+1):
        x = b*i-1
        ans = max(ans,math.floor(a*x/b)-a*math.floor(x/b))
print(ans)
//  [python]
# -*- coding: utf-8 -*-
A,B,N = map(int, input().split())

def function(x):
  return (A*x)//B-A*(x//B)

if B-1<=N:
  print(function(B-1))
else:
  print(function(N))
//  [python]
import math
a,b,n = map(int,input().split())
maxx = n//b
ans = 0
for i in range(min(maxx,10**7)):
    x = b*(maxx-i)-1
    ans = max(math.floor(a*x/b)-a*(math.floor(x/b)),ans)
ans = max(math.floor(a*n/b)-a*(math.floor(n/b)),ans)
print(ans)
//  [python]
import math
a,b,n = map(int,input().split())
maxx = n//b
ans = 0
for i in range(min(maxx,10**6)):
    x = b*(maxx-i)-1
    ans = max(math.floor(a*x/b)-a*(math.floor(x/b)),ans)
ans = max(math.floor(a*n/b)-a*(math.floor(n/b)),ans)
print(ans)
//  [python]
import math
a,b,n = map(int,input().split())
maxx = n//b
ans = 0
for i in range(min(maxx,10**8)):
    x = b*(maxx-i)-1
    ans = max(math.floor(a*x/b)-a*(math.floor(x/b)),ans)
ans = max(math.floor(a*n/b)-a*(math.floor(n/b)),ans)
print(ans)
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader s = new FastReader();
        long a=s.nextLong();
        long b=s.nextLong();
        long n=s.nextLong();
        System.out.println((a*Math.min(n,b-1))/b);
    }

    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

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

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}
//  [java]
import java.util.*;
import java.io.*;

public class Main {	

	private static void solve(){
		//Implement solution here.
		long A = nl();
		long B = nl();
		long N = nl();
		long result = -1L;
		long x = Math.min(N, B - 1);
		result = (A * x / B) - A * (x / B);
		//result = Math.max(v ,result);
		
		System.out.println(result);
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();	
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();			
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			} 
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}
//  [java]
import java.math.BigInteger;
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] split = in.readLine().split(" ");
        int A = Integer.parseInt(split[0]);
        long B = Long.parseLong(split[1]);
        long N = Long.parseLong(split[2]);
        long X = -1;
        if(N < B) {
            X = N;
        } else {
            X = B - 1;
        }
        System.out.println((long)(Math.floor((A * X) / B) - A * Math.floor(X / B)));
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long n = sc.nextLong();
        long ans = 0;
        for (long i = 1; i <= n; i++) {
            long tmp1 = (a * i) / b;
            long tmp2 = a * (i / b);
            long tmp3 = tmp1 - tmp2;
            ans = Math.max(ans, tmp3);
        }
        System.out.println(ans);
    }
}
//  [cpp]
#include<stdio.h>
#include<algorithm>

using namespace std;

long long inp_n1, inp_n2, inp_n3, i1;

long long readNumber() {
	long long temp_func;
	scanf("%lld", &temp_func);
	return temp_func;
};
long long printNumber(long long temp_func) {
	printf("%lld", temp_func);
	return 0;
};

long long caler() {
	
	return inp_n1 * min(inp_n2 - 1, inp_n3) / inp_n2;
	
};

int main() {
	
	inp_n1 = readNumber();
	
	inp_n2 = readNumber();
	
	inp_n3 = readNumber();
	
	printNumber(caler());
	
}
//  [cpp]
#include<stdio.h>
int main()
{
	int a;
	long long b,n;
	scanf("%d%lld%lld",&a,&b,&n);
	if(n>=b)
	{
		printf("%lld\n",(long long)(a*(b-1)/b));
		
	 } 
	else
	{
		printf("%lld\n",(long long)(a*n/b));
	}
	
	return 0;
}
//  [cpp]
#include <cstdio>

long long a, b, n;

int main() {
    scanf("%lld%lld%lld", &a, &b, &n);
    long long x = n < b ? n : b - 1;
    printf("%lld\n", a * x / b - x / b * a);
    return 0;
}
//  [cpp]
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    long long a, b, n, tmp, ans=0;
    cin >> a >> b >> n;

    for(int i=0; i<=n; i++){
        tmp = floor( a*i / b ) - a * floor( i / b );
        ans = max(tmp,ans);
    }
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    long long a, b, n;
    cin >> a >> b >> n;
    long long ans = floor( a*n / b ) - a * floor( n / b );
    cout << ans << endl;
    return 0;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int A,B,N;
  cin >> A >> B >> N;
  cout << N/(abs(A-B)) << endl;
}
//  [c]
#include<stdio.h>
int main(void)
{
  long long a,b,n,x;
  scanf("%lld %lld %lld",&a,&b,&n);
  if(b>n){
    x=n;
  }else{
    x=b-1;
  }
  printf("%lld\n",((a*x)/b)-(a*(x/b)));
  return 0;
}
//  [c]
#include<stdio.h>

int main()
{
  long long int a,b,n;
  scanf("%lld %lld %lld",&a,&b,&n);
  printf("%lld",((n<b)?(a*n/b):(a*(b-1)/b)));
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
typedef long long ll;

int main()
{
	ll A,B,N;
	scanf("%lld %lld %lld", &A,&B,&N);
	ll i = N;
	ll x;
	ll n;
	ll max = LLONG_MIN;
	ll sum;
	while (i >= N - 2)
	{
		sum = (A*i/B) - A * (i/B);
		if (sum >= max)
		{
			x = i;
			max = sum;
		}
		i--;
	}
	x = B - 1;
	if (N >= B - 1 && (A*x/B) - A * (x/B) > max)
		max = (A*x/B) - A * (x/B);
	printf("%lld\n", max);
	return (0);
}
//  [c]
#include <stdio.h>
#include <math.h>
int main(void){
  long long a,b,n,k,i;
  scanf("%lld %lld %lld",&a,&b,&n);
  k= floor((long double)a*n/b);
  if(b==1){
    printf("0");
    return 0;
    } else if(n<b) {
      printf("%lld",k);
      return 0;
    }else{
      for(i=n;i>=n-b;i--){
        if(i%b==b-1){
          k= floor((long double)a*(i)/b)-floor((long double)i/b);
          printf("%lld",k);
          return 0;
        }
      }
    }
}
//  [c]
#include <stdio.h>
#include <math.h>
int main(void){
  long long a,b,n,k,i;
  scanf("%lld %lld %lld",&a,&b,&n);
  k= floor((long double)a*n/b);
    if(n<b) {
      printf("%lld",k);
      return 0;
    }else{
      for(i=n;i>=n-b;i--){
        if(i%b==b-1){
          k= floor((long double)a*(i)/b)-floor((long double)i/b);
          printf("%lld",k);
          return 0;
        }
      }
    }
}
//  [c]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 1000000000001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

int main(void) {
	long long A, B, N;
	scanf("%lld %lld %lld", &A, &B, &N);

	long long max = 0;
	for (long long x = 1; x <= N; x++) {
		long long tmp = A * x / B - A * (x / B);
		max = max(tmp, max);
	}
	printf("%lld\n", max);
  return 0;
}
//  [javascript]
const main = (str) => {
    const [A,B,N] = str.split(' ');
    const b = B>N ? N : B-1;
    const result = Math.floor(A*b/B);
    console.log(result);
};

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
function main(input) {
  let a,b,n;
  [a, b, n] = input[0].trim().split(" ").map(i => parseInt(i));

  
  let max = -100000000;
  if(n>=b){
    max = Math.floor(a*(b-1)/b) - (a * Math.floor((b-1)/b));
  }else{
    max = Math.floor(a*n/b) - (a * Math.floor(n/b));
  }
  console.log(max);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));
//  [javascript]
function Main(input){
  input = input.split(' ').map(x=>BigInt(x));
  var a = input[0];
  var b = input[1];
  var n = input[2];
  if (b==1){
    var max = 0n;
  }else if (n<b){
    var max = a*n/b - a*(n/b);
  }else{
    var border = (n+1n)/b;
    var t = 1n;
    var max = 0n;
    for (let t = 1n;t<=border;t++){
      var now = a*(b*t-1n)/b - a*((b*t-1n)/b);
      if (now > max){
        max = now;
      }
    }
  }
  console.log(max.toString())
}
  

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
const [A, B, N] = lines[0].split(' ').map(Number)

let ans = 0
for (let x = 0; x <= N; x++) {
    const res = Math.floor(A * x / B) - A * Math.floor(x / B)
    ans = Math.max(ans, res)
}

console.log(ans)
//  [javascript]
function MainD(input){
    const [A, B, N] = input.split(' ');
    const answer1 = Math.floor((A * N)/B) - A *  Math.floor(N/B);
    const answer2 = Math.floor((A * (N-1))/B) - A *  Math.floor((N-1)/B);
    console.log(answer1 > answer2 ? answer1 : answer2);
}
MainD(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function MainD(input){
    const [A, B, N] = input.split(' ');
    const answer = Math.floor((A * N)/B) - A *  Math.floor(N/B);
    console.log(answer);
}
MainD(require("fs").readFileSync("/dev/stdin", "utf8").trim());