ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1716. Alternative Solution

Problem for Copying (Markdown)
Posted by remmymilkyway 15 Oct 2022 12:22
# Alternative Solution

Valentine is a veteran of programming contests and he's been working in the program committee for many years. He is very busy this week: the bike is under repair, some problems with Indian colleagues have to be solved, and five student groups are to be examined in philosophical problems of mathematics at the university. To crown it all, the new chairman of the program committee asked Valentine to write an alternative solution for one of the problems of the forthcoming contest.

Valentine was so busy that he had no time to read the problem statement. He only glanced at the output format and understood that it was required to output either `YES`, or `NO`.

Fortunately, Valentine was well acquainted with the testing system used in the contest. The system successively runs a solution on all tests of a problem, and for each test the checking process goes as follows. The input is copied to the file input.txt. Then the solution is launched. It reads the input from the file input.txt and writes the result to the file output.txt. When it finishes, the correct answer is copied to the file answer.txt. If the contents of the files answer.txt and output.txt match, the test is assumed to be passed; otherwise, the test is not passed.

Valentine decided to write a program that would operate as follows. If the folder containing the program doesn't contain the file answer.txt (i.e. the program is run on the first test), then the program outputs `YES`. Otherwise, the program outputs the contents of the file answer.txt.

Valentine plans to tell the chairman of the program committee that there is a nontrivial mistake in his program, and this mistake, fortunately, shows itself when the program is run on the excellent hard tests prepared by the author of the problem. However, first Valentine has to estimate the number of tests that his solution won't pass. Valentine doesn't have access to the tests, but he knows the number of tests and the total size of the files with answers. He also knows that the size of the file with the answer `YES` is 3 bytes, the size of the file with the answer `NO` is $2$ bytes, and all the variants of the order of tests are equally probable. Help Valentine to calculate the average number of tests that his solution won't pass.

## Input

The only line contains two integers $n$ and $s$ ($1 \le n \le 5000$; $2n \le s \le 3n$) which are the number of tests and the total size of the files with answers, respectively. The numbers are separated with a space.

## Output

Output the average number of tests that Valentine's solution won't pass, accurate to $10^{-5}$.

## Sample

### input

```
3 7
```

### output

```
2.0000000
```
Re: Problem for Copying (Markdown)
Posted by dannyneptune 15 Oct 2022 12:24
Very helpful!
Re: Problem for Copying (Markdown)
Posted by remmymilkyway 15 Oct 2022 12:35
Thanks.