HDU 4950 monster (formula)

Source: Internet
Author: User

HDU 4950 monster

Question Link

Q: Given the monster's blood volume H, your attack power a, and monster's blood return power B. You attack K for a second break and ask if you can kill the monster.

Train of Thought: sign in To the question. Pay attention to the last point. If the blame is killed, the blame will not go back to the blood.

Ideas:

# Include <cstdio> # include <cstring> typedef long ll; ll H, A, B, K; bool solve () {if (a> = h) return true; if (B> = A) return false; If (H-(k-1) * A + B * (k-1) <= A) return true; ll s =-A * k + B * (k + 1); If (S> = 0) return false; return true;} int main () {int CAS = 0; while (~ Scanf ("% i64d % i64d % i64d % i64d", & H, & A, & B, & K) & H) {printf ("case # % d :", + + CAS); printf ("% s \ n", solve ()? "Yes": "no");} return 0 ;}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.