This page is still under construction.

Parts of this page are still being built. What you see may change.

Provinces and Gold

Interview

Time limit1sMemory limit1024 MB

Summary
Given the counts of Gold, Silver, and Copper in a hand, find the best victory card and best treasure card Jake can afford with his total buying power.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Jake is learning how to play the card game Dominion. In Dominion, you can buy a variety of treasure, action, and victory point cards. At the end of the game, the player with the most victory points wins!

Each turn, each player draws 5 cards and can use their action and treasure cards to get buying power, which they spend on more cards. Since Jake is just starting out, he has decided to buy only treasure and victory point cards.

So the cards he can buy are:

  • Province (costs 88, worth 66 victory points)
  • Duchy (costs 55, worth 33 victory points)
  • Estate (costs 22, worth 11 victory point)

There are 3 kinds of treasure cards:

  • Gold (costs 66, worth 33 buying power)
  • Silver (costs 33, worth 22 buying power)
  • Copper (costs 00, worth 11 buying power)

At the start of Jake's turn, he draws 5 of these cards. Given the number of Golds, Silvers, and Coppers in his hand, calculate the best victory card and the best treasure card he can buy that turn. Jake can buy only one card.

Input

The input is a single test case on a single line, containing three non-negative integers GG, SS, CC (G+S+C≤5G + S + C \le 5). They are the number of Golds, Silvers, and Coppers Jake draws in his hand.

Output

Output the best victory card and the best treasure card Jake can buy this turn, separated with " or ", in this order. If Jake cannot afford any victory card, output only the best treasure card he can buy.

Hint

In Sample 1, Jake has 1 Silver in his hand, so his buying power is 2. That allows him to buy either an Estate or a Copper.

Examples3

  1. Example 1

    Input
    0 1 0
    
    Expected output
    Estate or Copper
    
  2. Example 2

    Input
    2 1 0
    
    Expected output
    Province or Gold
    
  3. Example 3

    Input
    0 0 1
    
    Expected output
    Copper