Read input in a single line and split the values into two variables x, y…