Ragu has given 3 integers A, B, and N to Dhamo.
Now Ragu asked Dhamo to calculate the maximum possible value of :
floor(Ax/B)-A × floor(x/B) for a non-negative integer ‘x’ not greater than ‘N’.
Here floor(t) denotes the greatest integer not greater than the real number ‘t’.
Can you help Dhamo ?
Input:
Input is given in the following format:
A B N
Output:
Print the output to calculate the maximum possible value of
floor(Ax/B)-A × floor(x/B)
for a non-negative integer 'x' not greater than 'N'.
#include <stdio.h> #define min(a,b) ((a)>(b)?(b):(a)) int main() { long a, b, n, y; scanf("%ld %ld %ld",&a,&b,&n); y=(double)a*min(b-1, n); y=y/(double)b; printf("%ld",y); return 0; }
INPUT_1:
11 8 14
OUTPUT:
9
INPUT_2:
28 49 36
OUTPUT:
20
ILLUSTRATION
Morae Q!
- Find how long will it take till the next fortune year from the current year.
- Find if it’s possible to distribute all the crayons into boxes and satisfy all the conditions.
- Compute sum of numbers using call by reference.
- Compute the amount of money to be handed over with conditions.
- Find the total number of beautiful triplets in the sequence.
- Find the total amount each worker has to pay individually.
- Find the minimum distance between any pair of equal elements in the array.
- Compute the maximum possible value of the given equation.
- Find the age of the student at the time of joining.
- Compute the total number of photos at each restaurant .
- Find the sum of digits of the number using Union datatype.
- Generate the details of the novels in the expected format.
- Sort the student details based on their names in ascending order.
- Find a way to move the king from current position to different square on chessboard.
- Find the time differences in the two different time zones.
- Identifying the greatest number with a numerator and denominator.
- Find the Minimum number of packages to supply all the bases.
- Tower of Hanoi, A puzzle.
- Compute the sum of array of elements using recursion method.
- Find the super digit of an integer using the rules.