Hey there. K mount lenses will work on Pentax bodies. Of course, if the lens is from before AF was invented - it won't have AF. Same goes for other features, like transmitting lens info (focal length) or auto-aperture.
m42 lenses can be used if you have the adapter. you put the adapter on the camera and then you mount the lens. Then you can remove the lens and the adapter stays on the camera. Now you can mount another m42 lens, or you can remove the adapter. Note that the genuine Pentax adapter is easy to remove (just use your nail to push a little lever), but most if not all third party adapters require a tool to be removed. This makes them much less practical if you want to switch lenses.
Definitely read up on adapter threads if you are planning on using adapters or manual lenses. Adam linked to a good one, but there are a couple others. Its easy once you get it and you save many headaches if you read up first.
I think those lenses you listed will be great. Good luck