1 of 4

Pyth, 36 32 bytes

}QsM^+ks._Mc6"logsincostanlnee"l

Try it online.

Extremely inefficient.