A - Live Love(规律模拟)
插空的规律
#include "stdio.h"
#define LL long long
int main()
{
LL a, b, c, d, e, f, g;
scanf("%lld",&a);
while(a--)
{
scanf("%lld %lld",&b,&c);
d = b - c;
if(c == 0)
printf("0 0\n");
else if(d == 0)
{
printf("%lld %lld\n",c,c);
}
else if(d >= c)
printf("%lld 1\n",c);
else
{
if(c % (1 + d) == 0)
e = c / (1 + d);
else
e = c / (1 + d) + 1;
printf("%lld %lld",c,e);
}
}
return 0;
}