Speed trap X10700


Statement
 

pdf   zip

html

Input The input is a series of records, ending with the # character.
Each record of the speed cameras has 3 values:

  • The initial letter of the city name (W for Whynot or Z for Zzyzx)
  • The measured speed of the car, expressed in mph (miles per hour)
  • The limit over which there is a law infringement

Output The output is the number of fines corresponding to each city, followed by a sentence saying which one is the winner of the award (see the sample output below). If both cities have the same amount of fines, the script will print “Whynot and Zzyzx inhabitants are equally safe at driving”.

Public test cases
  • Input

    W 60 75 
    Z 61 50 
    Z 64 38
    W 54 75
    Z 103 50
    Z 47 55
    #
    

    Output

    0 fines to Whynot
    3 fines to Zzyzx
    Whynot inhabitants are safer at driving than Zzyzx ones
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    C++
    User solutions
    C++ Haskell Python