В приложении - рабочая книга Microsoft Excel 2003 с макросом. Для выполнения надо разрешить макросы.
Текст программы:
Option Explicit
Private Sub cmdStart_Click() Const T = 360 'Условное количество дней в году Dim PV As Double, FV As Double, r As Double, n As Double Dim d1 As Date, d2 As Date PV = Cells(1, 2).Value FV = Cells(2, 2).Value r = Cells(3, 2).Value d1 = Cells(4, 2).Value n = (FV / PV - 1) * T / r If n <> Int(n) Then n = n + 1 d2 = d1 + n Cells(5, 2).Value = d2 End Sub
#include <iomanip> // std::setprecision
int main()
{
unsigned int W,H,K,P;
unsigned long M;
float T;
std::cin >> W >> H >> K >> P >> M >> T;
unsigned int n = (W*H);
std::cout << (n = ((n / K) + !(!(n % K << " ";
std::cout << (n = (n*P)) << std::endl;
std::cout << ((M-n > 0) ? "YES" : "NO") << std::endl;
std::cout << std::setprecision(4) << (float(n) / T) << std::endl;
return 0;
}