Codeforces: A. System of Equations, Python solution...
The problem is from codeforces:http://www.codeforces.com/problemset/problem/214/A Simple as that, the brute-force can pass the tests. The given ranges fornandmare acceptable for the simple brute-force algorithm.