This page is still under construction.

Parts of this page are still being built. What you see may change.

Math Is an Online Lecture

Interview

Time limit1sMemory limit1024 MB

Summary
Given six integers defining two linear equations in two unknowns, solve the system and print the integer values of x and y.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Suhyeon is a middle school student living in the era of the Fourth Industrial Revolution. Because of COVID-19, Suhyeon attends a virtual school virtually and takes virtual lectures. Suhyeon's virtual teacher gives a lecture on how to solve a system of two equations with two unknowns and assigns the following problem as homework.

Compute the values of xx and yy in the following system of equations.
[\begin{cases}ax+by=c\dx+ey=f\end{cases}]

Suhyeon, who thought that in the era of the Fourth Industrial Revolution going to meet virtual friends is more worthwhile than sitting around doing homework, had no time to solve such a system of equations. Fortunately, homework submission for the virtual lecture works by typing numbers into blank boxes in a web page. Each box accepts only an integer between −999-999 and 999999. Help Suhyeon leave for the virtual world to meet virtual friends.

Input

The integers aa, bb, cc, dd, ee, ff are given in order, separated by spaces. (−999≤a,b,c,d,e,f≤999-999 \leq a,b,c,d,e,f \leq 999)

It is guaranteed that the input is given only when there is a unique (x,y)\left(x,y\right) satisfying the equations mentioned in the problem, and xx and yy are each integers between −999-999 and 999999.

Output

Print xx and yy, the answers to the problem, separated by a space.

Examples2

  1. Example 1

    Input
    1 3 -1 4 1 7
    
    Expected output
    2 -1
    
  2. Example 2

    Input
    2 5 8 3 -4 -11
    
    Expected output
    -1 2