I cant get AC.. please help.. here is my program
#include <stdio.h>
#include <math.h>
long double A, B;
int K;
int Ba, Bb;
long double Best;
#define eps 0.001
void solve()
{
long double p, pb;
int a, b;
for (a = K, b = 0, pb = 0; a >= 0; a--)
{
p = (K-a)*(B - K+a);
if (p > pb+eps) pb = p, b = K-a;
p = a*(A - a) + pb;
if (p > Best-eps) Best = p, Ba = a, Bb = b;
}
}
void main()
{
scanf("%Lf %Lf %d", &A, &B, &K);
solve();
printf("%.2Lf\n%d %d\n", Best, Ba, Bb);
}