Query answering on trajectory cuboids using prime numbers encodings