The issue was because the public keys were not being converted to secp256k1 points in the example. It should work now and print this:
$ python script.py
X: 0xf0c386f6714fe5940ec7e622d8ba2e5204c58cd71a9c73ca95fb0e4ec0e76d72
Y: 0x56cc1950b7e993f76df9848ad106789f49d1bee3f68d346e03024cd31b3ffcb8
(On curve )
X: 0x6ccae81fef496780cab0b333a2712e867bda428f09fb4374628a16b164d48cf2
Y: 0x32141673b26e4302a3d33c9148d16c0445ae4e84c577352a47dceebb0a6cf0e6
(On curve )
X: 0xea31f5d48f0c43969b607d592636e2443539e7a86ef1350dba0d9040a98fc378
Y: 0x9e324a7345f1b9c1ee964b82fe43492b8f0bc5186713d81f45d7488139e4b7c
(On curve )
X: 0x97539272d59d6e75488df9a5628e7b0efc03b4fec79de246ac116ae40c05225a
Y: 0xc809e0056436079a426d5084fef7b806015f4138e1c544857a2a2bb1a7f80c2e
(On curve )
What is k value?
k is equal to 1/i (one divided by 'i'). Because division is not directly possible on the curve, I raise the divisor to the (N-2)th power. Because when you do that and then take modulo N, that is equal to taking the (-1)th power.
[if I were to take the (N-1)th power instead, that would be like taking the 0th power which results in the number 1, because taking the Nth power gives us the 1st power which is the same number as input - the exact same result because the group is cyclic - repeats itself over and over again.]
'i' stands for the remainder of the public key division you want to get. @WanderingPhilosipher explained it in the Kangaroo thread somewhere, but basically, if you divide by 32, there are exactly 32 unique answers for the division by adding the public key to [0, 1, 2, .... 31] before dividing, so the 'i' selects which answer you need out of those 32 (it can be any number not just 32, it's just an example. It can even be an odd number as long as it's bigger than 0).