Since the first weekend of October is drawing near, let's have our own Oktoberfest!
Background
You and some other programmers have been hired by the local sausage guys in Munich, Germany. The sausage guys provide Oktoberfest with all the sausages the giant Volksfest needs. You manage to overhear your boss speaking to the other employees about why you and the others were hired without any previous sausage-related experience. You realize you were hired for your impeccable programming skills - and your boss apparently wants you to code a sausage analyzer.
This year around, the sausage guys have decided to increase the variety of sausages at Oktoberfest - but they have no idea of how much they've imported.
Challenge
You need to help your boss figure out how much sausage of a certain kind they've actually imported. You will have to program a sausage analyzer which outputs the kind and number of every sausage the sausage guys have imported.
Your boss has bought a special floppy drive for this occasion which, given a sausage, pipes it to stdin
.
Input
A number of sausages on stdin
, each sausage separated by one space.
Sausages are given on the following format:
Prinskorv (P)
¤
| |
| |
| |
¤
Salchichón (S)
l
| |
| |
| |
| |
l
Landjäger (L)
\ /
| |
| |
| |
| |
/ \
Kabanos (K)
.
|
|
|
|
|
.
Cotechino Modena (C)
___
| |
| |
| |
|___|
Rød pølse (R)
^
| |
| |
| |
| |
v
Output
The occurrences of a given sausage along with an identifier of which kind of sausage it is, separated by a space. The identifier is the first letter in the name of the sausage. Order is not important.
Output shall be written to stdout
, trailing newlines and spaces are allowed.
Examples
Input
^ ^ ^ ^ .
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
v v v v |
.
Output
4R 1K
Input
\ / ___ l ¤ ¤
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | |___| | | ¤ ¤
/ \ l
Output
1L 1C 1S 2P
Input
l ¤ l
| | | | | |
| | | | | |
| | | | | |
| | ¤ | |
l l
Output
2S 1P
The programmer with the shortest program in bytes gets paid by the sausage guys (wins)!
Sausage trivia
Prinskorv
Prinskorv which directly translates to "prince-sausage" is a small Swedish sausage which is often sold in links. Usually fried in a frying pan and served with a generous helping of mustard.
Salchichón
Salchichón is a Spanish summer sausage often made with pork, although some recipes use other meats including ox, veal or horse. The meat and fat are chopped in thin bits, seasoned with salt, pepper, nutmeg, oregano, and garlic and then inserted in thick natural pork intestines.
Landjäger
Landjäger is a semi-dried sausage traditionally made in Southern Germany, Austria, Switzerland, and Alsace. It is popular as a snack food during activities such as hiking. It also has a history as soldier's food because it keeps without refrigeration and comes in single-meal portions.
Kabanos
Kabanos is a Polish long thin dry sausage made of pork or kosher turkey. They are smoky in flavour, and can be soft or very dry in texture depending on freshness. Kabanosy are often seasoned only with pepper. Unlike other meats, these sausages are typically eaten alone as an appetiser and, except when kosher, often served with cheese.
Cotechino Modena
Cotechino Modena or Cotechino di Modena is a fresh sausage made from pork, fatback, and pork rind, and comes from Modena, Italy, where it has PGI status. Cotechino is often served with lentils or cannellini beans with a sauce alongside mashed potatoes, especially around the New Year.
Rød pølse
Rød pølse (red sausage) is a type of brightly red, boiled pork sausage very common in Denmark. Since hot dog stands are ubiquitous in Denmark, some people regard røde pølser as one of the national dishes.
All sausage information shamelessly copied from Wikipedia