#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <random>
#include <stdio.h>
#include <fstream>
#include <functional>
#include <cassert>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
#define rep(i,n) for (int i=0;i<n;i+=1)
#define rrep(i,n) for (int i=n-1;i>-1;i--)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << " )\n";
template<class T>
using vec = vector<T>;
template<class T>
using vvec = vec<vec<T>>;
template<class T>
using vvvec = vec<vvec<T>>;
using ll = long long;
using ld = long double;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<class T>
bool chmin(T &a, T b){
if (a>b){
a = b;
return true;
}
return false;
}
template<class T>
bool chmax(T &a, T b){
if (a<b){
a = b;
return true;
}
return false;
}
template<class T>
T sum(vec<T> x){
T res=0;
for (auto e:x){
res += e;
}
return res;
}
template<class T>
void printv(vec<T> x){
for (auto e:x){
cout<<e<<" ";
}
cout<<endl;
}
template<class T,class U>
ostream& operator<<(ostream& os, const pair<T,U>& A){
os << "(" << A.first <<", " << A.second << ")";
return os;
}
template<class T>
ostream& operator<<(ostream& os, const set<T>& S){
os << "set{";
for (auto a:S){
os << a;
auto it = S.find(a);
it++;
if (it!=S.end()){
os << ", ";
}
}
os << "}";
return os;
}
template<class T0,class T1,class T2>
ostream& operator<<(ostream& os, const tuple<T0,T1,T2>& a){
auto [x,y,z] = a;
os << "(" << x << ", " << y << ", " << z << ")";
return os;
}
template<class T0,class T1,class T2,class T3>
ostream& operator<<(ostream& os, const tuple<T0,T1,T2,T3>& a){
auto [x,y,z,w] = a;
os << "(" << x << ", " << y << ", " << z << ", " << w << ")";
return os;
}
template<class T,class U>
ostream& operator<<(ostream& os, const map<U,T>& A){
os << "map{";
for (auto e:A){
os << e.first;
os << ":";
os << e.second;
os << ", ";
}
os << "}";
return os;
}
template<class T>
ostream& operator<<(ostream& os, const vec<T>& A){
os << "[";
rep(i,A.size()){
os << A[i];
if (i!=A.size()-1){
os << ", ";
}
}
os << "]" ;
return os;
}
using mint = modint998244353;
ostream& operator<<(ostream& os, const mint& a){
os << a.val();
return os;
}
void solve(){
int n,k;
cin>>n>>k;
long double pi = acos(-1);
vec<long double> xy_theta;
rep(i,n){
long double x,y;
cin>>x>>y;
long double r = sqrt(x*x+y*y);
x = x/r, y = y/r;
long double theta = acos(x);
if (0 < y){
xy_theta.push_back(theta);
}
else if (y == 0){
if (0 < x){
xy_theta.push_back(0);
}
else{
xy_theta.push_back(pi);
}
}
else{
xy_theta.push_back(2*pi-theta);
}
}
sort(all(xy_theta));
//debug(xy_theta);
if (n == 1){
cout << 2 * pi << "\n";
return ;
}
long double ans = 0;
rep(i,n){
if ((i+k) < n){
chmax(ans,xy_theta[i+k]-xy_theta[i]);
}
else{
chmax(ans,xy_theta[i+k-n]+2*pi-xy_theta[i]);
}
}
cout << ans << "\n";
}
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
cout << setprecision(15);
int T;
cin>>T;
while (T--){
solve();
}
}