Find the maximum possible value for the given periodic function | C ++ Program to find the maximum possible value for the given function ; Function to return the maximum value of f ( x ) ; Driver code
#include <iostream> NEW_LINE using namespace std ; int floorMax ( int A , int B , int N ) { int x = min ( B - 1 , N ) ; return ( A * x ) / B ; } int main ( ) { int A = 11 , B = 10 , N = 9 ; cout << floorMax ( A , B , N ) ; return 0 ; }