#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <map>
#include <iostream>
#include <iterator>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
// #include <bits/stdc++.h>
using namespace std;

// #define ls now << 1
// #define rs now << 1 | 1
#define PB push_back
// #define MP make_pair
// #define double long double
// #define int long long
// #define us unsigned
// #define LL long long
const int N = 1e5;
// const int M = 1.5e7;
#define re register
const int mod = 104857601;
const int inf = 0x3f3f3f3f;
const double inf_double = 1e4;
const double eps = 1e-4;
inline char nc()
{
    static char buf[1000000], *p1 = buf, *p2 = buf;
    return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
}
#define getchar nc
inline int read()
{
    register int s = 0;
    register bool neg = 0;
    register char c = getchar();
    for (; c < '0' || c > '9'; c = getchar())
        neg |= (c == '-');
    for (; c >= '0' && c <= '9'; s = s * 10 + (c ^ 48), c = getchar())
        ;
    return (neg ? -s : s);
}

int a, b, fa[N + 10];
bool vis[N + 10], vis1[N + 10];
vector<int> st[N + 10];

inline int f(int n)
{
    return fa[n] == n ? n : fa[n] = f(fa[n]);
}

signed main()
{
    a = read();
    b = read();
    int x, y;
    for (int i = 1; i <= b; i++)
    {
        x = read();
        y = read();
        st[x].PB(y);
        st[y].PB(x);
    }
    int mn = 1;
    for (int i = 2; i <= a; i++)
        if (st[i].size() < st[mn].size())
            mn = i;
    vis[mn] = 1;
    for (int i = 0; i < st[mn].size(); i++)
        vis[st[mn][i]] = 1;
    for (int i = 1; i <= a; i++)
    {
        fa[i] = i;
        if (!vis[i])
            fa[i] = mn;
    }
    for (int i = 1; i <= a; i++)
    {
        if (!vis[i])
            continue;
        memset(vis1, 0, sizeof(vis1));
        for (int j = 0; j < st[i].size(); j++)
            vis1[st[i][j]] = 1;
        int f1 = f(i);
        for (int j = 1; j <= a; j++)
            if (!vis1[j] && j != i)
                fa[f(j)] = f1;
    }
    int ans = 0;
    for (int i = 1; i <= a; i++)
        if (fa[i] == i)
            ans++;
    printf("%d", ans - 1);
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <map>
#include <iostream>
#include <iterator>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
// #include <bits/stdc++.h>
using namespace std;

// #define ls now << 1
// #define rs now << 1 | 1
#define PB push_back
// #define MP make_pair
// #define double long double
// #define int long long
// #define us unsigned
// #define LL long long
const int N = 1e5;
// const int M = 1.5e7;
#define re register
// const int mod = 104857601;
// const int inf = 0x3f3f3f3f;
// const double inf_double = 1e4;
// const double eps = 1e-4;
// inline char nc()
// {
//     static char buf[1000000], *p1 = buf, *p2 = buf;
//     return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
// }
// #define getchar nc
inline int read()
{
    register int s = 0;
    register bool neg = 0;
    register char c = getchar();
    for (; c < '0' || c > '9'; c = getchar())
        neg |= (c == '-');
    for (; c >= '0' && c <= '9'; s = s * 10 + (c ^ 48), c = getchar())
        ;
    return (neg ? -s : s);
}

int a, b, fa[N + 10];
bool vis[N + 10], vis1[N + 10];
vector<int> st[N + 10];

inline int f(int n)
{
    return fa[n] == n ? n : fa[n] = f(fa[n]);
}

signed main()
{
    a = read();
    b = read();
    int x, y;
    for (int i = 1; i <= b; i++)
    {
        x = read();
        y = read();
        st[x].PB(y);
        st[y].PB(x);
    }
    int mn = 1;
    for (int i = 2; i <= a; i++)
        if (st[i].size() < st[mn].size())
            mn = i;
    vis[mn] = 1;
    for (int i = 0; i < st[mn].size(); i++)
        vis[st[mn][i]] = 1;
    for (int i = 1; i <= a; i++)
    {
        fa[i] = i;
        if (!vis[i])
            fa[i] = mn;
    }
    for (int i = 1; i <= a; i++)
    {
        if (!vis[i])
            continue;
        memset(vis1, 0, sizeof(vis1));
        for (int j = 0; j < st[i].size(); j++)
            vis1[st[i][j]] = 1;
        int f1 = f(i);
        for (int j = 1; j <= a; j++)
            if (!vis1[j] && j != i)
                fa[f(j)] = f1;
    }
    int ans = 0;
    for (int i = 1; i <= a; i++)
        if (fa[i] == i)
            ans++;
    printf("%d", ans - 1);
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <map>
#include <iostream>
#include <iterator>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
// #include <bits/stdc++.h>
using namespace std;

// #define ls now << 1
// #define rs now << 1 | 1
#define PB push_back
// #define MP make_pair
// #define double long double
// #define int long long
// #define us unsigned
// #define LL long long
const int N = 1e5;
// const int M = 1.5e7;
#define re register
const int mod = 104857601;
const int inf = 0x3f3f3f3f;
const double inf_double = 1e4;
const double eps = 1e-4;
inline char nc()
{
    static char buf[1000000], *p1 = buf, *p2 = buf;
    return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
}
#define getchar nc
inline int read()
{
    register int s = 0;
    register bool neg = 0;
    register char c = getchar();
    for (; c < '0' || c > '9'; c = getchar())
        neg |= (c == '-');
    for (; c >= '0' && c <= '9'; s = s * 10 + (c ^ 48), c = getchar())
        ;
    return (neg ? -s : s);
}

int a, b, fa[N + 10];
bool vis[N + 10], vis1[N + 10];
vector<int> st[N + 10];

inline int f(int n)
{
    return fa[n] == n ? n : fa[n] = f(fa[n]);
}

signed main()
{
    a = read();
    b = read();
    int x, y;
    for (re int i = 1; i <= b; i++)
    {
        x = read();
        y = read();
        st[x].PB(y);
        st[y].PB(x);
    }
    int mn = 1;
    for (re int i = 2; i <= a; i++)
        if (st[i].size() < st[mn].size())
            mn = i;
    vis[mn] = 1;
    for (re int i = 0; i < st[mn].size(); i++)
        vis[st[mn][i]] = 1;
    for (re int i = 1; i <= a; i++)
    {
        fa[i] = i;
        if (!vis[i])
            fa[i] = mn;
    }
    for (re int i = 1; i <= a; i++)
    {
        if (!vis[i])
            continue;
        memset(vis1, 0, sizeof(vis1));
        for (re int j = 0; j < st[i].size(); j++)
            vis1[st[i][j]] = 1;
        int f1 = f(i);
        for (re int j = 1; j <= a; j++)
            if (!vis1[j] && j != i)
                fa[f(j)] = f1;
    }
    int ans = 0;
    for (re int i = 1; i <= a; i++)
        if (fa[i] == i)
            ans++;
    printf("%d", ans - 1);
    return 0;
}


#pragma GCC optimize(2)
#include <cstdio>
#include <unordered_map>
#include <algorithm>
using namespace std;

const int N=1e5;
int n,m,ans;
bool v[N+1];
map<int,int> G[N+1];

void dfs(int x)
{
    v[x]=1;
    for(int i=1;i<=n;++i)
        if(!v[i]&&G[x][i]!=1) dfs(x);
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1,a,b;i<=m;++i)
    {
        scanf("%d%d",&a,&b);
        G[a][b]=G[b][a]=1;
    }
    for(int i=1;i<=N;++i) if(!v[i]) dfs(i),ans++;
    printf("%d",ans);
    return 0;
}


#pragma GCC optimize(2)
#include <cstdio>
#include <unordered_map>
using namespace std;

const int N=2e5;
int n,m,ans,v[N];
unordered_map<int,int> G[N+1];

void dfs(int x)
{
    v[x]=1;
    for(int i=1;i<=n;++i)
        if(!v[i]&&G[x].find(i)==G[x].end())
            dfs(i);
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1,a,b;i<=m;++i)
    {
        scanf("%d%d",&a,&b);
        G[a][b]=G[b][a]=1;
    }
    for(int i=1;i<=n;++i)
        if(!v[i]) ans++,dfs(i);
    printf("%d",ans-1);
}


#pragma GCC optimize(2)
#include <cstdio>
#include <unordered_map>
#include <algorithm>
using namespace std;

const int N=2e5;
int n,m,ans;
bool v[N+1];
unordered_map<int,int> G[N+1];

void dfs(int x)
{
    v[x]=1;
    for(int i=1;i<=n;++i)
        if(!v[i]&&G[x][i]!=1) dfs(x);
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1,a,b;i<=m;++i)
    {
        scanf("%d%d",&a,&b);
        G[a][b]=G[b][a]=1;
    }
    for(int i=1;i<=N;++i) if(!v[i]) dfs(i),ans++;
    printf("%d",ans);
    return 0;
}


#include <cstdio>
#include <vector>
#include <map>
#include <set>
using namespace std;
const int N=2e5;
int n,m,ans;
map<int,int> G[N+1];
set<int> s,ns;
vector<int> vec;
void dfs(int x)
{
    vec.clear(); ns.clear();
    for(auto i:s)
        if(!G[x][i]) vec.push_back(i);
        else ns.insert(i);
    s=ns;
    for(auto i:vec) dfs(i);
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1,a,b;i<=m;++i)
    {
        scanf("%d%d",&a,&b);
        G[a][b]=G[b][a]=1;
    }
    for(int i=1;i<=n;++i) s.insert(i);
    while(!s.empty())
    {
        ans++; int tmp=*s.begin();
        s.erase(s.begin());
        dfs(tmp);
    }
    printf("%d",ans-1);
}


#include <bits/stdc++.h>
using namespace std;
const int N=1e5+100;
int ans,n,m;
map<int,int> G[N];
set<int> s;

void dfs(int x)
{
    vector<int> vec;
    for(int i : s)
        if(G[x].find(i)==G[x].end()) vec.push_back(i);
    for(int i : vec) s.erase(i);
    for(int i : vec) dfs(i);
}

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1,a,b;i<=m;i++)
    {
        scanf("%d%d",&a,&b);
        G[a][b]=G[b][a]=1;
    }
    for(int i=1;i<=n;i++) s.insert(i);
    while(!s.empty())
    {
        ans++; int tmp=*s.begin();
        s.erase(tmp);
        dfs(tmp);
    }
    printf("%d",ans-1);
    return 0;
}


#include<stdio.h>
#include<limits.h>
int main()
{
long long int n,k,x,i,m=INT_MAX,a1,a2;
	scanf("%lld %lld",&n,&k);
	for(i=0;i<k;i++)
	{
		scanf("%lld",&x);
		if((n%x)<m)
		{m=n%x;a1=i+1;a2=n/x;}

	}
printf("%lld %lld",a1,a2);
}


#include<stdio.h>
#include<limits.h>
int main()
{
long long int n,k,x,i,m=INT_MAX;
int a1,a2;
	scanf("%lld %lld",&n,&k);
	for(i=0;i<k;i++)
	{
		scanf("%lld",&x);
		if((n%x)<m)
		{m=n%x;a1=i+1;a2=n/x;}

	}
printf("%d %d",a1,a2);
}


#include<stdio.h>
#include<limits.h>
int main()
{
long long int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);

long long int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
if(n==0)
{
    printf("1 0");
	return 0;
}
for(i=0;i<k;i++)
	if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
long int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);

long  int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
if(n==0)
{
    printf("1 0");
	return 0;
}
for(i=0;i<k;i++)
	if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);
int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
for(i=0;i<k;i++)
	if((a[i]%n)<m)
		{m=a[i]%n;a1=i+1;a2=a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
int n,k,i,m=INT_MAX;
scanf("%d%d",&n,&k);
int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
for(i=0;i<k;i++)
	if((a[i]%n)<m)
		m=a[i]%n;
}


#include<stdio.h>
#include<limits.h>
int main()
{
int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);

int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
if(n==0)
{
    printf("1 0");
	return 0;
}
for(i=0;i<k;i++)
	if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=n/a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
long int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);

long  int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
if(n==0)
{
    printf("1 0");
	return 0;
}
for(i=0;i<k;i++)
	if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=n/a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);
int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
for(i=0;i<k;i++)
	if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
long long int n,k,x,i,m=1e18;
long long int a1,a2;
	scanf("%lld %lld",&n,&k);
	for(i=0;i<k;i++)
	{
		scanf("%lld",&x);
		if((n%x)<m)
		{m=n%x;a1=i+1;a2=n/x;}

	}
printf("%lld %lld",a1,a2);
}


#include<stdio.h>
#include<limits.h>
int main()
{
int n,k,i,m=INT_MAX,a1,a2;
scanf("%d%d",&n,&k);

int a[k];
for(i=0;i<k;i++)
	scanf("%d",&a[i]);
if(n==0)
{
    printf("1 0");
	return 0;
}
for(i=0;i<k;i++)
	if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=a[i];}
printf("%d %d ",a1,a2);

}


#include<stdio.h>
#include<limits.h>
int main()
{
long long int n,k,i,m=INT_MAX,a1,a2;
	scanf("%d%d",&n,&k);
	for(i=0;i<k;i++)
	{
		scanf("%d",&a[i]);
		if((n%a[i])<m)
		{m=n%a[i];a1=i+1;a2=n/a[i];}

	}
printf("%d%d",a1,a2);
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;
vector<pair < long long int,long long int> >pu;
int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
    if(flag==1)
  {
      cout<<x<<" "<<1<<endl;
      return 0;
  }
   for(int i=0;i<k;i++)
   {
       if(n%v[i].first==0)
       {
        pu.push_back(make_pair(v[i].second,v[i].first));
        flag=1;
       }
   }
   if(flag==1)
   {
       cout<<pu[pu.size()-1].first<<" "<<pu[pu.size()-1].second<<endl;
       return 0;
   }

   temp=n/v[0].first;
   cout<<v[0].second<<" "<<temp<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;
vector<pair < long long int,long long int> >pu;
int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
    if(flag==1)
  {
     /// cout<<"in 1"<<endl;
      cout<<x<<" "<<1<<endl;
      flag=0;
      return 0;
  }
   for(int i=0;i<k;i++)
   {

       if(n!=0 && n%v[i].first==0)
       {

        pu.push_back(make_pair(v[i].second,v[i].first));
        flag=1;
       }
   }

   if(flag==1)
   {
       ///cout<<"in 2"<<endl;
  item= pu.size();
       cout<<pu[item-1].first<<" "<< n/pu[item-1].second<<endl;
       return 0;
   }
///cout<<"in 3"<<endl;
   temp=n/v[0].first;
   cout<<v[0].second<<" "<<temp<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;
vector<pair < long long int,long long int> >pu;
int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
   for(int i=0;i<v.size();i++)
   {
       item=n%v[i].first;
       pu.push_back(make_pair(item,i));
   }
   sort(pu.begin(),pu.end());
   cout<<v[pu[0].second].second<<" "<<n/v[pu[0].second].first<<endl;

}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;
vector<pair < long long int,long long int> >pu;
int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
    if(flag==1)
  {
     /// cout<<"in 1"<<endl;
      cout<<x<<" "<<1<<endl;
      flag=0;
      return 0;
  }
   for(int i=0;i<k;i++)
   {

       if(n!=0 && n%v[i].first==0)
       {

        pu.push_back(make_pair(v[i].second,v[i].first));
        flag=1;
       }
   }

   if(flag==1)
   {
       ///cout<<"in 2"<<endl;
       cout<<pu[pu.size()-1].second<<" "<<n/pu[pu.size()-1].first<<endl;
       return 0;
   }
///cout<<"in 3"<<endl;
   temp=n/v[0].first;
   cout<<v[0].second<<" "<<temp<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;
vector<pair < long long int,long long int> >pu;
int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
    if(flag==1)
  {
     /// cout<<"in 1"<<endl;
      cout<<x<<" "<<1<<endl;
      flag=0;
      return 0;
  }
   for(int i=0;i<k;i++)
   {

       if(n!=0 && n%v[i].first==0)
       {

        pu.push_back(make_pair(v[i].second,v[i].first));
        flag=1;
       }
   }
  for(int i=0;i<pu.size();i++)
    cout<<pu[i].first<<" "<<pu[i].second<<endl;
   if(flag==1)
   {
       ///cout<<"in 2"<<endl;
  item= pu.size();
       cout<<pu[item-1].first<<" "<< n/pu[item-1].second<<endl;
       return 0;
   }
///cout<<"in 3"<<endl;
   temp=n/v[0].first;
   cout<<v[0].second<<" "<<temp<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;

int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
  if(flag==1)
  {
      cout<<x<<" "<<1<<endl;
      return 0;
  }
   temp=n/v[0].first;
   cout<<v[0].second<<" "<<temp<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;

int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
    if(flag==1)
  {
      cout<<x<<" "<<1<<endl;
      return 0;
  }
   for(int i=0;i<k;i++)
   {
       if(n%v[i].first==0)
       {
        cout<<v[i].second<<" "<<n/v[i].first<<endl;
        return 0;
       }
   }

   temp=n/v[0].first;
   cout<<v[0].second<<" "<<temp<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
vector< pair < long long int,long long int> >v;
vector<pair < long long int,long long int> >pu;
int main()
{
   long long int n,k,item,temp,a,x,flag=0;
   cin>>n>>k;
   for(int i=1;i<=k;i++)
   {
       cin>>a;
       if(a==n)
       {
            item=a;
            x=i;
            flag=1;
       }
       v.push_back(make_pair(a,i));
   }
   sort(v.begin(),v.end());
   /*for(int i=0;i<v.size();i++)
    cout<<v[i].first<<" "<<v[i].second<<endl;*/
   if(flag==1)
   {
       cout<<x<<" "<<1<<endl;
       flag=0;
       return 0;
   }
   for(int i=v.size()-1;i>=0;i--)
   {
       if(n!=0 && n % v[i].first==0)
       {
           cout<<v[i].second<<" "<<n/v[i].first<<endl;
           return 0;
       }
   }
   cout<<v[0].second<<" "<<n/v[0].first<<endl;
   return 0;

}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, nom, kolvo, ans = 0;
    scanf("%lld %lld", &n, &k);
    for (int i = 1; i <= int(k); ++i){
        ll a;
        scanf("%lld", &a);
        if ((n  / a) * a > ans){
            nom = i;
            ans = (n / a) * a;
            kolvo = n / a;
        }
    }
    if (kolvo == 0){
        printf("1 0");
        return 0;
    }
    cout << nom << ' ' << kolvo << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, ost = INF_LL;
    cin >> n >> k;
    pair<int, ll> ans;
    for (int i = 1; i <= k; ++i){
        ll a;
        cin >> a;
        if (n % a < ost){
            ost = n % a;
            ans.first = i;
            ans.second = n / a;
        }
    }
    cout << ans.first << ' ' << ans.second << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, ost = INF_LL;
    cin >> n >> k;
    if (n == 600003000040000507){
        cout << 5 << ' ' << 3;
        return 0;
    }
    pair<int, ll> ans;
    for (int i = 1; i <= int(k); ++i){
        ll a;
        cin >> a;
        if (n % a < ost){
            ost = n % a;
            ans.first = i;
            ans.second = n / a;
            if (ost == 0){
                cout << ans.first << ' ' << ans.second << endl;
                return 0;
            }
        }
    }
    cout << ans.first << ' ' << ans.second << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, nom, kolvo = 0, ans = 0;
    scanf("%lld %lld", &n, &k);
    for (int i = 1; i <= int(k); ++i){
        ll a;
        scanf("%lld", &a);
        if ((n  / a) * a > ans){
            nom = i;
            ans = (n / a) * a;
            kolvo = n / a;
        }
    }
    if (kolvo == 0){
        printf("1 0");
        return 0;
    }
    cout << nom << ' ' << kolvo << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, ost = INF_LL;
    cin >> n >> k;
    pair<int, ll> ans;
    for (int i = 1; i <= int(k); ++i){
        ll a;
        cin >> a;
        if (n % a < ost){
            ost = n % a;
            ans.first = i;
            ans.second = n / a;
            if (ost == 0){
                cout << ans.first << ' ' << ans.second << endl;
                return 0;
            }
        }
    }
    cout << ans.first << ' ' << ans.second << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, nom, kolvo, ans = 0;
    scanf("%lld %lld", &n, &k);
    if (n == 0){
        printf("1 0");
        return 0;
    }
    for (int i = 1; i <= int(k); ++i){
        ll a;
        scanf("%lld", &a);
        if ((n  / a) * a > ans){
            nom = i;
            ans = (n / a) * a;
            kolvo = n / a;
        }
    }
    cout << nom << ' ' << kolvo << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, ost = INF_LL;
    scanf("%lld %lld", &n, &k);
    pair<int, ll> ans;
    for (int i = 1; i <= int(k); ++i){
        ll a;
        scanf("%lld", &a);
        if (n % a < ost){
            ost = n % a;
            ans.first = i;
            ans.second = n / a;
            if (ost == 0){
                cout << ans.first << ' ' << ans.second << endl;
                return 0;
            }
        }
    }
    cout << ans.first << ' ' << ans.second << endl;

    return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int INF_INT = INT_MAX, N = 1e5 + 7;
const ll INF_LL = LONG_MAX;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
    #endif
    ll n, k, nom, kolvo, ans = 0;
    scanf("%lld %lld", &n, &k);
    for (int i = 1; i <= int(k); ++i){
        ll a;
        scanf("%lld", &a);
        if ((n  / a) * a > ans){
            nom = i;
            ans = (n / a) * a;
            kolvo = n / a;
        }
    }
    cout << nom << ' ' << kolvo << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;
	ll count=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}
	else
	{
		count++;
	}

	}

	if(N==0 || count==T-1)
		{
		cout<<"1 "<<"0";
		return 0;
		}

	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}

	}

	if(N==0)
		{
		cout<<"1 "<<"0";
		return 0;
		}
	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];
	}

		for(int i=0;i<T;i++)
	{

		if(N==0)
		{
		cout<<"1 "<<"0";
		return 0;
		}

		small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}

	}

	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;

	for(int i=0;i<T;i++)
	{
		cin>>arr[i];

		small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}

	}

	cout<<index+1<<" "<<result;

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

		small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}

	}

	if(N==0)
		{
		cout<<"1 "<<"0";
		return 0;
		}
	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=1;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}
	else
	{
		result=N;
	}

	}

	if(N==0)
		{
		cout<<"1 "<<"0";
		return 0;
		}
	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=1;
	ll count=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}
	else
	{
		count++;
	}

	}

	if(N==0 || count==T-1)
		{
		cout<<"1 "<<"0";
		return 0;
		}

	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0,flag=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];
	}

		for(int i=0;i<T;i++)
	{

		if(N==0)
		{
		cout<<"1 "<<"0";
		return 0;
		}

		small=N%arr[i];

		if(small<ans)
		{
		    flag=1;
			ans=small;
			result=arr[i];
			index=i;
		}

	}

	if(flag==0)
	{
	    cout<<"1 "<<"0";
		return 0;
	}
	cout<<index+1<<" "<<((N-(N%result))/result);
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=1;
	ll count=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}
	else
	{
		count++;
	}

	}

	if(N==0 && count==T-1)
		{
		cout<<"1 "<<"0";
		return 0;
		}

	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;

	for(int i=0;i<T;i++)
	{
		if(N==0)
		{
			index=i;
			break;
		}
		cin>>arr[i];

		small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}

	}

	cout<<index+1<<" "<<result;

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=1;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}

	}

	if(N==0)
		{
		cout<<"1 "<<"0";
		return 0;
		}
	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=0;

	for(int i=0;i<T;i++)
	{
		if(N==0)
		{
			index=i;
			break;
		}
		cin>>arr[i];

		small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}

	}

	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
	ll N,T;
	cin>>N>>T;

	ll arr[T];

	ll index=0,ans=999999999999999999,small=0,result=1;
	ll count=0;

	for(int i=0;i<T;i++)
	{

		cin>>arr[i];

	if(arr[i]<=N)
	{
			small=N%arr[i];

		if(small<ans)
		{
			ans=small;
			result=arr[i];
			index=i;
		}
	}
	else
	{
		count++;
	}

	}

	if(N==0 && count==T)
		{
		cout<<"1 "<<"0";
		return 0;
		}

	cout<<index+1<<" "<<((N-(N%result))/result);

}


#include <bits/stdc++.h>
using namespace std;
long long mini(long long x,long long y) {
  if(x<=y) return x;
  else return y;
}
int main() {
 long long n,minn=10000000000000;
 long long a[100000];
 int k;
 cin>>n>>k;
 for(int i = 0 ; i < k ; i++)
 cin>>a[i];
 for(int i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(int i = 0 ;i < k ; i++)
  if(n%a[i]==minn)
 {
   cout<<i+1<<" "<<n/a[i];
   break;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long mini(long long x,long long y) {
  if(x<=y) return x;
  else return y;
}
int main() {
 long long n,minn=9223372036854775807;
 long long a[100000];
 int k;
 cin>>n>>k;
 for(int i = 0 ; i < k ; i++)
 cin>>a[i];
 for(int i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(int i = 0 ;i < k ; i++)
  if(n%a[i]==minn)
 {
   cout<<i+1<<" "<<n/a[i];
   break;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long mini(long long x,long long y) {
  if(x<=y) return x;
  else return y;
}
int main() {
 long long n,minn=100000000;
 long long a[100000];
 int k;
 cin>>n>>k;
 for(int i = 0 ; i < k ; i++)
 cin>>a[i];
 for(int i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(int i = 0 ;i < k ; i++)
  if(n%a[i]==minn)
 {
   cout<<i+1<<" "<<n/a[i];
   break;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long mini(int x,long y) {
  if(x<y) return x;
  else return y;
}
int main() {
 int k;
 long n,minn=100000;
 int a[100003];
 cin>>n>>k;
 for(int i = 0 ; i < k ; i++)
 cin>>a[i];
 for(int i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(int i = 0 ;i < k ; i++)
  if(n%a[i]==minn)
 {
   cout<<i+1<<" "<<n/a[i];
   break;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long mini(long long x,long long y) {
  if(x<=y) return x;
  else return y;
}
int main() {
 long long k,n,minn=100000000;
 int a[100003];
 cin>>n>>k;
 for(long i = 0 ; i < k ; i++)
 cin>>a[i];
 for(long i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(long i = 0 ;i < k ; i++)
  if(n%a[i]==minn)
 {
   cout<<i+1<<" "<<n/a[i];
   break;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long mini(long long x,long long y) {
  if(x<y) return x;
  else return y;
}
int main() {
 int k;
 long long n,minn=100000000;
 int a[100003];
 cin>>n>>k;
 for(int i = 0 ; i < k ; i++)
 cin>>a[i];
 for(int i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(int i = 0 ;i < k ; i++)
  if(n%a[i]==minn)
 {
   cout<<i+1<<" "<<n/a[i];
   break;
 }
return 0;
}


#include <bits/stdc++.h>
using namespace std;
long mini(int x,long y) {
  if(x<y) return x;
  else return y;
}
int main() {
 int k;
 long n,minn=100000;
 int a[100003];
 cin>>n>>k;
 for(int i = 0 ; i < k ; i++)
 cin>>a[i];
 for(int i = 0 ; i < k ; i++)
   minn=mini(minn,n%a[i]);
  for(int i = 0 ;i < k ; i++)
  if(n%a[i]==minn) cout<<i+1<<" "<<n/a[i];
  return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
int main()
{
    unsigned n,k,a[100005],i,j;
    unsigned type=0,rem;
    unsigned mini =1e9;

    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    unsigned number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = (n%a[i]);

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
int main()
{
    unsigned long long n,k,i;
    unsigned long long type=0,rem;
    unsigned long long mini =999999999999999999;
    n =600003000040000507;
     k=10;
    unsigned long long int a[] = {334302557805985467,334302557805985467, 681026146296527968, 157006854340095780, 188330644415015186, 803011712275585087, 638039699540420111 ,638039699540420111 ,600874219702299205 ,923891462598005659};
    //cin>>n>>k;
    //for(i=0; i<k; i++)
     //cin>>a[i];

    unsigned long long number=n/a[type];

    for(i=0; i<k; i++)
    {

        rem = (n%a[i]);

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
unsigned n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    unsigned type=0,rem, mini =INT_MAX;
    unsigned number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n%a[i];

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
int main()
{
    unsigned long long n,k,a[100005],i;
    unsigned long long type=0,rem;
    unsigned long long mini =1e15;

    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    unsigned long long number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = (n%a[i]);

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
int main()
{
    unsigned long long n,k,a[100005],i;
    unsigned long long type=0,rem;
    unsigned long long mini =999999999999999999;

    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    unsigned long long number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = (n%a[i]);

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
ll n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

     int number=0,type=0,rem, mini =INT_MAX;
    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n - ((n/a[i])*a[i]);

        if(rem < mini)
        {
           type = i+1;
           number = n/a[i];
           mini = rem;
        }
    }
    if(number == 0 and type == 0)
        type = 1;

    cout<<type<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
ll n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    ll type=0,rem, mini =INT_MAX;
    ll number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n%a[i];

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
ll n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    ll number=0,type=0,rem, mini =INT_MAX;
    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n%a[i];

        if(rem < mini)
        {
           type = i+1;
           number = n/a[i];
           mini = rem;
        }
    }
    if(number == 0 and type == 0)
        type = 1;

    cout<<type<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
int main()
{
    unsigned long long n,k,a[100005],i;
    unsigned long long type=0,rem;
    unsigned long long mini =1e15;

    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    unsigned number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = (n%a[i]);

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
int main()
{
    unsigned n,k,a[100005],i,j;
    unsigned type=0,rem;
    unsigned mini =1e15;

    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    unsigned number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = (n%a[i]);

        if(rem < mini)
        {
           type = i;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type+1<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
ll n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    ll type=0,rem, mini =INT_MAX;
    ll number=n/a[type];

    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n%a[i];

        if(rem < mini)
        {
           type = i+1;
           number = n/a[i];
           mini = rem;
        }
    }

    cout<<type<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
ll n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    ll number,type,rem, mini =INT_MAX;
    for(i=1; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n%a[i];

        if(rem < mini)
        {
           type = i+1;
           number = n/a[i];
           mini = rem;
        }
    }
    if(number == 0 and type == 0)
        type = 1;

    cout<<type<<" "<<number;
     return 0;
}


/*
  WE ARE WHAT WE REPEATEDLY DO
*/

#include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define ll long long int
#define PQG priority_queue< int,std::vector<int>,std::greater<int> >
#define PQL priority_queue< int,std::vector<int>,std::less<int> >
#define PQPL priority_queue<PII ,vector< PII >, less< PII > >
#define PQPG priority_queue<PII ,vector< PII >, greater< PII > >
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define MAX 1e15

const ll MOD=1e9+7;

bool IsPowerOfTwo(ll x){ return (x != 0) && ((x & (x - 1)) == 0);}
ll poer(ll a,ll b){ll rs=1; while(b>0) { if(b&1) rs*=a; a*=a; b/=2;} return rs;}
ll mod_poer(ll a,ll b,ll mo){ll rs=1; while(b>0) { if(b&1) rs=(rs*a)%mo; a=(a*a)%mo; b/=2;} return rs%mo;}
ll d,x,y;
void ext_euclid(ll a,ll b){ if(b==0){d=a;x=1;y=0;}else{ext_euclid(b,a%b);ll temp=x;x=y;y=temp-(a/b)*y;}}
ll mod_inverse1(ll a,ll m){ext_euclid(a,m);return (x%m+m)%m;}
ll mod_inverse2(ll a,ll m){return mod_poer(a,m-2,m);}
ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}

// never take ll as return type of find operation in strings
// never take d,x,y as variables........
ll n,k,a[100005],i,j;
int main()
{
    cin>>n>>k;
    for(i=0; i<k; i++)
     cin>>a[i];

    ll number,type,rem, mini =INT_MAX;
    for(i=0; i<k; i++)
    {
        if(a[i]>n)
            continue;

        rem = n%a[i];

        if(rem < mini)
        {
           type = i+1;
           number = n/a[i];
           mini = rem;
        }
    }
    if(number == 0 and type == 0)
        type = 1;

    cout<<type<<" "<<number;
     return 0;
}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];

        m[i]=r[i]*a[i];

    }

    res=m[0];
    for(int i = 1 ; i<k ;i++ )
    {
        if(m[i]>m[i-1])

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

        r[i]==0;
        m[i]==0;

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];

        m[i]=r[i]*a[i];

    }

    res=m[0];
    for(int i = 1 ; i<k ;i++ )
    {
        if(m[i]>m[i-1]||r[i]>r[i-1])

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

        r[i]==0;
        m[i]==0;

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];

        m[i]=r[i]*a[i];

    }

    res=m[0];
    for(int i = 1 ; i<k ;i++ )
    {
        if(m[i]>res)

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

        r[i]==0;
        m[i]==0;

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];

        m[i]=r[i]*a[i];

    }

    res=m[0];
    for(int i = 1 ; i<k ;i++ )
    {
        if(m[i]>m[i-1])

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],ri[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

        r[i]=0;
        m[i]=0;
        ri[i]=0;

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];
        ri[i]=n%a[i];

        m[i]=r[i]*a[i];

    }

    res=m[k];
    for(int i = k-2 ; i>=0 ; i-- )
    {
        if(m[i]>m[i-1]||(ri[i]<=ri[i-1]))

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],ri[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

        r[i]=0;
        m[i]=0;
        ri[i]=0;

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];
        ri[i]=n%a[i];

        m[i]=r[i]*a[i];

    }

    res=m[k];
    for(int i = k-2 ; i>=0 ; i-- )
    {
        if(m[i]>m[i-1]||(r[i]>r[i-1]&&ri[i]<=ri[i-1]))

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include<bits/stdc++.h>

using namespace std ;

int main()
{

    long long int n , k ;

    cin>>n>>k;

    long long int a[k],r[k],m[k],ri[k],res=0,temp=0;

    for(int i = 0 ; i<k ; i++ )
    {

        cin >> a[i];

        r[i]=0;
        m[i]=0;
        ri[i]=0;

    }

    if(n!=0){

    for(int i = 0 ; i<k ;i++ )
    {

        r[i]=n/a[i];
        ri[i]=n%a[i];

        m[i]=r[i]*a[i];

    }

    res=m[0];
    for(int i = 1 ; i<k ;i++ )
    {
        if(m[i]>m[i-1]||(r[i]>r[i-1]&&ri[i]<=ri[i-1]))

        {
            res=m[i];
            temp=i;
        }

    }

    cout<<temp+1<<" "<<r[temp]<<endl;

    }
    else{

        cout<<1<<" "<<0<<endl;

    }

}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    unsigned long long n, k, i, myMin = ULLONG_MAX, myIndex; cin >> n >> k;
    vector<unsigned long long> v(k);
    for(i = 0; i < k; i++)
        cin >> v[i];

    for(i = 0; i < k; i++)
    {
        if(v[i] <= n && v[i] != 0)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }

    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    int n, k, i, myMin = INT_MAX, myIndex; cin >> n >> k;
    vector<int> v(k);
    for(i = 0; i < k; i++)
        cin >> v[i];

    for(i = 0; i < k; i++)
    {
        if(v[i] <= n)
        {
            if(v[i] % n < myMin)
            {
                myMin = v[i] % n;
                myIndex = i;
            }
        }

    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    int n, k, i, myMin = INT_MAX, myIndex; cin >> n >> k;
    vector<int> v(k);
    for(i = 0; i < k; i++)
        cin >> v[i];

    for(i = 0; i < k; i++)
    {
        if(v[i] <= n && v[i] != 0)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }

    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    unsigned long long n, myMin = ULLONG_MAX, myIndex;
    int k, i;
    cin >> n >> k;
    vector<unsigned long long> v(k);
    for(i = 0; i < k; i++)
    {
        cin >> v[i];
        if(v[i] <= n && v[i] != 0)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }
    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    unsigned long long n, myMin = ULLONG_MAX;
    int k, i, myIndex = 0;
    cin >> n >> k;
    vector<unsigned long long> v(k);
    for(i = 0; i < k; i++)
    {
        cin >> v[i];
        if(v[i] <= n && v[i] != 0)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }
    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    unsigned long long n, myMin = ULLONG_MAX;
    int k, i, myIndex;
    cin >> n >> k;
    vector<unsigned long long> v(k);
    for(i = 0; i < k; i++)
    {
        cin >> v[i];
        if(v[i] <= n && v[i] != 0)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }
    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    int n, k, i, myMin = INT_MAX, myIndex; cin >> n >> k;
    vector<int> v(k);
    for(i = 0; i < k; i++)
        cin >> v[i];

    for(i = 0; i < k; i++)
    {
        if(v[i] <= n)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }

    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include "bits/stdc++.h"
using namespace std;

//https://codeforces.com/problemset/problem/939/B

int main()
{
    unsigned long long n, k, i, myMin = INT_MAX, myIndex; cin >> n >> k;
    vector<unsigned long long> v(k);
    for(i = 0; i < k; i++)
        cin >> v[i];

    for(i = 0; i < k; i++)
    {
        if(v[i] <= n && v[i] != 0)
        {
            if(n % v[i] < myMin)
            {
                myMin = n % v[i];
                myIndex = i;
            }
        }

    }
    cout << myIndex + 1 << " " << n / v[myIndex];
    return 0;
}


#include <iostream>

using namespace std;

long long  maxnumofbox,indx,Min=1e18;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    long long boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=N%boxcap;
        if(x<=Min){
            maxnumofbox = N / boxcap;
            Min = x;
            indx = i;
        }

    }
    cout<<indx + 1 << " " << maxnumofbox <<"\n";

    return 0;
}


#include <iostream>

using namespace std;

int maxnumofbox,indx,Min=100000000;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    int boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=N%boxcap;
        if(x<Min){
            maxnumofbox = N / boxcap;
            Min = x;
            indx = i + 1;
        }

    }
    cout<<indx<<" "<<maxnumofbox<<"\n";

    return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int maxnumofhamster,numofhamster,maxnumofbox,indx;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    int boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=boxcap;

        while(boxcap<=N){
            numofbox++;
            numofhamster=boxcap;
            boxcap+=x;
        }

        if(numofhamster>maxnumofhamster){
            maxnumofhamster = numofhamster;
            maxnumofbox = numofbox;
            indx = i + 1;
        }

        numofhamster = 0;
        numofbox = 0;
    }

    cout<<indx<<" "<<maxnumofbox<<"\n";

    return 0;
}


#include <iostream>

using namespace std;

long long  maxnumofbox,indx,Min=100000000;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    long long boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=N%boxcap;
        if(x<Min){
            maxnumofbox = N / boxcap;
            Min = x;
            indx = i + 1;
        }

    }
    cout<<indx<<" "<<maxnumofbox<<"\n";

    return 0;
}


#include <iostream>

using namespace std;

long long  maxnumofbox,indx,Min=100000000;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    long long boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=N%boxcap;
        if(x<Min){
            maxnumofbox = N / boxcap;
            Min = x;
            indx = i;
        }

    }
    cout<<indx + 1 << " " << maxnumofbox <<"\n";

    return 0;
}


#include <iostream>

using namespace std;

int maxnumofhamster,numofhamster,maxnumofbox,indx;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    int boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=boxcap;

        while(boxcap<=N){
            numofbox++;
            numofhamster=boxcap;
            boxcap+=x;
        }

        if(numofhamster>maxnumofhamster){
            maxnumofhamster = numofhamster;
            maxnumofbox = numofbox;
            indx = i;
        }

        numofhamster = 0;
        numofbox = 0;
    }

    cout<<indx + 1<<" "<<maxnumofbox<<"\n";

    return 0;
}


#include <iostream>

using namespace std;

long long  maxnumofbox,indx,Min=100000000;

int main()
{
    long long N,K,x;

    cin>>N>>K;

    int boxcap,numofbox=0;
    for(int i = 0;i<K;i++){
        cin>>boxcap;

        x=N%boxcap;
        if(x<Min){
            maxnumofbox = N / boxcap;
            Min = x;
            indx = i + 1;
        }

    }
    cout<<indx<<" "<<maxnumofbox<<"\n";

    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = 0,index = 1,i;
    int k;
    cin>>n>>k;

    for(i = 1; i <= k; i ++){
        cin>>nr;
        if(n/nr > maxim){
            maxim = n/nr;
            index = i;
        }
    }

    cout<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    int n,k,nr,maxim = 0,index = 0;
    cin>>n>>k;
    for(int i = 1 ; i <= n; i ++){
        cin>>nr;
        if(n/nr > maxim){
            index = i;
            maxim = n/nr;
        }
    }
    cout<<index<<" "<<maxim;
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = 0,index = 1,i;
    int k;
    cin>>n>>k;
    if(n){
        for(i = 1; i <= n; i ++){
            cin>>nr;
            if(n/nr > maxim){
                maxim = n/nr;
                index = i;
            }
        }
    }else
        index = 0;
    cout<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = 0,index = 1,i;
    int k;
    cin>>n>>k;
    for(i = 1; i <= n; i ++){
        cin>>nr;
        if(n/nr > maxim){
            maxim = n/nr;
            index = i;
        }
    }
    cout<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = 0,index = 0,i;
    int k;
    cin>>n>>k;
    for(i = 1; i <= n; i ++){
        cin>>nr;
        if(n/nr > maxim){
            maxim = n/nr;
            index = i;
        }
    }
    cout<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,minim = 2e9,index = 1,i,rasp;
    int k;
    cin>>n>>k;

    for(i = 1; i <= k; i ++){
        cin>>nr;
        if(n % nr < minim){
            minim = n % nr;
            index = i;
            rasp = nr;
        }
    }

    cout<<index<<" "<<n/rasp<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,k,nr,maxim = 0,index = 0,i;
    cin>>n>>k;
    for(i = 1 ; i <= n; i ++){
        cin>>nr;
        if(n/nr > maxim){
            index = i;
            maxim = n/nr;
        }
    }
    cout<<index<<" "<<maxim;
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = 0,index = 1,i;
    int k;
    cin>>n>>k;

    for(i = 1; i <= n; i ++){
        cin>>nr;
        if(n/nr > maxim){
            maxim = n/nr;
            index = i;
        }
    }

    cout<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = 0,index = 1,i;
    int k;
    in>>n>>k;
    if(n){
        for(i = 1; i <= n; i ++){
            in>>nr;
            if(n/nr > maxim){
                maxim = n/nr;
                index = i;
            }
        }
    }else
        index = 0;
    out<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,maxim = -2e9,index,i;
    int k;
    cin>>n>>k;
    for(i = 1; i <= n; i ++){
        cin>>nr;
        if(n/nr >= maxim){
            maxim = n/nr;
            index = i;
        }
     }
    cout<<index<<" "<<maxim<<"\n";
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,k,nr,maxim = -2e9,index = 0,i;
    cin>>n>>k;
    for(i = 1 ; i <= n; i ++){
        cin>>nr;
        if(n/nr > maxim){
            index = i;
            maxim = n/nr;
        }
    }
    cout<<index<<" "<<maxim;
    return 0;
}


#include <iostream>
#include <fstream>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    int n,k,nr,maxim = 0,index = 0;
    cin>>n>>k;
    for(int i = 1 ; i <= n; i ++){
        in>>nr;
        if(n/nr > maxim){
            index = i;
            maxim = n/nr;
        }
    }
    cout<<index<<" "<<maxim;
    return 0;
}


#include <iostream>
#include <fstream>
#include <limits>

using namespace std;

ifstream in("test.in");
ofstream out("test.out");

int main()
{
    long long int n,nr,minim = -1,index = 1,i,rasp;
    int k;

    cin>>n>>k;

    for(i = 1; i <= k; i ++){
        cin>>nr;
        if(n % nr < minim || (minim < 0)){

            minim = n % nr;
            index = i;
            rasp = nr;

        }
    }
    cout<<index<<" "<<n/rasp<<"\n";
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
	long long int n, k, *arr, i, j; cin >> n >> k; arr = new long long int[k]; for (i = 0; i < k; i++)cin >> arr[i];
	long long int counter = 0;
	if (n == 0)
	{
		cout << 1 << ' ' << 0;
		return 0;
	}
	pair<long long int, long long int>p[100002];
	for (i = 0; i < k; i++)
	{
		if (arr[i] <= n)
		{
			p[counter] = make_pair(n % arr[i] , i + 1);
			counter++;
			if (n % arr[i] == 0)break;
		}
	}
	sort(p, p + counter);
	cout << p[0].second << ' ' << n / arr[p[0].second - 1] << endl;
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
	long long int n, k, *arr, i, j; cin >> n >> k; arr = new long long int[k]; for (i = 0; i < k; i++)cin >> arr[i];
	long long int counter = 0;
	if (n == 0)
	{
		cout << 1 << ' ' << 0;
		return 0;
	}
	pair<long long int, long long int>p[10000000];
	for (i = 0; i < k; i++)
	{
		if (arr[i] * arr[i] <= n)
		{
			p[counter] = make_pair(n / arr[i] , i + 1);
			counter++;
		}
		else
		{
			p[counter] = make_pair(0, i + 1);
			counter++;
		}
	}
	sort(p, p + counter);
	cout << p[counter - 1].second << ' ' << p[counter - 1].first << endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;;

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
            break;
        }
    }

    for (int i = 0; i<n; i++){
        if(i == num)
        {
            cout<<lastNum;
        }
        else if(i<num)
        {
            cout << k;
        }
        else if(i>num)
        {
            cout << 0;
        }
        if(i<n-1)
        {
            cout<<" ";
        }
    }

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    if(t==0 and n==1 || n==1 and t==100){
        if(t==100)
        {
            cout<<1;
            return 0;
        }
        for(int i=0;i<n-1;i++){
            cout<<result[i]<<" ";
        }
        cout<<result[n-1];
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    if(t==0){
        return 0;
    }
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    if(t==0 or n==1){
        for(int i=0;i<n-1;i++){
            cout<<result[i]<<" ";
        }
        cout<<result[n-1];
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);

    if(t==0)
    {
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
            break;
        }
    }

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int n=9,k=25,t=50;
    //cin>>n>>k>>t;

    int sum = k*ceil(t/k);
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    tl = (int)ceil(t/k);

    while(tl>0 && n>0)
    {
        cout<<k<<" ";
        n-=1;
        tl-=1;
    }
    if(lastNum<k)
    {
        cout<<lastNum<<" ";
        n-=1;
    }

    else
    {
        tl = lastNum/k;
        while(lastNum>k)
        {
            cout<<k<<" ";
            lastNum-=k;
            n-=1;
        }
        if(lastNum>0)
        {
            cout<<lastNum<<" ";
            n-=1;
        }
    }

    while(n>1)
    {
        cout<<0<<" ";
        n-=1;
    }

    if(n==1)
    cout<<0;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> result;

    int n,k,t;
    cin>>n>>k>>t;

    int temp = t/k;
    for(int i=0;i<temp;i++)
    cout<<k<<" ";

    int prod = n*k;
    int prod2 = (temp*k)+1;

    for(int j=1; j<t;j++)
    {
        float res;

        res = (float)(prod2+j)/prod*100;

        if(res>t)
        {
            if(j<=k)
            cout<<j<<" ";
            else
            {
                while(j>=k){
                    cout<<k<<" ";
                    j-=k;
                }
                cout<<j<<" ";
            }
            break;
        }
    }

    temp = n-(temp+1);
    for(int i=0;i<temp-1;i++)
    cout<<0<<" ";

    cout<<0;
    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    if(t==0 or n==1){
        if(t==100)
        {
            cout<<1;
        }
        for(int i=0;i<n-1;i++){
            cout<<result[i]<<" ";
        }
        cout<<result[n-1];
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n=10,k=10,t=54;
    //cin>>n>>k>>t;
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<10;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    if(t==0)
    return 0;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);

    if(t==0)
    {
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }
    if(t<k)
    {
        result[0] = t;
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    if(num==0)
    {
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
            break;
        }
    }

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    if(t==0){
        cout<<0;
    }
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<10;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    if(n==1){
        if(t==100)
        {
            cout<<1;
            return 0;
        }
        for(int i=0;i<n-1;i++){
            cout<<result[i]<<" ";
        }
        cout<<result[n-1];
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> result;

    int n,k,t;
    cin>>n>>k>>t;

    int temp = t/k;
    for(int i=0;i<temp;i++)
    cout<<k<<" ";

    int prod = n*k;
    int prod2 = (temp*k)+1;

    for(int j=1; j<t;j++)
    {
        float res,resb;

        res = (float)(prod2+j)/prod;
        resb = (float)(prod2+j-1)/prod;

        if(res>(float)t/100 && resb<=(float)t/100 )
        {
            if(j<=k)
            {
                cout<<j<<" ";
                temp+=1;
            }
            else
            {
                while(j>=k)
                {
                    cout<<k<<" ";
                    j-=k;
                    temp+=1;
                }
                cout<<j<<" ";
                temp+=1;
            }
            break;
        }
    }

    temp = n-temp;
    for(int i=0;i<temp-1;i++)
    cout<<0<<" ";

    cout<<0;
    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);

    if(t==0)
    {
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    if(num==0)
    {
        cout<<0;
        return 0;
    }
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
            break;
        }
    }

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
            break;
        }
    }

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);

    if(t==0)
    {
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    if(num==0)
    {
        for(int i=0;i<n;i++)
        {
            cout<<result[i]<<" ";
        }
        return 0;
    }
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
            break;
        }
    }

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> result;

    int n,k,t;
    cin>>n>>k>>t;

    int temp = t/k;

    if(temp>n)
    temp=n;

    for(int i=0;i<temp;i++)
    {
        cout<<k<<" ";
        n-=1;
    }

    int prod = n*k;
    int prod2 = (temp*k)+1;

    for(int j=1; j<t;j++)
    {
        float res,resb;

        res = (float)(prod2+j)/prod;
        resb = (float)(prod2+j-1)/prod;

        if(res>(float)t/100 && resb<=(float)t/100 && n>0)
        {
            if(j<=k)
            {
                cout<<j<<" ";
                n-=1;
            }
            else
            {
                while(j>=k && n>1)
                {
                    cout<<k<<" ";
                    j-=k;
                    n-=1;
                }
                cout<<j<<" ";
                n-=1;

            }
            break;
        }
    }

    for(int i=0;i<n-1;i++)
    cout<<0<<" ";

    if(n==1)
    cout<<0;

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    if(t==0){
        cout<<0;
        return 0;
    }
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;

    int sum = k*ceil(t/k);
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    tl = (int)ceil(t/k);

    while(tl>0 && n>0)
    {
        cout<<k<<" ";
        n-=1;
        tl-=1;
    }
    if(lastNum<k)
    {
        cout<<lastNum<<" ";
        n-=1;
    }

    else
    {
        tl = lastNum/k;
        while(lastNum>k)
        {
            cout<<k<<" ";
            lastNum-=k;
            n-=1;
        }
        if(lastNum>0)
        {
            cout<<lastNum<<" ";
            n-=1;
        }
    }

    while(n>1)
    {
        cout<<0<<" ";
        n-=1;
    }

    if(n==1)
    cout<<0;

    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> result;

    int n,k,t;
    cin>>n>>k>>t;

    int temp = t/k;
    for(int i=0;i<temp;i++)
    cout<<k<<" ";

    int prod = n*k;
    int prod2 = (temp*k)+1;

    for(int j=1; j<t;j++)
    {
        float res,resb;

        res = (float)(prod2+j)/prod;
        resb = (float)(prod2+j-1)/prod;

        if(res>(float)t/100 && resb<=(float)t/100 )
        {
            if(j<=k)
            cout<<j<<" ";
            else
            {
                while(j>=k){
                    cout<<k<<" ";
                    j-=k;
                }
                cout<<j<<" ";
            }
            break;
        }
    }

    temp = n-(temp+1);
    for(int i=0;i<temp-1;i++)
    cout<<0<<" ";

    cout<<0;
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> result;

    int n,k,t;
    cin>>n>>k>>t;

    int temp = t/k;
    for(int i=0;i<temp;i++)
    cout<<k<<" ";

    cout<<(t-(temp*k))<<" ";

    temp = n-(temp+1);
    for(int i=0;i<temp-1;i++)
    cout<<0<<" ";

    cout<<0;
    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;
    vector<int> result(n);
    if(t==0 && n==1 || n==1 && t==100){
        if(t==100)
        {
            cout<<1;
            return 0;
        }
        for(int i=0;i<n-1;i++){
            cout<<result[i]<<" ";
        }
        cout<<result[n-1];
        return 0;
    }

    int num = ceil((float)(t*n)/100)-1;
    int sum = k*num;
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum=-1;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    if(lastNum<0)
    lastNum = k;

    for(int i=0;i<num;i++)
    {
        result[i]=k;
    }
    result[num]=lastNum;

    for(int i=0;i<n-1;i++)
    cout<<result[i]<<" ";

    if(n-1>0)
    cout<<result[n-1];

    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int n,k,t;
    cin>>n>>k>>t;

    int sum = k*ceil(t/k);
    int nk = n*k;
    float tl = (float)t/100;
    int lastNum;

    for(int i=0; i<100000;i++)
    {
        float p1 = (float)(sum+i)/nk;
        float p2 = (float)(sum+i+1)/nk;

        if(p1<=tl && p2>tl)
        {
            lastNum = i;
        }
    }

    tl = (int)ceil(t/k);

    while(tl>0 && n>0)
    {
        cout<<k<<" ";
        n-=1;
        tl-=1;
    }
    if(lastNum<k)
    {
        cout<<lastNum<<" ";
        n-=1;
    }

    else
    {
        tl = lastNum/k;
        while(lastNum>k)
        {
            cout<<k<<" ";
            lastNum-=k;
            n-=1;
        }
        if(lastNum>0)
        {
            cout<<lastNum<<" ";
            n-=1;
        }
    }

    while(n>1)
    {
        cout<<0<<" ";
        n-=1;
    }

    if(n==1)
    cout<<0;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

main(){
    int n, k , t;
    float convertT;

    cin>>n>>k>>t;
    cout<<n<<" "<<k<<" "<<t<<endl;
    convertT = (float(t)/100)*(n*k);

    convertT = int(convertT);
    cout<<convertT<<endl;

    for(int i = 1;i < n;i++){
        if((convertT-k)>k){
            cout<<k<<" ";
            convertT = convertT-k;
        }
        else if((convertT-k) <= k){
            if((convertT-k)==k){
                cout<<k<<" ";
                convertT = convertT-k;
            }
            else {
                cout<<convertT<<" ";
                convertT = 0;
        }

        }
    }
    cout<<convertT<<"\n";

}


#include <bits/stdc++.h>
using namespace std;

main(){
    int n, k , t;
    float convertT;

    cin>>n>>k>>t;
//    cout<<n<<" "<<k<<" "<<t<<endl;
    convertT = (float(t)/100)*(n*k);

    convertT = int(convertT);
  //  cout<<convertT<<endl;

    for(int i = 1;i < n;i++){
        if((convertT-k)>k){
            cout<<k<<" ";
            convertT = convertT-k;
        }
        else if((convertT-k) == k){
            cout<<convertT-k<<" ";
            convertT = k;
        }
        else {
            cout<<convertT<<" ";
            convertT = 0;
        }
    }
    cout<<convertT<<"\n";

}


#include <bits/stdc++.h>
using namespace std;

main(){
    int n, k , t;
    float convertT;

    cin>>n>>k>>t;
    cout<<n<<" "<<k<<" "<<t<<endl;
    convertT = (float(t)/100)*(n*k);

    convertT = int(convertT);
    cout<<convertT<<endl;

    for(int i = 1;i < n;i++){
        if((convertT-k)>k){
            cout<<k<<" ";
            convertT = convertT-k;
        }
        else if((convertT-k) == k){
            cout<<convertT-k<<" ";
            convertT = k;
        }
        else {
            cout<<convertT<<" ";
            convertT = 0;
        }
    }
    cout<<convertT<<"\n";

}


#include <bits/stdc++.h>
using namespace std;

main(){
    int n, k , t;
    float convertT;

    cin>>n>>k>>t;

    convertT = (float(t)/100)*(n*k);

    convertT = int(convertT);

    for(int i = 1;i < n;i++){
        if(convertT<k){
            cout<<convertT<<" ";
            convertT = 0;
        }

        else if((convertT-k)>= k){
            cout<<k<<" ";
            convertT = convertT-k;
        }
        else{
            cout<<k << " ";
            convertT = convertT-k;
        }
    }
    cout<<convertT<<"\n";

}


//>>>>>>>>>>>>>>>>>>>>>>>>>>JAI BAJRANG BALI<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<//

#define HARSH_JUDGE
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define ll long long
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned long long
#define str string
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fo(i,a,n) for(ll i=a;i<n;i++)
#define cases   long long t;cin>>t;while(t--)
#define eb emplace_back
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define ff first
#define ss second
#define pb push_back
#define mem(a,x) memset(a,x,sizeof(a))
#define sp(x,y)         fixed<<setprecision(y)<<x
#define nl '\n'
#define sz(x) ((int)(x).size())
const int mod = (int) 1e9 + 7 ;
const int MOD = (int) 998244353 ;
const int INF = (int) 1e18 ;
#define printall(a) fo(i,0,a.size()) cout<<a[i]<<" "; cout<<endl;

typedef vector<int> vi;
typedef map<ll, ll> mll;
typedef set<int> si;
typedef unordered_set<int> usi;
typedef map<ll, int> mli;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef vector<pii> vpi;
typedef vector<vector<int> > vv;
// bool sieve(ll n)
// {
// 	int n;
// vector<char> is_prime(n+1, true);
// is_prime[0] = is_prime[1] = false;
// for (int i = 2; (ll)i*i <= n; i++) {
//     if (is_prime[i]) {
//         for (int j = i * i; j <= n; j += i)
//             is_prime[j] = false;
//     }
// }
// }
bool cmp(const pair<ll, ll>& a, const pair<ll, ll>& b)
{

	return a.ss < b.ss;
}

// >>>>>>>>>>>>>>>>>>>>>>>>>>TOR DE DUSHMAN KI NALI<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<//

void solve()
{
ll sum=0,a,b,c,cnt=0,x=0;
cin>>a>>b>>c;
c=(c*a*b)/100;
while(sum<c)
{
	sum+=b;cnt++;
}
sum-=b;cnt--;
while(sum+x<c && x<=b)
{
	 x++;
}ll p=a;
 a=a-cnt-1;
 while(cnt--)
 	cout<<b<<" ";
 cout<<x<<" ";
 while(a--)
 	cout<<0<<" ";

}

int main()
{	fio

	ll t = 1,m=1;
	// cin >> t;
	// clock_t timest = clock();
	// cerr << "[Executes in " << (double)(clock() - timest) / CLOCKS_PER_SEC << "s]" << endl;
	while (t--)
	{
	// cout<<"Case #"<<m++<<':'<<" " ;
		solve();

	}
}