V
Size: a a a
AD
АК
АК
АК
ИМ
АК
ИМ
V
AD
AD
AD
s
V
MK
DK
let input = Int(readLine()!)!
let dict = [1: 1, 2: 2, 3: 3, 5: 5, 8: 8, 13: 13]
let sortedKeys = dict.keys.sorted()
let minClosest = sortedKeys.enumerated().min(by: { abs($0.1 - input) < abs($1.1 - input) })!
let lhsKeyValue = minClosest.element
let rhsKeyValue = sortedKeys[minClosest.offset + 1]
print(dict[lhsKeyValue]!)
print(dict[rhsKeyValue]!)
!
- может упасть :)V
DK