How to Solve Prime modullo

x^2 = a mod p
y^2 = b mod p

the known values are x,y,a,b . we have to find p . p is a prime and ranges from 2 to 10^9 . I could not get any idea to solve . Even 30AC logic would be helpful . In return you will get CIRMERGE 100AC . If anyone happy to accept this offer DM me
the known values are x,y,a,b .

Nice. No more restrictions than 1 < p < 10e9?
that is the only restriction

So x=2, a=4, p=5, y=1, b=11 would be a valid set of "known values"? Or do you know x, y, a, and b but just don't tell?
> No more restrictions than 1 < p < 10e9?
p is prime

> Even 30AC logic would be helpful
¿what?

> In return you will get CIRMERGE 100AC
¿what? ¿can you eat that?

> I could not get any idea to solve
go to the definition of modulo
a = b mod m
that means that there exists an integer x such that
x*m + a = b
then you may solve for m
m = (b-a) / x
should be a small list: 10 xor 9 = 3
2 and 3 are both prime.
Last edited on
> > Even 30AC logic would be helpful
> ¿what?
It's another cheater involved in some programming competition.
Last edited on
¿and what's the difference with the usual homework questions?
There's no difference, IMO.
Homework is about learning to program.
Competition puzzles seem to be mostly math; apply rather than learn.

Minor difference.
Topic archived. No new replies allowed.