CF510E Fox And Dinner
题目描述
小狐狸Ciel参加了一个派对,加上他自己这个派对里总共有$n$只狐狸,每只狐狸有一个年龄$a_i$。
它们想要在几张圆桌旁吃晚饭,你需要帮忙分配座位,使得满足以下要求:
1. 每只狐狸都在其中
2. 每张桌子边至少有3只狐狸
3. 任意两只相邻的狐狸的年龄之和为质数(圆桌上每只狐狸都有2只相邻的狐狸)
输入格式
无
输出格式
无
说明/提示
In example 1, they can sit around one table, their ages are: 3-8-9-4, adjacent sums are: 11, 17, 13 and 7, all those integers are primes.
In example 2, it is not possible: the sum of 2+2 = 4 is not a prime number.