This question A is amazing... I just made A guess... I wrote the following very cool and ugly code... I actually gave it to AC...
I am the one-digit confirmation .. in general, it is feasible .. with the depth of the exact bit .. the answer will get better and better... however, I found that this is not rigorous and it is easy to make mistakes .. then I will give it a longer try range when determining a bit (for example, I want to determine the number on 0.1 now .. conventional thinking .. try 0.0 ~ 0. 9 .. and my attempt is from-5.1 ~ 5. 1 ...)...
Program:
[Cpp]
# Include <iostream>
# Include <algorithm>
# Include <stdio. h>
# Include <string. h>
# Include <cmath>
# Include <queue>
# Define OOS 2000000000
# Define ll long
Using namespace std;
Int a, B, c, s;
Double x, y, z, m, X, Y, Z, M;
Void get (double k)
{
Double tx, ty, tz;
Int xx, yy;
Tx = X; ty = Y; tz = Z;
For (xx =-51; xx <= 51; xx ++)
For (yy =-51; yy <= 51; yy ++)
{
X = X + xx * k;
Y = Y + yy * k;
If (x <0 | y <0 | x + y> s) continue;
Z = s-x-y;
M = 0;
If (! = 0)
If (x> k) m + = a * log (x );
Else continue;
If (B! = 0)
If (y> k) m + = B * log (y );
Else continue;
If (c! = 0)
If (z> k) m + = c * log (z );
Else continue;
If (m> MB + 0.00000001)
{
M = m;
Tx = x;
Ty = y;
Tz = z;
}
}
X = tx; Y = ty; Z = tz;
}
Int main ()
{
Int I;
Double k;
Scanf ("% d", & s, & a, & B, & c );
M =-1e + 100;
X = Y = Z = 0;
For (x = 0; x <= s + 0.000001; x + = 1)
For (y = 0; y <= s-x + 0.000001; y + = 1)
{
Z = abs (s-x-y );
M = 0;
If (! = 0)
If (x> 0.000001) m + = a * log (x );
Else continue;
If (B! = 0)
If (y> 0.000001) m + = B * log (y );
Else continue;
If (c! = 0)
If (z> 0.000001) m + = c * log (z );
Else continue;
If (m> MB + 0.000001)
{
M = m;
X = x;
Y = y;
Z = z;
}
}
K = 1;
For (I = 1; I <= 16; I ++)
{
K/= 10;
Get (k );
}
Printf ("%. 16lf %. 16lf %. 16lf \ n", X, Y, Z );
Return 0;
}