Given the sum and gcd of two numbers, return those two numbers in ascending order. If the numbers do not exist, return `-1`, (or `NULL` in C, `tuple (-1,-1)` in C#, `pair (-1,-1)` in C++,`None` in Rust, `array {-1,-1} ` in Java and Golang).

```
For example: 
Given sum = 12 and gcd = 4...

solve(12,4) = [4,8]. The two numbers 4 and 8 sum to 12 and have a gcd of 4.

solve(12,5) = -1. No two numbers exist that sum to 12 and have gcd of 5.

solve(10,2) = [2,8]. Note that [4,6] is also a possibility but we pick the one with the lower first element: 2 < 4, so we take [2,8].
```

More examples in test cases. 

Good luck!

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def solve(s,g):
	

Solutions:
def solve(s, g):
	return -1 if s % g else (g, s - g)


def solve(s, g):
	return not s % g and (g, s - g) or -1


def solve(s, g):
	if s % g != 0:
		return -1
	else:
		b = s - g
		a = g
		return (a, b)


import math

def solve(s, g):
	if s % g != 0:
		return -1
	else:
		for i in range(s // (2 * g) + 1):
			a = i * g
			b = s - a
			if math.gcd(i, int(b / g)) == 1:
				return (a, b)


import math

def solve(s, g):
	return (math.gcd(s, g), s - math.gcd(s, g)) if s % g == 0 else -1


def solve(s, g):
	f = []
	w = ()
	for i in range(0, s + 1):
		f.append(g * i)
	for i in f:
		if i + g == s:
			w = (g, i)
	return w or -1


def solve(s, g):
	lst = []
	for i in range(1, s):
		if i % g == 0:
			lst.append(i)
	for i in lst:
		if i + g == s:
			a = [i] + [g]
			a = sorted(a)
			return (a[0], a[1])
	return -1


def solve(s, g):
	from math import gcd
	return -1 if gcd(g, s - g) != g else (g, s - g)


def solve(s, g):
	if not s % g == 0:
		return -1
	else:
		return (g, int((s / g - 1) * g))


def solve(s, g):
	return [-1, (g, s - g)][s % g == 0]


def solve(s, g):
	if (s - g) % g == 0 and s != g:
		return (min(g, s - g), s - min(g, s - g))
	else:
		return -1


solve = lambda s, g: s % g and -1 or (g, s - g)


def solve(s, g):
	try:
		return tuple(sorted([[x for x in list(range(1, s)) if x % g == 0 and x + g == s][0], g]))
	except IndexError:
		return -1


def solve(s, gcd):
	if s % gcd:
		return -1
	for i in range(gcd, s):
		for j in range(gcd, s):
			if i + j == s and i % gcd == 0 and (j % gcd == 0):
				return (i, j)


import math

def solve(sum, gcd):
	for firstNumber in (number for number in range(1, sum) if number % gcd is 0):
		secondNumber = sum - firstNumber
		if secondNumber % gcd is 0:
			return (firstNumber, secondNumber)
	return -1


def solve(s, g):
	counter = 0
	for i in range(1, s + 1):
		j = s - i
		if j % g == 0 and i % g == 0:
			counter += 1
			res = (i, j)
			break
	if counter == 0:
		res = -1
	return res