标签:gif one 图片 nbsp play class || open event
?? 写在纸上了
1 #include<bits/stdc++.h> 2 #define mem(a) memset(a,0,sizeof(a)) 3 #define mem1(a) memset(a,-1,sizeof(a)) 4 #define ll long long 5 #define mp make_pair 6 #define inf 0x3f3f3f3f 7 const int N=1e6+5; 8 const int M=1e3+10; 9 const ll lim=1e14+5; 10 using namespace std; 11 int m,f[N]; 12 ll n,k,a[N]; 13 int main() 14 { 15 cin>>n>>k; 16 if(k>=1e6||(k*(k+1)/2)>n) cout<<-1<<endl; 17 else 18 { 19 ll now=k*(k+1)/2,ans=0; int id=0; 20 for(ll i=1;i*i<=n;i++) 21 if(n%i==0) a[++id]=i; 22 23 for(ll i=1;i<=id;i++) 24 { 25 if(now<=a[i]) {ans=n/a[i];break;} 26 else if(n/a[i]>=now) ans=a[i]; 27 } 28 for(ll i=1;i<k;i++) 29 cout<<i*ans<<" "; 30 cout<<ans*(n/ans-(now-k))<<endl; 31 32 } 33 return 0; 34 }
标签:gif one 图片 nbsp play class || open event
原文地址:https://www.cnblogs.com/XXrll/p/11203413.html