Tap here to switch tabs
Problem
Submissions

Problem: Distribute Money to Maximum Children

med
30 min
Try to solve the Distribute Money to Maximum Children problem.

Statement

You are given two integers, money and children, representing an amount of money and a number of children.

You must distribute all the money among the children according to the following rules:

  1. Every child must receive at least 11 dollar.

  2. No child may receive exactly 44 dollars.

  3. All money must be completely distributed.

Return the maximum number of children that can receive exactly 88 dollars. If there is no valid distribution satisfying these conditions, return −1-1.

Constraints:

  • 1≤1 \leq money ≤200\leq 200

  • 2≤2 \leq children ≤30\leq 30

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Distribute Money to Maximum Children

med
30 min
Try to solve the Distribute Money to Maximum Children problem.

Statement

You are given two integers, money and children, representing an amount of money and a number of children.

You must distribute all the money among the children according to the following rules:

  1. Every child must receive at least 11 dollar.

  2. No child may receive exactly 44 dollars.

  3. All money must be completely distributed.

Return the maximum number of children that can receive exactly 88 dollars. If there is no valid distribution satisfying these conditions, return −1-1.

Constraints:

  • 1≤1 \leq money ≤200\leq 200

  • 2≤2 \leq children ≤30\leq 30