import std/algorithm, std/sequtils proc isCute(s:seq[int]):bool = for i in 1..s.len: if i mod s[i-1] != 0 or s[i-1] mod i != 0: return false return true proc cuteList(n:int):int = var s:seq[int] = {1..10}.toSeq while s.nextPermutation(): if isCute(s): result += 1 echo cuteList(2)