1373

Problem ID: 1373

See also: UVa 12147, LA 4213, SPOJ SAMER08D