Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean makeBricks(int small, int big, int goal) {
- if (small >= goal) {
- return true;
- }
- else if (goal%5 == 0 && big >= goal) {
- return true;
- }
- else if (big*5>goal) {
- if (goal-((Math.floor(goal/5))*(big*5) <= small)) {
- return true;
- }
- else if (big*5<goal) {
- if (big*5+small >= goal) {
- return true;
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement