TopCoder problem "ThreeCentCoin" used in SRM 22 (Division I Level Two , Division II Level Two)



Problem Statement

    
Class Name: ThreeCentCoin
Method Name: getChange
Parameters: int
Returns: int

Imagine a new 3-cent coin were introduced to our economy, revolutionizing how
change was given back to a customer. Create a class called ThreeCentCoin that
includes the method getChange(int) that takes an amount of change (cents) and
returns the minimum number of coins required to make it, using ONLY quarters,
dimes, nickels, the 3-cent coin, and pennies only. Here is the method signature:

public int getChange(int amount);

amount is a positive integer less than 1000.

Examples:
*If amount=9, change can best be given with three 3-cent coins (or a nickel,
penny, and 3-cent coin), and the method returns 3.
*If amount=10, change can be given with a dime, and the method should return 1.
*If amount=100, the method returns 4.
*If amount=898, the method returns 38 (35 quarters, 2 dimes, and 1 3-cent coin).
 

Definition

    
Class:ThreeCentCoin
Method:getChange
Parameters:int
Returns:int
Method signature:int getChange(int param0)
(be sure your method is public)
    

Problem url:

http://www.topcoder.com/stat?c=problem_statement&pm=140

Problem stats url:

http://www.topcoder.com/tc?module=ProblemDetail&rd=3021&pm=140

Writer:

Unknown

Testers:

Problem categories: