; your code goes here
(defun same-parity (n list)
(loop for x in list
with parity = (rem n 2)
if (= (rem x 2) parity)
collect x))
(defvar x (list 1 2 3 4 5 6 7 8 9 10))
(print (same-parity 3 x))
(print (same-parity 2 x))
OyB5b3VyIGNvZGUgZ29lcyBoZXJlCihkZWZ1biBzYW1lLXBhcml0eSAobiBsaXN0KQogIChsb29wIGZvciB4IGluIGxpc3QKICAgICB3aXRoIHBhcml0eSA9IChyZW0gbiAyKQogICAgIGlmICg9IChyZW0geCAyKSBwYXJpdHkpCiAgICAgY29sbGVjdCB4KSkKCihkZWZ2YXIgeCAobGlzdCAxIDIgMyA0IDUgNiA3IDggOSAxMCkpCgoocHJpbnQgKHNhbWUtcGFyaXR5IDMgeCkpCihwcmludCAoc2FtZS1wYXJpdHkgMiB4KSkK