A. Horrible boss

Codeforces
IDCF10105A
Time2000ms
Memory64MB
Difficulty
English · Original
Formal · Original
There is a fight between a boss and his 3 employees. But instead of firing, the boss invites them to a judo fight. As if that was not enough, he says that 2 employees can come together to fight him. If we define the power of the 3 employees as P1,P2 and P3, and W is the power of the boss. Now, the fight is won by the team which has higher total combined power. In case of same power, the employees win. You need to check if the employees can win or not. The input contains 4 lines of input: P1, P2, P3 and W in this order only. Output a single word: "YES" if the employees can win, "NO" otherwise. Don't print the quotes in the output. ## Input The input contains 4 lines of input: P1, P2, P3 and W in this order only. ## Output Output a single word: "YES" if the employees can win, "NO" otherwise. Don't print the quotes in the output. [samples]
**Definitions** Let $ P_1, P_2, P_3, W \in \mathbb{R} $ denote the powers of the three employees and the boss, respectively. **Constraints** None specified beyond real-valued powers. **Objective** Determine if there exists a pair of employees whose combined power is at least the boss’s power. That is, check if: $$ \max(P_1 + P_2,\ P_1 + P_3,\ P_2 + P_3) \geq W $$ If true, output "YES"; otherwise, output "NO".
API Response (JSON)
{
  "problem": {
    "name": "A. Horrible boss",
    "description": {
      "content": "There is a fight between a boss and his 3 employees. But instead of firing, the boss invites them to a judo fight. As if that was not enough, he says that 2 employees can come together to fight him. I",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 65536
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10105A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "There is a fight between a boss and his 3 employees. But instead of firing, the boss invites them to a judo fight. As if that was not enough, he says that 2 employees can come together to fight him. I...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ P_1, P_2, P_3, W \\in \\mathbb{R} $ denote the powers of the three employees and the boss, respectively.\n\n**Constraints**  \nNone specified beyond real-valued powers.\n\n**Objective...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments