SP15573 STC06 - Keyboard
Description
Byteman has received an extraordinary keyboard as a gift. The keyboard is a rectangle consisting of N rows and M columns with N\*M keys placed on it. Moreover, all keys except the one in the top left corner are covered with domino tiles of size 1 x 2, so there are (N\*M-1)/2 domino tiles in total. At any time, Byteman can move onto the free key one of the domino tiles adjacent to it by the shorter side. He can also press keys, but only if they are not covered.
Byteman would like to test (i.e., press) all the keys corresponding to vowels, that is, the letters a, e, i, o, u or y. What is the minimum number of tile moves necessary to do that?
Input
-----
The first line of the input contains two integers N and M (1
Input Format
N/A
Output Format
N/A