USACO Bronze February Problem 1 2018

I have been working on this problem, I don’t get how to solve this :frowning:

Link to the problem

Please help me…haven’t worked on the problem much…

Please read the problem carefully and list everything you know about the problem. From there, maybe I can assist you better. :smiley:

The best way would be to list the cases and use if/else to solve them.

On the USACO website, there is a C++ solution to that problem here

Hi! I actually trying it the if/else way…i will tell if it succeeds :slight_smile:

You can solve it using math. Try using math to solve it. Not that hard.

1 Like

thank you guys for your hints! I solved it :slight_smile:

I used the math way with min and abs

2 Likes