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 1800. Murphy's Law

best tests
Posted by Dmi3Molodov 8 Jun 2026 21:02
It is much more interesting to look for good tests for this task than just to solve it.
Here is the AC program (with a small error in order not to publish solutions). I will look for where it will fail.
#include<iostream>
#include<cmath>//too lazy to write sqrt() yourself
int main() {
    unsigned l, h, o;
    std::cin>>l>>h>>o;
    unsigned phase = 0;
    if(l<h*2) phase = o*sqrt((2*h-l)/981)/15+1;
    char const*answer[]{"Butter","Bread\n"};
    std::cout<<answer[(phase>>1)&1]<<std::endl;
}