11068 - An Easy Task


Difficulty : easy

Solution Description :

Geometry Line Problem

You need to find intersection point from two line equation.

If the two line equation are
a1X + b1Y = C1 -----------------------------------(i)
a2X + b2Y = C2 -----------------------------------(ii)

From equation (i) you get
Y = (c1 - a1X) / b1 ------------------------------(iii)
From equation (ii) you get
Y = (c2 - a2X)/ b2 -------------------------------(iv)

So, 
=>(c1 - a1X) / b1 =  (c2 - a2X)/ b2
=>(c1 - a1X) *b2 =  (c2 - a2X) * b1
=> X = (b1c2 - b2c1) / (a2b1 - a1b2) ---------(v)

From equation (v) you get the value of X
And put the value of X to equation (iii) you got the value of Y

Print X and Y

Remember that if (a2b1 - a1b2)==0 then print No fixed point exists.