5 while [[ $got -lt $target ]]; do
6 (( house
++ % 1000 )) ||
echo " $((house-1)) at $got, max $max"
7 if [[ $house == 1 ]]; then
12 got
=$
(((house
+ (house
<= 50))*11))
15 while (( i
<= 50 && i
*i
< house
)); do
16 if ! (( house
% i
)); then
18 got
=$
((got
+ (house
/i
)*11))
19 ((house
/i
<= 50)) && got
=$
((got
+ i
*11))
23 (( i
<= 50 && i
*i
== house
)) && got
=$
((got
+ i
*11))
24 # echo " house $house got $got"
25 [[ $max -lt $got ]] && max
=$got
27 echo "house $house got $got gifts"