SPOJ Samer08f, also known as "Feynman". stupid input errors