#include
#define ll long long
using namespace std;
struct Point{
ll x,y;
Point(ll x=0,ll y=0):x(x),y(y){};
};
ll gcd(ll a,ll b)
{
return a==0?b:gcd(b%a,a);
}
bool cheak(ll op1,ll a,ll b){
if(a>b)
swap(a,b);
return op1>=a&&op1<=b;
}
Point point_of_intersection(Point f1,Point f2,Point f3,Point f4,bool &mark)
{
ll a1,a2,b1,b2,c1,c2,c3,c4,D,D1,D2;
a1=f2.y-f1.y;
a2=f1.x-f2.x;
b1=a1*f1.x+a2*f1.y;
///b1=(y2-y1)*x1+(x1-x2)*y1
c1=f4.y-f3.y;
c2=f3.x-f4.x;
b2=c1*f3.x+c2*f3.y;
///b2=(y4-y3)*x3+(x3-x4)*y3
c3=f2.x-f1.x;
c4=f4.x-f3.x;
D=c3*c1-c4*a1;
Point res;