Problem 121521 · easy · Phase 01 Prerequisites & Setup

Recipe Scaler

input · arithmetic · ratios · rounding · type conversion

A recipe is written for a certain number of servings, but you are cooking for a different number. Read three lines: the servings the recipe makes, the servings you want, and the grams of flour the recipe calls for. Print Flour: <g> g, where <g> is the scaled amount rounded to the nearest whole gram (a whole number, no decimal point).

Examples

Input:
4
6
300
Output:
Flour: 450 g
Input:
3
7
100
Output:
Flour: 233 g

Constraints

  • 1 <= recipe_servings, wanted_servings <= 100, 0 <= flour <= 10000
  • No test lands exactly halfway between two whole grams.

Goals

  • Scale a quantity by a ratio of servings
  • Round a float to the nearest whole number with round()
Starting Python…