Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public boolean makeBricks(int small, int big, int goal) {
  2.  
  3. if (small >= goal) {
  4. return true;
  5. }
  6.  
  7. else if (goal%5 == 0 && big >= goal) {
  8. return true;
  9. }
  10.  
  11. else if (big*5>goal) {
  12. if (goal-((Math.floor(goal/5))*(big*5) <= small)) {
  13. return true;
  14. }
  15.  
  16. else if (big*5<goal) {
  17. if (big*5+small >= goal) {
  18. return true;
  19. }
  20. }
  21. }
  22.  
  23. return false;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement