During one particularly long ride to college, you find that your…
Question Answered step-by-step During one particularly long ride to college, you find that your… During one particularly long ride to college, you find that your wallet is empty because gas prices are climbing. As a now even more broke college student, you’re now considering taking the bus.Suppose you need to take n rides to college throughout the week. A bus ticket will give you m rides and cost you b dollars. Driving in your car costs you a dollars per ride.Find the minimum amount you need to spend in order to make n rides to college.Input FormatFour space separated integers n, m, a, bn: the number of rides you need to makem: number of rides a bus ticket will givea: cost per ride of driving your carb: cost of the bus ticketAlternatively, fill out the function brokeStudent that takes four parameters and returns an integer representing the minimum cost to make n ridesn: integerm: integera: integerb: integerConstraintsn, m, a, b are between 1 and 100 (inclusive)Output FormatPrint an integer representing the minimum amount you will need to spendSample Input 06 2 1 2Sample Output 06Explanation 0The minimum amount you can spend is six dollars for six rides.Option 1: You can take six rides in your car and spend one dollar each timeOption 2: You can get three bus tickets and spend two dollars each timeThere are other options, but it will always cost at least six dollars for six rides.Sample Input 15 2 2 3Sample Output 18 Explanation 1The minimum amount you can spend is eight dollars for five rides.You can buy two bus tickets for three dollars each (gives four rides) and then take your car (one ride) for two dollars. Image transcription text# ! /bin/python3 W N – import math 4import os 5 import random 6 import re7 import sys 8 9 # 10 # Co… Show more… Show more Image transcription text31 32 a = int(first_multiple_input[2]) 3334 b = int(first_multiple_input[3]) 35 36answer = brokeStudent (n,… Show more… Show more Computer Science Engineering & Technology Python Programming COMPUTER S 200 Share QuestionEmailCopy link Comments (0)


