|
|
back to boardbest tests 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; } |
|
|