delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

31
2.1363.cpp Normal file
View File

@ -0,0 +1,31 @@
#include<cstdio>
#include<algorithm>
using namespace std;
inline long long sum(int a,int d,int n)
{
return (2ll*a-n*d)*(n+1)/2;
}
int n,k,i,q,p,cnt;
long long res;
int main()
{
#ifdef local
freopen("pro.in","r",stdin);
#endif
while(scanf("%d%d",&n,&k)==2)
{
i=1;
res=0;
while(i<=n)
{
q=k%i;
p=k/i;
cnt=n-i;
if(p>0) cnt=min(cnt,q/p);
res+=sum(q,p,cnt);
i+=cnt+1;
}
printf("%lld\n",res);
}
return 0;
}