Help the Commander in Chief

Problem Name:
Help the Commander in Chief
Site:Spoj
Links:
Tags:
Problem setters: