Problem Description
source:https://uva.onlinejudge.org/external/5/555.html
Many games, such as Bridge, involve dealing a standard deck of 52 cards to 4 players, so each receives 13 cards. Good players can then play with the hand as it is dealt, but most ordinary players will need to sort it, firstly by suit, and then by rank within suit.
There is no fixed ranking of the suits for this purpose, but it is useful to alternate the colours, so we will presume the following ordering: ♣ < ♢ < ♠ < ♡. (Note that from now on we will use the more conventional ‘C’, ‘D’, ‘S’, ‘H’ for CLUBS, DIAMONDS, SPADES and HEARTS). Within a suit Ace is high, so the ordering is 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < T < J < Q < K < A.
source:https://uva.onlinejudge.org/external/5/555.html
Many games, such as Bridge, involve dealing a standard deck of 52 cards to 4 players, so each receives 13 cards. Good players can then play with the hand as it is dealt, but most ordinary players will need to sort it, firstly by suit, and then by rank within suit.
There is no fixed ranking of the suits for this purpose, but it is useful to alternate the colours, so we will presume the following ordering: ♣ < ♢ < ♠ < ♡. (Note that from now on we will use the more conventional ‘C’, ‘D’, ‘S’, ‘H’ for CLUBS, DIAMONDS, SPADES and HEARTS). Within a suit Ace is high, so the ordering is 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < T < J < Q < K < A.