/*
ID: divad151
PROG: pname
LANG: C++
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <queue>
#include <cassert>

using namespace std;

//------------------------------------------------------------------------------------------------------------------------
// CONSTANTS
//------------------------------------------------------------------------------------------------------------------------

#define PI          3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803   /* all from memory! */
#define PHI         1.6180339887498948482045868343656   /* = (sqrt(5)+1)/2  */
#define MAXINT      0x7fffffff                          /* for a signed integer */
#define EPSILON     0.00000001                          /* for floating-point value comparison */
#define MAXDOUBLE   1.79769313486231570e+308

#define NORTH       0
#define EAST        1
#define SOUTH       2
#define WEST        3

#define MS(a,b)     memset(a, b, sizeof(a))
#define FOR(a,b,c)  for (a = (b); a < (c); ++a)

const int fact[] = { 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600 }; // up to 12!
const int month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};  // lengths of each month


//------------------------------------------------------------------------------------------------------------------------
// GLOBAL VARIABLES
//------------------------------------------------------------------------------------------------------------------------

int dc[] = {  0,  1,  0, -1 };
int dr[] = { -1,  0,  1,  0 };
int cmax = -MAXINT;
int cmin = MAXINT;


//------------------------------------------------------------------------------------------------------------------------
// FUNCTIONS/CLASS DEFINITIONS
//------------------------------------------------------------------------------------------------------------------------







//------------------------------------------------------------------------------------------------------------------------
// MAIN PROGRAM EXECUTION
//------------------------------------------------------------------------------------------------------------------------
int main()
{
    ifstream fin("data5.txt");
    ofstream fout("out5.txt");
/*    int i = 0, j = 0, k = 0;
    int num, n1, n2, n3;
    string a, b;

    for(i=0;i<5;++i)
    {
        getline(fin,a);
        if (a.length()==0)
        {
           --i; 
           continue;
        }
        getline(fin,b);
        for (j=0;j<a.length();++j)
        {
            if (a[j] != b[j]) break;
        }
        fout << j << endl;
        cout << j << endl; cin.get();
    }
*/
    int number1,number2;
    string a;
    for (int i = 0; i < 5; i++)
    {
        fin >> number1 >>number2;
        for (int g = 0; g < number2; g++)
            getline (fin,a);
        
                getline (fin,a);
        fout << int (round(number1/(number2*PI*3))) << "\n";
    }


    return 0;
}



