#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define inf 0x3f3f3f3f
const int N=2e5+5;
int x,n;
void solve(){
cin>>x>>n;
int mx=0;
char c;
for(int i=1;i<=n;i++){
char ch;
int k;
cin>>ch>>k;
if(k>mx){
mx=k;
c=ch;
}
}
int res;
if(x%mx==0) res=x/mx;
else res=x/mx+1;
if(res>1000) cout<<-1;
else for(int i=1;i<=res;i++) cout<<c;
}
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t=1;
// cin>>t;
while(t--) solve();
return 0;
}
超级闪光牛可乐(模拟)---牛客小白月赛88-A
最新推荐文章于 2024-08-18 17:01:18 发布