Total money to be paid after traveling the given number of hours | C # implementation of the above approach ; calculating hours travelled
using System ; class GFG { public static void Main ( ) { float m = 50 , n = 5 , x = 67 , h = 2927 ; int z = ( int ) ( Math . Ceiling ( ( h / 60 * 1.0 ) ) ) ; if ( z <= n ) Console . WriteLine ( z * m ) ; else Console . WriteLine ( n * m + ( z - n ) * x ) ; } }