Easy Beginners Problems > Ad-hoc

**Mahammad** likes online shopping very much. That is why, he purchases a lot of items from online stores using his debit card. Recently, he just thought that something was going wrong with his bank account. He suspected that someone used his card and deleted some transaction messages. You are here to check whether there is a problem or everything is okay with his card. Keep in mind that **you can not withdraw more money than debit card's current amount**. Input: --- The first line contains one integer **T** which is number of test cases. **(1<=T<= 100)**. You are given two numbers **a**, **b** in separate lines representing the initial and final amount in the balance of the card **( 0<=a, b <=10^9)**. The next line contains one integer **N** which indicates the number of transaction messages. And the following **N** lines contains transaction message which is in the form of one string which can be **“in”** or **“out”** and one positive integer **x**. <br> **If the input string is “in” it means the balance is increased by x dollars, and the latter one means x dollars are taken out from the card (1<=N<=1000, x <= 10^9)**. Output: ------- For each of the test cases output **“yes”** if everything is okay with the transaction messages, and **“no”** otherwise. Sample Input ------------ 2 20 5 3 out 10 out 10 in 5 20 5 4 in 10 out 15 out 25 in 30 Sample Output ------------- yes no

Mahmud Allahverdiyev

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 2.00 |

Go | 2.00 |

Java | 2.00 |

JavaScript | 2.00 |

Objective-C | 2.00 |

Perl | 2.00 |

PHP | 2.00 |

Python | 2.00 |

Python3 | 2.00 |

Ruby | 2.00 |

VB.Net | 2.00 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | feodorv | C | 0.00s |

02 | FariD | Cpp | 0.01s |

03 | afzalul | C | 0.01s |

04 | Chayti_Saha98 | Cpp14 | 0.01s |

05 | SIU_LasToNe | Cpp | 0.01s |

06 | imranziad | Cpp | 0.01s |

07 | shihabmridha | Cpp14 | 0.01s |

08 | kitorp | Cpp14 | 0.01s |

09 | shakil2021 | C | 0.01s |

10 | MBSTU_RAKIB_NR | Cpp14 | 0.01s |

11 | alamin__7 | Cpp | 0.01s |

12 | int_elligent | Cpp | 0.01s |

13 | fsshakkhor | Cpp14 | 0.01s |

14 | Bruteforcekid | Cpp14 | 0.01s |

15 | sahedsohel | Cpp | 0.01s |

16 | JACKAL1586 | Cpp14 | 0.01s |

17 | kzvd4729 | Cpp | 0.01s |

18 | mamun4122 | Cpp | 0.01s |

19 | moshiur_cse15 | Cpp | 0.01s |

20 | sayedgkm | Cpp | 0.01s |

21 | dipta007 | Cpp | 0.01s |

22 | astinaam | Cpp14 | 0.01s |

23 | Gazi_Mohaimin_Iqbal | Cpp14 | 0.01s |

24 | shishir09 | Cpp14 | 0.01s |

25 | _c_k_r_ | Cpp | 0.01s |

26 | Nasif_44th | C | 0.01s |

27 | souravahmed | C | 0.01s |

28 | Ruhul1975 | Cpp | 0.02s |

29 | tariqiitju | Cpp | 0.02s |

30 | Logic_Hunter | Cpp14 | 0.02s |

31 | t0whid | Cpp | 0.02s |

32 | hiddenhopes | Cpp | 0.02s |

33 | taskin1995 | Cpp | 0.02s |

34 | mbstu_alamin16 | Cpp | 0.02s |

35 | I_See_You | Cpp14 | 0.02s |

36 | incognito_ju | Cpp | 0.02s |

37 | arafat_hasan | Cpp14 | 0.02s |

38 | shuvo_mbstu | Cpp | 0.02s |

39 | plab0n | Cpp | 0.02s |

40 | fuad036 | Cpp | 0.02s |

41 | nasib_mbstu | Cpp14 | 0.02s |

42 | robincse14 | Cpp | 0.02s |

43 | iridescentAurora131 | Cpp | 0.02s |

44 | by_default | Cpp | 0.02s |

45 | Reayz | Cpp | 0.02s |

46 | bu_hridoy | Cpp | 0.02s |

47 | Rafiqul01 | Cpp14 | 0.02s |

48 | prottoy919 | Cpp | 0.02s |

49 | PKP_007 | Cpp | 0.02s |

50 | emrul | Cpp14 | 0.02s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(