[Question]
  [
I'm sure you know about the $9.99 price scheme, instead of using $10. Well, in your new job as a sys admin at a large retail store, they want prices to adhere to a similar scheme:
* All prices are in whole dollars, no cents.
* All prices should end with 5 or 9, rounding to the closest but up if the last digit is right between 5 and 9. (Applies to last digit 2 and 7)
* Lowest input is $1, and the lowest outputted price should be $5.
Your input is a list of integers:
```
12
8
41
27
144
99
3
```
And the output should a list of the new prices. In the above case:
```
15
9
39
29
145
99
5
```
  
[Answer]
# Brainfuck, 4428 bytes (invalid)
Once I knew the algorithm worked, I lost interest and didn't finish the input handler. That's why this solution technically solves the problem, but is very hard to use. When you start the program in an **interactive** interpreter (faster is better), you can enter your "number". It has to be entered in Base256 if your interpreter doesn't support number conversion (mine does). The maximum price you can enter is therefore 255. 
It then performs a looping modulo if the number is greater than 9 to split off all digits except the last one. The division results are saved, while the last digit is rounded to 5 or 9. Then they are added and printed. Then the program cleans all used registers (probably overkill) and asks for the next number.
It handles all special cases (`$1`, `$20/$21 -> $19` etc.). Watch it run for the number `4` here (about 3 minutes, video shortened):
[![video demo](https://i.stack.imgur.com/odN90.gif)](https://i.stack.imgur.com/odN90.gif)
## Code
```
>+<+[>>>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<[>[-]+<-]>
[<+>>>>>>>>>>>[-],>>[-]<[-]<[>+<<<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>
>>>>[-]>[<+<<<<<<<<+>>>>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>>>>[-]+++++++++>[<<<<+
>>>>-]<[<<<<<<+>+<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>>[>>[<+<<<+>>>>-]<<<<[>>>>+<<<<-]
+>>>[<<->>>-<<<<->>>[-]]<<<[>>[-]+<<-]>>-]>>[>>>>-<<<<[-]]<<<[-]<->>>>>>>>[<<<<<<<<->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<
<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>>[-]+++++<<<<<
<<<<<-]>>>>>>>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>>>>>-]<<<<[<<<<
<<<<<<<<<<<<<<<+>>>>>>>>>>>>>>>>>>>-]<<<<<<<<<<<<<<<<<<<[>[-]+<-]>[<+>>>>>>>>>>[-]>>>[<<
<+<<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+<<<<<<<<<<<-]>>>>>>>[-]>>[<<+<<<<<<<+>>>
>>>>>>-]<<<<<<<<<[>>>>>>>>>+<<<<<<<<<-]>>>>>>>[>+<<<<<<<<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<
<<-]>>>>>>>>>>>[-]<<<[>>>+<<<-][-]>>>[<<<+<<<<<<<<+>>>>>>>>>>>-]<<<<<<<<<<<[>>>>>>>>>>>+
<<<<<<<<<<<-]>[-]>[-]>[-]>[-]>>>>[<<<<<+[>+<<<<+>>>-]<<<[>>>+<<<-]+>>>>----------[<<<<->
>>>[-]]<<<<[>>+>[-]<<<-]>>[>>+<<<<+>>-]<<[>>+<<-]+>>>>----------[<<<<->>>>[-]]<<<<[>+>[-
]<<-]>>>>>>>>-]<<<<<<<[<++++++++[>++++++>++++++<<-]>.>.[-]<[-]]>[<<++++++++[>>++++++<<-]
>>.[-]]<<++++++++[>>>++++++<<<-]>>>.[-]<<<++++++++++.[-]>>>>>>>>>>>>>>>+<<<<<<<<<<<<<<<<
<->-]<[>[-]+<-]>[<+<->>-]<<]
```
[Answer]
# CJam, ~~19~~ 17 bytes
```
q~{2-Ab)4>59s=N}/
```
[Test it here.](http://cjam.aditsu.net/#code=q~%7B2-Ab)4%3E59s%3DN%7D%2F&input=%5B12%208%2041%2027%20144%2099%201%5D)
Takes input as a CJam-style list and returns output newline separated.
# Explanation
```
qN/{   e# Run this block for each line of the input...
  ~    e#   Evaluate the current line to get the integer.
  2-   e#   Subtract 2 to get all but the last digit right.
  Ab)  e#   Convert to base 10 (discarding a potential minus sign) and split off
       e#   the last digit.
  4>   e#   Test if it's greater than 4.
  59s= e#   Select the correct digit from the string "59" based on this result.
  N    e#   Push a line feed.
}/
```
[Answer]
## Python 2, 47
```
lambda l:[max(5,(n+3)/5*5-(n-2)/5%2)for n in l]
```
If we look at the sequence of rounded values, we see that they come in blocks of 5. 
```
... 25, 29, 29, 29, 29, 29, 35, 35, 35, 35, 35, 39, ...
```
We find what number block we're in with `(n+3)/5` (call this value `J`). Then, we get the right multiple of `5` with `J*5`, and adjust things like `30` down to `29` by subtracting `1` whenever `J` is even.
To special-case `1` give `5` rather than `-1`, we pass the result to `max(5,_)`.
[Answer]
# Retina, 32 bytes
Accepts input in a comma separated list. There must be a trailing comma. Outputs in the same format.
```
T`d`aa555559`.,
T+`da`ad`\da
a
5
```
**Explanation:**
```
T`               #Transliteration mode.
  d`aa555559`    #Map the digits 0-9 to aa55555999
             .,  #Map only the trailing digits.
T+`              #Do until input does not change.
   da`ad`        #Map a to 9, 0 to a, and 1-9 to 0-8
         \da     #Only do this to each a and the character before each a.
a                #Match all leftover a's. This only happens when the input contains the integer 1.
5                #Replace them with 5.
```
[Answer]
## Python 3, 74 82 bytes
```
a=eval(input())
for i in a:print(round(i,-1)+[5,-1][max(4,i-2)%10>4])
```
I struggled for brevity on values less than 11 and the requirement for 1 to evaluate to 5.
[Answer]
# R, ~~51~~ ~~49~~ ~~47~~ 43 bytes
```
(f=((n=scan()-2)%/%5+1+(n<0))*5)-(f%%10==0)
```
There should be room to improve this, but I thinking a different strategy might be better. Takes a vector of integers from scan and outputs a vector of integers. Essentially this uses integer division to round the number down, adds 1 and multiples it by five. Anything divisible by 10 has 1 taken away. If n = 1 then it increments the integer division by 1.
Test run
```
> (f=((n=scan()-2)%/%5+1+(n<0))*5)-(f%%10==0)
1: 1
2: 12
3: 8
4: 41
5: 27
6: 144
7: 99
8: 3
9: 
Read 8 items
[1]   5  15   9  39  29 145  99   5
> 
```
[Answer]
# Pyth, ~~21~~ ~~18~~ ~~29~~ 28 bytes
Thanks to @Jakube for cutting 3 bytes!
```
KeQJ-QKI<K2tJ.q;I<K6+J5;E+J9
```
 [Try it here.](https://pyth.herokuapp.com/?code=KeQJ-QKI%3CK2tJ.q%3BI%3CK6%2BJ5%3BE%2BJ9&test_suite=1&test_suite_input=12%0A8%0A41%0A27%0A144%0A99%0A3&debug=0) 
**EDIT:** Apparently it was invalid. I fixed it up at the cost of 11 bytes; I'll try to golf it more.
[Answer]
# Pyth, 21 bytes
```
m?tdtt+d@jC"²a<"6ed5Q
```
Sadly I have to spend 4 bytes to correctly handle $1.
[Answer]
# Pyth, 18 bytes
```
m-|*K5hJ/-d2K6%J2Q
```
Try it online: [Demonstration](http://pyth.herokuapp.com/?code=m-%7C%2AK5hJ/-d2K6%25J2Q&input=%5B1%2C12%2C8%2C41%2C27%2C144%2C99%2C3%5D) or [Test Suite](http://pyth.herokuapp.com/?code=m-%7C%2AK5hJ/-d2K6%25J2Q&input=%5B1%2C12%2C8%2C41%2C27%2C144%2C99%2C3%5D)
This answer is based on @xor's Python/Pyth solution. The main difference is, that I handle the special case `1` differently. The actual result for `1` would be `0 - 1 = -1`. Using Python's `or` I can replace the `0` with a `6`, resulting in `6 - 1 = 5`. This saves the pain of taking the maximum of `5` and the result. 
### Explanation:
```
m-|*K5hJ/-d2K6%J2Q
m                Q   map each number d of the input list Q to:
    K5                  K = 5
       J/-d2K           J = (d - 2) / K
   *K hJ                   K * (J + 1)
  |                     or
             6             6 # if K*(J+1)==0
 -            %J2       minus (J mod 2)
```
[Answer]
# [Hassium](http://HassiumLang.com), 133 Bytes
```
func main(){i=[12,8,41,27,144,99,3];foreach(e in i){f=e%10;if(!(e/10==0))print(e/10);if(f<5)r=5;else if(f>5)r=9;elser=f;println(r);}}
```
Run and see the expanded online:
<http://hassiumlang.com/Hassium/index.php?code=4f1c14f4d699b11da7a6392a74b720c4>
[Answer]
# TI-BASIC, 19 bytes
```
int(Ans/5+.6
max(5,5Ans-not(fPart(Ans/2
```
Uses xnor's algorithm. TI-BASIC gets vectorization and multiplication for free, but we spend a few more bytes because it doesn't have modulo.
[Answer]
# Ruby, ~~55~~ 50 + 1 bytes
Run it with the `n` flag, like so: `ruby -n prices.rb`. Enter each price on a separate line.
```
x=$_.to_i
p x<7?5:(x-2).round(-1)+(~/[2-6]$/?5:-1)
```
[Answer]
# JavaScript, 50
```
l=>l.map(n=>Math.max(5,((n+3)/5|0)*5-((n-2)/5&1)))
```
I use an `&1` to save bytes instead of `|0` and mod 2
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 33 bytes
```
/.1$|[60]$/?$_--:$_++until/[59]$/
```
[Try it online!](https://tio.run/##K0gtyjH9/19fz1ClJtrMIFZF314lXlfXSiVeW7s0ryQzRz/a1BIo@v@/oRGXBZeJIZeROZehiQmXpSWXMZfRv/yCksz8vOL/ugU5AA "Perl 5 – Try It Online")
[Answer]
# Haskell, 114 bytes
```
g n
 |n>6=9-n
 |n>1=5-n
 |1>0=(-n-1)
f n=show$(read n)+(g$read$(:[])$last n)
main=interact(unlines.(map f).lines)
```
## Explanation:
The function `g` returns `9-n` if `n>6` or else `5-n` if `n>1` or else `-n-1`. `g` is given the last digit and returns what should be added to the input number. `f` uses `g` to get the solution (plus lots of string manipulation). `main` outputs the result of `f` for each line of input.
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), `ja`, ~~13~~ 12 bytes
```
ƛ⇩ȧṫ4>59$iJṅ
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=ja&code=%C6%9B%E2%87%A9%C8%A7%E1%B9%AB4%3E59%24iJ%E1%B9%85&inputs=12%0A8%0A41%0A27%0A144%0A99%0A3&header=&footer=)
I simply ported the CJam answer.
## Explained
```
ƛ⇩ȧṫ4>59$iJṅ
ƛ             # Over every number in the input,
 ⇩ȧ           #   abs(a - 2)
   ṫ4>        #   ↑[:-1], ↑[-1] > 4
      59$i    #   indexed into 59
          Jṅ  #   merged and joined on ""
```
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 12 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
Ç«δv▀▼ÖP▄¶⌠"
```
[Run and debug it](https://staxlang.xyz/#p=80aeeb76df1f9950dc14f422&i=12%0A8%0A41%0A27%0A144%0A99%0A3)
Yet another port of the CJam answer.
-1 more byte if a list of integers is taken as input.
]