The first task you have to figure out lens compatibility is to find out what lens mount your camera body uses. Pentax 35mm film SLRs and dSLRs use the Pentax K mount.
The second task is to find out what lens mounts the lenses are using, and whether or not it’s Pentax K. That may be harder than it sounds :). But all of the lenses on your list are from 3rd party lens manufacturers (i.e., not someone who makes the same brand of camera), so you have to be extra careful because 3rd party lens manufacturers like Sigma often make the same lens in multiple mounts. And a brand like Vivitar is often used to rebrand many different generic lens manufacturers. You’ll probably have to google each lens model specifically, or look very closely at the sale listings to see if they’re Pentax K. And you may also want to consult a visual lens mount guide like this or this.
The third and final task is to find out how much function the lens will give you. There are often reasons 3rd-party lenses can be found super-cheap on the used market, since OEM camera manufacturers have no vested interest in maintaining compatibility with 3rd-party lenses for functions like autofocus. And a mount like Pentax K or Nikon F, which have been around for decades often can encompass a myriad of quirks and incompatibilities as the mount and its electronic communication has been modified through the years. Googling “Pentax Lens compatibility” resulted in this chart, which charts out Pentax lens compatibility by specific Pentax bodies. And Ricoh themselves have a chart on the functional differences between versions of the K-mount.
It may come down to individually googling each lens with “K-x” to see if someone has mentioned the lens works or doesn’t work (or how much), but it may also be you’re just out of luck and will have to buy the lens to see if it works.