Codeforce : Football

Problem Link : http://codeforces.com/problemset/problem/96/A

Solution :