https://code.google.com/codejam/contest/8274486/dashboard
Simple. Each time, choose a smallest number x, remove x and 4x/3 in the array.
Simple. For people on odd position, it will turn right every exchange, where people on even position will turn left.
DP. dp[n] means valid words number.
Then, dp[0]=1, dp[1]=v, dp[n]=v*(dp[n-1]+c*dp[n-2]).
Random to generate 100000 strings!