CodeForces 104A

ProblemA
Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d& %I64u

[Submit [GoBack  [Status]

Description

One rainy gloomy evening when all modules hid in the nearbycafes to drink hot energetic cocktails, the Hexadecimal virusdecided to fly over the Mainframe to look for a Great Idea. And shehas found one!

Why not make her own Codeforces, with blackjack and other reallycool stuff? Many people will surely be willing to visit thissplendid shrine of high culture.

In Mainframe a standard pack of 52 cards is used to playblackjack. The pack contains cards of 13 values: 2345678910, jacks, queens, kingsand aces. Each value also exists in one of four suits: hearts,diamonds, clubs and spades. Also, each card earns some value inpoints assigned to it: cards with value from two to ten earnfrom 2 to 10 points,correspondingly. An ace can eitherearn 1 or 11, whatever the player wishes. Thepicture cards (king, queen and jack)earn 10 points. The number ofpoints a card earns does not depend on the suit. The rules of thegame are very simple. The player gets two cards, if the sum ofpoints of those cards equals n, then theplayer wins, otherwise the player loses.

The player has already got the first card, it's the queen ofspades. To evaluate chances for victory, you should determine howmany ways there are to get the second card so that the sum ofpoints exactly equals n.

Input

The only line contains n (1 ≤ n ≤ 25) — therequired sum of points.

Output

Print the numbers of ways to get the second card in the requiredway if the first card is the queen of spades.

Sample Input

Input
12

Output
4
Input
20

Output
15
Input
10

Output
0

Hint

In the first sample only four two's of different suits can earnthe required sum of points.

In the second sample we can use all tens, jacks, queens andkings; overall it's 15 cards, as the queenof spades (as any other card) is only present once in the pack ofcards and it's already in use.

In the third sample there is no card, that would add a zero tothe current ten point



代码:


#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main()
{
   int n;
   while(cin>>n)
   {
           if(n==21){printf("4\n");continue;} 
       if(n<=10||n>20)
                   printf("0\n");
           if(n>10&&n<20)
             printf("4\n");
           if(n==20)
         printf("15\n");
   }
return 0;
}





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值