Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/McNuggets-problem/PowerShell/mcnuggets-problem.psh
Normal file
18
Task/McNuggets-problem/PowerShell/mcnuggets-problem.psh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
$possible = @{}
|
||||
For ($i=0; $i -lt 18; $i++) {
|
||||
For ($j=0; $j -lt 13; $j++) {
|
||||
For ( $k=0; $k -lt 6; $k++ ) {
|
||||
$possible[ $i*6 + $j*9 + $k*20 ] = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
For ( $n=100; $n -gt 0; $n-- ) {
|
||||
If ($possible[$n]) {
|
||||
Continue
|
||||
}
|
||||
Else {
|
||||
Break
|
||||
}
|
||||
}
|
||||
Write-Host "Maximum non-McNuggets number is $n"
|
||||
Loading…
Add table
Add a link
Reference in a new issue