Перепишите код с++ на с #include
#include
#include
using namespace std;
int main()
{
float a;
float b;
vector s;
vector v;
cin >> a;
cin >> b;
for (int i = 0; i < a; ++i)
{
float d;
float e;
cin >> d;
cin >> e;
s.push_back(d);
v.push_back(e);
}
float dou = -1;
while (true)
{
float sum = 0;
for (int i = 0; i < s.size(); ++i)
{
sum += s[i] / (v[i] + dou);
}
if (sum <= b + 0.01 && sum >= b - 0.01)
{
cout << endl << dou << endl;
break;
}
dou += 0.01;
cout << dou << endl;
}
}