The problem is that there are possibly many solutions for this, with the most trivial ones being:
x = 1, y = 2501
x = 2501, y = 1
Otherwise you can use all factors that evenly divide the number:
x = 41, y = 61
x = 61, y = 41
There are solutions for finding all factors of a number - it's called "prime factorization", for example this answer:
def primes(n):
"""Copied from https://stackoverflow.com/a/16996439/5393381 (author: Daniel Fischer)"""
primfac = []
d = 2
while d*d <= n:
while (n % d) == 0:
primfac.append(d)
n //= d
d += 1
if n > 1:
primfac.append(n)
return primfac
>>> primes(2501)
[41, 61]
Note that all combinations of the result are potential solutions. For example for 16
there are these solutions:
>>> primes(16)
[2, 2, 2, 2]
So any of the following possibilities would match your requirement:
1 & 16
2 & 8
4 & 4
8 & 2
16 & 1
So you can't automate this because someone "needs to decide" which one to pick.