Polynomial

Problem Statement

Please note that the results of Problem 10 returned by BSOJ currently are for reference only and are not final. The final scores will be recalculated after the due date with a different test data set. Your answer will be considered correct if the absolute error of all coefficients doesn’t exceed 0.01.

Please output the answer only. Don't output anything like `Please enter an expression` or `The answer is xxx`.

Test data used now

You can modify the following code to read the command and the polynomials.

int main() {
  char cmd[5]; //read the command
  int e;
  double c;
  gets(cmd);
  for (;;) {
    scanf("%d%lf", &e, &c); //read a term
    if (getchar() != ' ') break;
  }
  for (;;) {
    scanf("%d%lf", &e, &c); //read a term
    if (getchar() != ' ') break;
  }
}
Submit