U E D R , A S I H C RSS

The Lagest Smallest Box/김상섭

~cpp
#include <iostream> 
#include <math.h> 
using namespace std; 

void process(double L, double W) 
{ 
    cout.setf(ios::fixed, ios::floatfield);    
    cout.setf(ios::showpoint);    
    cout.precision(3);  
    double a = 12; 
	double b = -4*L -4*W; 
    double c = L*W; 
    double min = L; 
    if(W < L) 
        min = W; 
    cout << -b/2.0/a - sqrt(b*b -4*a*c)/2.0/a << " " << 0.0 << " " << min/2.0 << endl; 
}

int main() 
{ 
    double L,W; 

    while(cin >> L >> W) 
    { 
        process(L,W); 
    } 

    return 0; 
} 
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:28:12
Processing time 0.0135 sec