当前位置:网站首页>Educational Codeforces Round 20 C. Maximal GCD
Educational Codeforces Round 20 C. Maximal GCD
2022-06-09 05:56:00 【No toast】
#include<bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define eps 1e-2
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,siz eof(x))
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;
#define int long long
const int maxn = 1e5+2;
const int INF = 1<<30;
const int mod = 1e9+7;
int n,k;
std::vector<int> v;
void solve(){
cin>>n>>k;
for(int i=1;i*i<=n;i++){
if(n%i==0){
v.push_back(i);
v.push_back(n/i);
}
}
if(k>6e5){
cout<<-1<<endl;
return;
}
int nd=k*(k+1)/2;
// cout<<nd<<endl;
// return ;
sort(v.begin(), v.end());
for(int i=v.size()-1;i>=0;i--){
int cnt=n/v[i];
if(cnt>=nd){
for(int j=1;j<=k-1;j++){
printf("%lld ",j*v[i]);
}
// cout<<(cnt-(k-1)*k/2)*v[i]<<endl;
printf("%lld\n",(cnt-(k-1)*k/2)*v[i]);
return ;
}
}
cout<<-1<<endl;
return;
}
int32_t main()
{
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
// ios::sync_with_stdio(false);
int t = 1;
//scanf("%d",&t);
while(t--){
// printf("Case %d: ",cas++);
solve();
}
return 0;
}
边栏推荐
- Wireshark图解TCP三次握手与四次挥手
- Several implementation methods of redis distributed lock
- Swift protocol
- vscode 出现TypeScript intellisense is disabled on template.错误
- SSL证书安装后网站还是显示不安全
- Heqibao's trip to Chongqing ~
- After the SSL certificate is installed, the website still shows insecurity
- Mvcc multi version control
- Google Colab 使用小贴士
- New and old versions of Minio tool classes and deployment documents
猜你喜欢

vscode 出现TypeScript intellisense is disabled on template.错误

Embedded audio and video solutions webrtc vs metartc

XML建模

How to monitor JVM GC

Jitsi meet video recording with jibri

Morsel driven parallelism: a NUMA aware parallel query execution framework

使用MAT进行内存问题定位

Morsel-Driven Parallelism: 一种NUMA感知的并行Query Execution框架

MySQL add field or create table SQL statement

MVCC多版本控制
随机推荐
JVM basic theory.
Divide by Zero 2017 and Codeforces Round #399 (Div. 1 + Div. 2, combined) D. Jon and Orbs
On input function of istream input stream object CIN
Yolov5-6.0 series | yolov5 model network construction
From November 15, 2022, the private key of the code signing certificate shall be stored in the hardware encryption module
Tricks | [trick6] learning rate adjustment strategy of yolov5 (one cycle policy, cosine annealing, etc.)
Painstakingly wrote a detailed MySQL tutorial of 24K words in three days, three nights
三大队列cxq,entrylist,waitset 个人理解分析
Dynamic data source
Yoyov5's tricks | [trick7] exponential moving average (EMA)
Gradient accumulation setting for pytorch DDP acceleration
Use the default value method if the configuration file does not exist
使用代码签名证书对Adobe AIR应用程序签名的指南
Complete webrtc video recording in five minutes
CEF intercepts URLs and redirects new URLs
Traitement d'images - extension de la corrélation de fusion de fonctions
Morsel driven parallelism: a NUMA aware parallel query execution framework
Educational Codeforces Round 20 E. Roma and Poker
C language to write a small program for computing file CRC
线程thread 中join方法解读