PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#BF0000031. Những điều kiện của nhà vua (King)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Những điều kiện của nhà vua (King)
King
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
A sequence of integers must obey statements. s len gt k says the sum from index through is strictly greater than $k; s len lt ksays it is strictly less. Printlamentable kingdomwhen feasible, otherwisesuccessful conspiracy`.
All sums are over integers, and comparisons are strict.
Input
First line , followed by lines , with op equal to gt or lt.
Output
Print exactly lamentable kingdom or successful conspiracy.
Subtasks
- Subtask 1 (20 points): $1\le n\le12; 1\le m\le30; 1\le s\le n; 0\le len\le n-s; -10^6\le k\le10^6$.
- Subtask 2 (30 points): $1\le n\le60; 1\le m\le60; 1\le s\le n; 0\le len\le n-s; -10^6\le k\le10^6$.
- Subtask 3 (50 points): $1\le n\le100; 1\le m\le100; 1\le s\le n; 0\le len\le n-s; -10^6\le k\le10^6$.
Examples
Input
1 2
1 0 gt 0
1 0 lt 1
Output
successful conspiracy
Explanation
The only sequence element must simultaneously be greater than and less than . No integer has this property, so the output is successful conspiracy.