Language: C++

#include <bits/stdc++.h>
#define ref(i,n) for(long long i=0;i<n;i++)
using namespace std;
#define mo 1000000007

typedef pair<int,int> P;
set<P> v;
map<P,long long> mp;

long long gcd(long long m,long long n){
    if(m==0) return n;
    if(n==0) return m;
    if(n>m) return gcd(m,n%m);
    else return gcd(n,m%n);

    }

int main()
{
    int n;
    cin>>n;
    int a0=0,aa=0,a1=0,yy;

    ref(i,n){
        long double x,y;
        cin>>x>>y;
        if(!x&&!y){aa++;continue;}
        if(y==0) {a0++;continue;}
        if(x==0) {a1++;continue;}
        if(x<0){ x=-x;y=-y;}

        if(y>0) yy=y; else yy=-y;

        P p=P(x/gcd(x,yy),y/gcd(x,yy));

        if(v.find(p)!=v.end()) mp[p]++;
        else {mp[p]=1;v.insert(p);}
    }
    long long ans=1;


    auto j=v.begin();

    ref(i,v.size()){

        P t=*j,p;
        if(t.second<0) {
            p=P(-t.second,t.first);
        }
        else p=P(t.second,-t.first);

        if(v.find(p)!=v.end()){

            long long y1=1,y2=1;

            ref(k,mp[t]) y1=y1*2%mo;
            ref(k,mp[p]) y2=y2*2%mo;

            long long yy=(y1+y2-1)%mo;

            ans=ans*yy%mo;
            mp[t]=0;mp[p]=0;

        }
    j++;
    }


    auto i=mp.begin();

    ref(k,mp.size()){
        long long xx=1;
        ref(k,i->second) xx=xx*2%mo;
        ans=ans*xx%mo;
        i++;
    }



        long long y1=1,y2=1;

        ref(k,a0) y1=y1*2%mo;
        ref(k,a1) y2=y2*2%mo;

        long long ye=(y1+y2-1)%mo;

        ans=ans*ye%mo;



    ans+=aa;
    ans%=mo;
    if(ans==0) ans+=mo;
    cout<<ans-1;
    return 0;

}


Compiler output:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long double; _Nn = int; common_type_t<_Mn, _Nn> = long double]':
a.cc:34:20:   required from here
   34 |         P p=P(x/gcd(x,yy),y/gcd(x,yy));
      |                 ~~~^~~~~~
/usr/include/c++/14/numeric:175:21: error: static assertion failed: std::gcd arguments must be integers
  175 |       static_assert(is_integral_v<_Mn> && is_integral_v<_Nn>,
      |                     ^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:175:21: note: 'std::is_integral_v<long double>' evaluates to false
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In instantiation of 'struct std::make_unsigned<long double>':
/usr/include/c++/14/type_traits:2076:11:   required by substitution of 'template<class _Tp> using std::make_unsigned_t = typename std::make_unsigned::type [with _Tp = long double]'
 2076 |     using make_unsigned_t = typename make_unsigned<_Tp>::type;
      |           ^~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:182:24:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = long double; _Nn = int; common_type_t<_Mn, _Nn> = long double]'
  182 |       return __detail::__gcd<make_unsigned_t<_Ct>>(__m2, __n2);
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:34:20:   required from here
   34 |         P p=P(x/gcd(x,yy),y/gcd(x,yy));
      |                 ~~~^~~~~~
/usr/include/c++/14/type_traits:1929:13: error: invalid use of incomplete type 'class std::__make_unsigned_selector<long double, false, false>'
 1929 |     { using type = typename __make_unsigned_selector<_Tp>::__type; };
      |             ^~~~
/usr/include/c++/14/type_traits:1837:11: note: declaration of 'class std::__make_unsigned_selector<long double, false, false>'
 1837 |     class __make_unsigned_selector;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~