In JavaScript, ```if..else``` is the most basic condition statement,
it consists of three parts:```condition, statement1, statement2```, like this:
```python
if condition: statementa
else:         statementb
```
It means that if the condition is true, then execute the statementa, otherwise execute the statementb.If the statementa or statementb more than one line, you need to add ```{``` and ```}``` at the head and tail of statement in JS, to keep the same indentation on Python and to put a `end` in Ruby where it indeed ends.

An example, if we want to judge whether a number is odd or even, we can write code like this:
```python
def odd_even(n):
    if n%2: return "odd number"
    else:   return "even number"
```

If there is more than one condition to judge, we can use the compound if...else statement. an example:
```python
def old_young(age):
    if age<16:        return "children"
    elif (age<50): return "young man" #use "else if" if needed
    else:             return "old man"
```
This function returns a different value depending on the parameter age.

Looks very complicated? Well, JS and Ruby also support the ```ternary operator``` and Python has something similar too:
```python
statementa if condition else statementb
```
Condition and statement separated by "?", different statement separated by ":" in both Ruby and JS; in Python you put the condition in the middle of two alternatives.
The two examples above can be simplified with ternary operator:
```python
def odd_even(n):
    return "odd number" if n%2 else "even number"
def old_young(age):
    return "children" if age<16 else "young man" if age<50 else "old man"
```

## Task:
Complete function `saleHotdogs`/`SaleHotDogs`/`sale_hotdogs`, function accept 1  parameters:`n`, n is the number of customers to buy hotdogs, different numbers have different prices (refer to the following table), return a number that the customer need to pay how much money.
```
+---------------+-------------+
|  numbers n    | price(cents)|
+---------------+-------------+
|n<5            |    100      |
+---------------+-------------+
|n>=5 and n<10  |     95      |
+---------------+-------------+
|n>=10          |     90      |
+---------------+-------------+
```
You can use if..else or ternary operator to complete it.
    
    When you have finished the work, click "Run Tests" to see if your code is working properly.
    
    In the end, click "Submit" to submit your code pass this kata.
    
## [Series](http://github.com/myjinxin2015/Katas-list-of-Training-JS-series):

( ↑↑↑ Click the link above can get my newest kata list, Please add it to your favorites)

 - [#1: create your first JS function helloWorld](http://www.codewars.com/kata/571ec274b1c8d4a61c0000c8)
 - [#2: Basic data types--Number](http://www.codewars.com/kata/571edd157e8954bab500032d)
 - [#3:  Basic data types--String](http://www.codewars.com/kata/571edea4b625edcb51000d8e)
 - [#4:  Basic data types--Array](http://www.codewars.com/kata/571effabb625ed9b0600107a)
 - [#5:  Basic data types--Object](http://www.codewars.com/kata/571f1eb77e8954a812000837)
 - [#6:  Basic data types--Boolean and conditional statements if..else](http://www.codewars.com/kata/571f832f07363d295d001ba8)
 - [#7:  if..else and ternary operator](http://www.codewars.com/kata/57202aefe8d6c514300001fd)
 - [#8: Conditional statement--switch](http://www.codewars.com/kata/572059afc2f4612825000d8a)
 - [#9: loop statement --while and do..while](http://www.codewars.com/kata/57216d4bcdd71175d6000560)
 - [#10: loop statement --for](http://www.codewars.com/kata/5721a78c283129e416000999)
 - [#11: loop statement --break,continue](http://www.codewars.com/kata/5721c189cdd71194c1000b9b)
 - [#12: loop statement --for..in and for..of](http://www.codewars.com/kata/5722b3f0bd5583cf44001000)
 - [#13: Number object and  its properties](http://www.codewars.com/kata/5722fd3ab7162a3a4500031f)
 - [#14: Methods of Number object--toString() and toLocaleString()](http://www.codewars.com/kata/57238ceaef9008adc7000603)
 - [#15: Methods of Number object--toFixed(), toExponential() and toPrecision()](http://www.codewars.com/kata/57256064856584bc47000611)
 - [#16: Methods of String object--slice(), substring() and substr()](http://www.codewars.com/kata/57274562c8dcebe77e001012)
 - [#17: Methods of String object--indexOf(), lastIndexOf() and search()](http://www.codewars.com/kata/57277a31e5e51450a4000010)
 - [#18: Methods of String object--concat() split() and its good friend join()](http://www.codewars.com/kata/57280481e8118511f7000ffa)
 - [#19: Methods of String object--toUpperCase() toLowerCase() and replace()](http://www.codewars.com/kata/5728203b7fc662a4c4000ef3)
 - [#20: Methods of String object--charAt() charCodeAt() and fromCharCode()](http://www.codewars.com/kata/57284d23e81185ae6200162a)
 - [#21: Methods of String object--trim() and the string template](http://www.codewars.com/kata/5729b103dd8bac11a900119e)
 - [#22: Unlock new skills--Arrow function,spread operator and deconstruction](http://www.codewars.com/kata/572ab0cfa3af384df7000ff8)
 - [#23: methods of arrayObject---push(), pop(), shift() and unshift()](http://www.codewars.com/kata/572af273a3af3836660014a1)
 - [#24: methods of arrayObject---splice() and slice()](http://www.codewars.com/kata/572cb264362806af46000793)
 - [#25: methods of arrayObject---reverse() and sort()](http://www.codewars.com/kata/572df796914b5ba27c000c90)
 - [#26: methods of arrayObject---map()](http://www.codewars.com/kata/572fdeb4380bb703fc00002c)
 - [#27: methods of arrayObject---filter()](http://www.codewars.com/kata/573023c81add650b84000429)
 - [#28: methods of arrayObject---every() and some()](http://www.codewars.com/kata/57308546bd9f0987c2000d07)
 - [#29: methods of arrayObject---concat() and join()](http://www.codewars.com/kata/5731861d05d14d6f50000626)
 - [#30: methods of arrayObject---reduce() and reduceRight()](http://www.codewars.com/kata/573156709a231dcec9000ee8)
 - [#31: methods of arrayObject---isArray() indexOf() and toString()](http://www.codewars.com/kata/5732b0351eb838d03300101d)
 - [#32: methods of Math---round() ceil() and floor()](http://www.codewars.com/kata/5732d3c9791aafb0e4001236)
 - [#33: methods of Math---max() min() and abs()](http://www.codewars.com/kata/5733d6c2d780e20173000baa)
 - [#34: methods of Math---pow() sqrt() and cbrt()](http://www.codewars.com/kata/5733f948d780e27df6000e33)
 - [#35: methods of Math---log() and its family](http://www.codewars.com/kata/57353de879ccaeb9f8000564)
 - [#36: methods of Math---kata author's lover:random()](http://www.codewars.com/kata/5735956413c2054a680009ec)
 - [#37: Unlock new weapon---RegExp Object](http://www.codewars.com/kata/5735e39313c205fe39001173)
 - [#38: Regular Expression--"^","$", "." and test()](http://www.codewars.com/kata/573975d3ac3eec695b0013e0)
 - [#39: Regular Expression--"?", "*", "+" and "{}"](http://www.codewars.com/kata/573bca07dffc1aa693000139)
 - [#40: Regular Expression--"|", "[]" and "()"](http://www.codewars.com/kata/573d11c48b97c0ad970002d4)
 - [#41: Regular Expression--"\"](http://www.codewars.com/kata/573e6831e3201f6a9b000971)
 - [#42: Regular Expression--(?:), (?=) and (?!)](http://www.codewars.com/kata/573fb9223f9793e485000453)

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

def _disabled_input(*args, **kwargs):
    raise RuntimeError("input() is disabled in callable mode")
builtins.input = _disabled_input

ns = {"__name__": "__judge__"}  # prevent if __name__ == "__main__" blocks
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "class Color(object):\n    BLACK = 0\n    RED = 1\n\n\nclass Node(object):\n    __slots__ = ('r', 'left', 'right', 'value', 'color', 'parent')\n\n    def __init__(self, r, value, parent=None, color=Color.RED):\n        self.r = r\n        self.value = value\n        self.parent = parent\n        self.color = color\n        self.left = None\n        self.right = None\n\n    def value_copy(self, other):\n        self.r = other.r\n        self.value = other.value\n\n\nclass RangeDict(dict):\n\n    def __init__(self, mapping=None, iterable=None):\n        self._root = None\n\n        #explain init method\n        if mapping or iterable:\n            for k, v in (mapping.items() if mapping else iterable):\n                self[k] = v\n\n            \n    def __setitem__(self, r, v):\n        if r[1] < r[0]:\n            raise KeyError\n        node = self._insert(r, v)\n        self._insert_adjust(node)\n\n    def _insert(self, r, v):\n        if not self._root:\n            self._root = Node(r, v)\n            return self._root\n        cur = self._root\n        while True:\n            if r[1] < cur.r[0]:\n                if not cur.left:\n                    cur.left = Node(r, v, cur)\n                    return cur.left\n                cur = cur.left\n            elif r[0] > cur.r[1]:\n                if not cur.right:\n                    cur.right = Node(r, v, cur)\n                    return cur.right\n                cur = cur.right\n            else:\n                raise KeyError  # overlap not supported\n\n    def _insert_adjust(self, node):\n        ''' adjust to make the tree still a red black tree '''\n        if not node.parent:\n            node.color = Color.BLACK\n            return\n        if node.parent.color == Color.BLACK:\n            return\n        uncle = self.sibling(node.parent)\n        if node_color(uncle) == Color.RED:\n            node.parent.color = Color.BLACK\n            uncle.color = Color.BLACK\n            node.parent.parent.color = Color.RED\n            return self._insert_adjust(node.parent.parent)\n\n        #parent is red and uncle is black\n        # since parent is red, grandparent must exists and be black\n        parent = node.parent\n        grandparent = parent.parent\n        if self.is_left_son(parent, grandparent):\n            if self.is_left_son(node, parent):\n                self.right_rotate(grandparent)\n                grandparent.color = Color.RED\n                parent.color = Color.BLACK\n            else:\n                self.left_rotate(parent)\n                self.right_rotate(grandparent)\n                grandparent.color = Color.RED\n                node.color = Color.BLACK\n        else:\n            if self.is_left_son(node, parent):\n                self.right_rotate(parent)\n                self.left_rotate(grandparent)\n                grandparent.color = Color.RED\n                node.color = Color.BLACK\n            else:\n                self.left_rotate(grandparent)\n                grandparent.color = Color.RED\n                parent.color = Color.BLACK\n\n    def _find_key(self, key):\n        cur = self._root\n        while cur:\n            if key > cur.r[1]:\n                cur = cur.right\n            elif key < cur.r[0]:\n                cur = cur.left\n            else:\n                break\n        return cur\n\n    def _find_range(self, r):\n        cur = self._root\n        while cur:\n            if r[1] < cur.r[0]:\n                cur = cur.left\n            elif r[0] > cur.r[1]:\n                cur = cur.right\n            elif r[0] == cur.r[0] and r[1] == cur.r[1]:\n                return cur\n            else:\n                raise KeyError\n        raise KeyError\n\n    def __getitem__(self, key):\n        tar = self._find_key(key)\n        if tar:\n            return tar.value\n        raise KeyError\n\n    def __contains__(self, key):\n        return bool(self._find_key(key))\n\n    def __delitem__(self, r):\n        node = self._find_range(r)\n        if node.left and node.right:\n            left_rightest_child = self.find_rightest(node.left)\n            node.value_copy(left_rightest_child)\n            node = left_rightest_child\n        self._delete(node)\n\n    def _delete(self, node):\n        # node has at most one child\n        child = node.left if node.left else node.right\n        if not node.parent:  # node is root\n            self._root = child\n            if self._root:\n                self._root.parent = None\n                self._root.color = Color.BLACK\n            return\n\n        parent = node.parent\n        if not child:\n            child = Node(None, None, parent, Color.BLACK)\n        if self.is_left_son(node, parent):\n            parent.left = child\n        else:\n            parent.right = child\n        child.parent = parent\n\n        if node.color == Color.RED:\n            # no need to adjust when deleting a red node\n            return\n        if node_color(child) == Color.RED:\n            child.color = Color.BLACK\n            return\n        self._delete_adjust(child)\n        if not child.r:\n            # mock a None node for adjust, need to delete it after that\n            parent = child.parent\n            if self.is_left_son(child, parent):\n                parent.left = None\n            else:\n                parent.right = None\n\n    def _delete_adjust(self, node):\n        if not node.parent:\n            node.color = Color.BLACK\n            return\n\n        parent = node.parent\n        sibling = self.sibling(node)\n        if node_color(sibling) == Color.RED:\n            if self.is_left_son(node, parent):\n                self.left_rotate(parent)\n            else:\n                self.right_rotate(parent)\n            parent.color = Color.RED\n            sibling.color = Color.BLACK\n            sibling = self.sibling(node)  # must be black\n\n        # sibling must be black now\n        if not self.is_black(parent) and self.is_black(sibling.left) and \\\n           self.is_black(sibling.right):\n            parent.color = Color.BLACK\n            sibling.color = Color.RED\n            return\n\n        if self.is_black(parent) and self.is_black(sibling.left) and \\\n           self.is_black(sibling.right):\n            sibling.color = Color.RED\n            return self._delete_adjust(parent)\n\n        if self.is_left_son(node, parent):\n            if not self.is_black(sibling.left) and \\\n               self.is_black(sibling.right):\n                sibling.left.color = Color.BLACK\n                sibling.color = Color.RED\n                self.right_rotate(sibling)\n                sibling = sibling.parent\n\n            # sibling.right must be red\n            sibling.color = parent.color\n            parent.color = Color.BLACK\n            sibling.right.color = Color.BLACK\n            self.left_rotate(parent)\n        else:\n            if not self.is_black(sibling.right) and \\\n               self.is_black(sibling.left):\n                sibling.right.color = Color.BLACK\n                sibling.color = Color.RED\n                self.left_rotate(parent)\n                sibling = sibling.parent\n\n            # sibling.left must be red\n            sibling.color = parent.color\n            parent.color = Color.BLACK\n            sibling.left.color = Color.RED\n            self.right_rotate(parent)\n\n    def left_rotate(self, node):\n        right_son = node.right\n\n        if not node.parent:\n            self._root = right_son\n        elif self.is_left_son(node, node.parent):\n            node.parent.left = right_son\n        else:\n            node.parent.right = right_son\n        right_son.parent = node.parent\n\n        node.parent = right_son\n        node.right = right_son.left\n        right_son.left = node\n\n    def right_rotate(self, node):\n        left_son = node.left\n        if not node.parent:\n            self._root = left_son\n        elif self.is_left_son(node, node.parent):\n            node.parent.left = left_son\n        else:\n            node.parent.right = left_son\n        left_son.parent = node.parent\n\n        node.parent = left_son\n        node.left = left_son.right\n        left_son.right = node\n\n    @staticmethod\n    def sibling(node):\n        if node.parent.left == node:\n            return node.parent.right\n        else:\n            return node.parent.left\n\n    @staticmethod\n    def is_left_son(child, parent):\n        if parent.left == child:\n            return True\n        else:\n            return False\n\n    @staticmethod\n    def find_rightest(node):\n        while node.right:\n            node = node.right\n        return node\n\n    @staticmethod\n    def is_black(node):\n        return node_color(node) == Color.BLACK\n\n\ndef node_color(node):\n    if not node:\n        return Color.BLACK\n    return node.color\n\n\ndef in_order(root):\n    ret = []\n    if not root:\n        return []\n    return in_order(root.left) + [root.value] + in_order(root.right)\n\n\ndef height(root):\n    if not root:\n        return 0\n    return 1 + max(height(root.left), height(root.right))\n\n\ndef sale_hotdogs(n):\n    d = RangeDict({\n        (0, 5-1): 100,\n        (5, 10-1): 95,\n        (10, float('inf')): 90\n        })\n    return d[n] * n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

_target = None
_fn_name = 'sale_hotdogs'
if _fn_name:
    if "Solution" in ns:
        try:
            _obj = ns["Solution"]()
            if hasattr(_obj, _fn_name):
                _target = getattr(_obj, _fn_name)
        except Exception:
            _target = None
    if _target is None and _fn_name in ns and callable(ns[_fn_name]):
        _target = ns[_fn_name]
# Fallback: if there's exactly one user-defined function, use it
if _target is None:
    _cands = [v for k, v in ns.items() if callable(v) and getattr(v, "__module__", "") in ("__judge__", "__main__")]
    _user_funcs = [c for c in _cands if getattr(c, "__name__", "").startswith("_") is False]
    if len(_user_funcs) == 1:
        _target = _user_funcs[0]
if _target is None:
    raise RuntimeError(f"Could not resolve callable '{_fn_name}'")

_raw = sys.stdin.read().strip()
if _raw:
    _parsed = json.loads(_raw)
    if isinstance(_parsed, dict):
        _kwargs = _parsed.get("kwargs", {})
        _args = _parsed.get("args", [])
    else:
        _args, _kwargs = _parsed, {}
else:
    _args, _kwargs = [], {}
if not isinstance(_args, (list, tuple)):
    _args = [_args]
_res = _target(*_args, **_kwargs)
try:
    sys.stdout.write(repr(_res) + "\n")
except Exception:
    pass

```

Measured memory_bytes: 8932