已知: x, y, m, n
依照題意: (1) a + b = m , (2) ax + by = n,a, b ∈ N,求 a, b
由(1): b = m - a 帶入(2)
得: ax + (m - a)y = n
整理過後: a = (n - my) / (x-y), b = m - a
若 a, b 的計算結果符合 a, b ∈ N ,則有解