P17349 [HackerRank] Input
普及-
题目描述

This challenge is only forPython 2.

input()

In Python 2, the expression input() is equivalent to eval(raw _input(prompt)).

Code

input()
1+2
3
company = 'HackerRank'
website = 'www.hackerrank.com'
input()
'The company name: '+company+' and website: '+website
'The company name: HackerRank and website: www.hackerrank.com'

Task

You are given a polynomial $\mbox{P}$ of a single indeterminate (or variable), $\boldsymbol{x}$.

You are also given the values of $\boldsymbol{x}$ and $\boldsymbol{\mbox{k}}$. Your task is to verify if $P(x)=k$.

Constraints

All coefficients of polynomial $\mbox{P}$ are integers.

$\boldsymbol{x}$ and $y$ are also integers.

Input Format

The first line contains the space separated values of $\boldsymbol{x}$ and $\boldsymbol{\mbox{k}}$.

The second line contains the polynomial $\mbox{P}$.

Output Format

Print True if $P(x)=k$. Otherwise, print False.

Sample Input
1 4
x3 + x2 + x + 1

Sample Output
True

Explanation

$P(1)=1^3+1^2+1+1=4=k$

Hence, the output is True.

输入格式

见题面

输出格式

见题面

样例输入
1 4 x**3 + x**2 + x + 1
样例输出
True