How to compute a vector V when N points are given and V satisfies given properties


We are given N points P1,P2,…,PN in a 2D plane(All points are distinct and N is as large as 10^5). For each valid i, the coordinates of the point Pi are (xi,yi). Help me to find a vector V = (a, b) ( where |a|, |b| <= 1e9) such that the following holds:

For each i (1 ≤ i ≤ N), let Si= dot(V, G(Pi, Pi+1)). lets assume PN+1=P1. where G(v1, v2) = ((v2(x) – v1(x)), (v2(y) – v1(y)) and dot(V1, V2) denotes dot product of two vectors

How to choose V such that It is possible to find two integers l and r (1 ≤ l ≤ r ≤ N) such that:

Si < 0 if(i <= r and i >= l) and Si > 0 otherwise

(or)

Si > 0 if(i <= r and i >= l) and Si < 0 otherwise

I need to know if there is a way of choosing vector (a, b) to satisfy the above conditions(If the solution is possible)