# Mixed Number to an Improper Fraction

In this challenge you will be converting a mixed number to an improper fraction.

Because improper fractions use fewer numbers, your code will need to be as short as possible.

## Examples

4 1/2
9/2

12 2/4
50/4

0 0/2
0/2

11 23/44
507/44


## Specification

You may assume the denominator of the input will never be 0. The input will always be in the format x y/z where x,y,z are arbitrary nonnegative integers. You do not need to simplify the output.

This is so shortest code in bytes wins.

• You should add the tag "parsing". I'm sure most answers will spend more bytes on parsing the input and formatting the output than on doing the math. – nimi Dec 17 '15 at 18:31
• Can the output be a rational number type or does it have to be a string? – Martin Ender Dec 17 '15 at 18:33
• @AlexA.: ... but a large part of the challenge. According to it's description the tag should be used in such cases. – nimi Dec 17 '15 at 18:38
• Can x, y and z be negative? – Dennis Dec 17 '15 at 19:21
• Based on the challenge I'm assuming it is, but is the input format "x y/z" mandatory, or can the space be a new-line, and/or the x,y,z be separated inputs? Most answers are assuming the input format is indeed mandatory to be x y/z, but some aren't, hence this question to have a definitive answer. – Kevin Cruijssen Jun 15 '18 at 13:04

# Ouroboros, 16 bytes

rr\r.@*@+n47on1(


Try it here!

### Explanation

The reason why Ouroboros is great for this challenge: its integer-reading primitive, r, skips over any non-digit characters until it comes to a number. So no parsing is required; we just read three numbers and process them.

rr                Read the first two numbers
Stack: 11 23
\r              Swap and read the third one
Stack: 44 23 11
.             Duplicate
Stack: 44 44 23 11
@            Rotate (moving third item to top of stack)
Stack: 23 44 44 11
*           Multiply
Stack: 1012 44 11