Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lista.Alapok;
- public class Main {
- public static boolean canPack(int bigCount, int smallCount, int goal) {
- if(bigCount<0 || smallCount<0 || goal<0) return false;
- return goal<=(bigCount*5+smallCount) && goal%5<=smallCount;
- }
- public static void main(String[] args) {
- System.out.println(canPack(0,5,4));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement