Dr Who`s Banquet
Çox asan
Zaman limiti 1 saniyə-dir
Yaddaş məhdudiyyəti 256 meqabayt
Dr. Who is organizing a banquet and will be inviting several guests. A guest is happy if he can chat with a fixed number of other guests. We assume that guests cannot talk to themselves. Help Dr. Who make all his guests happy, if possible, by organizing chats between guests.
Giriş verilənləri
Contains several data sets, and each data set is encoded on a line. A data set consists of positive integers . Each number is the number of chat partners guest would like to have.
Çıxış verilənləri
If you can make all the guests happy, you should post "ok". If not all the guests to be happy, you should get the message "fail". After each message should be displayed an empty string.
In the following table, an input data with data sets and the associated output is shown.
Nümunələr
Giriş #1
Çıxış #1
Təqdimatlar 6K
Qəbul dərəcəsi 24%