text:
Output the qwerty keyboard
Given a character, output (to the screen) the entire qwerty keyboard layout (with spaces and newlines) that follows the character. The examples make it clear.
Input 1
f

Output 1
g h j k l
z x c v b n m

Input 2
q

Output 2
w e r t y u i o p
a s d f g h j k l
z x c v b n m

Input 3
m

Output 3
(Program terminates without output)
Input 4
l

Output 4
z x c v b n m

Shortest code wins. (in bytes)
P.S.
Extra newlines, or extra spaces at the end of a line are accepted.

Is a function sufficient or do you require a full program that reads/writes to stdin/stdout?

@agtoever As per http://meta.codegolf.stackexchange.com/questions/7562/is-a-function-allowed, it is allowed. However, the function must still output to the screen .

@agtoever Try this link instead. http://meta.codegolf.stackexchange.com/questions/2419/default-for-code-golf-program-function-or-snippet

I like the ones that don't have the keyboard layout visible explicitly in the code.  They should get bonus marks :)

At first i was confused by input 4, then I realised that it's a small L and not a decimal one

are leading space before a line allowed?

@SahilArora Nope.

Might this qualify for [tag:kolmogorov-complexity] ? Not sure though

CJam, 42 40 bytes
"wertyuiop asdfghjkl zxcvbnm"q/W=S%Sf*N*

Test it here.
Explanation
"we...nm"
     e# Push the letters in order, without q. We don't need q, because it will never
     e# be part of the output.
q/   e# Split the string around the input. If the input is "q", the entire string
     e# will go into a single chunk.
W=   e# Select the last chunk.
S%   e# Split the string around spaces, discarding empty segments (only relevant for the
     e# first segment if the input is "p" or "l").
Sf*  e# Join each line by spaces.
N*   e# Join the lines by linefeeds.

What is e#? Is it the CJam syntax for a comment? Thanks in advance.

@A.L yes it is.

Pyth, 33 bytes
jjL\ cec."`zÈ´ýß44,ûtKÕÀ@"z\`

Note that some characters are unprintable. Try it online in the Pyth Compiler.
How it works
jjL\ cec."`z…"z\`

        ."`z…"     Unpack …, with lowest character '`' and highest character `z`.
       c      z    Split at occurrences of the input (z).
      e            Retrieve the last resulting chunk.
     c         \`  Split into rows, at backticks.
 jL\               Separate the characters of each row by spaces.
j                  Separate the rows by linefeeds.

Aw man, I had just created my first Pyth program ever (only 38 bytes!), then you came along... +1 BTW, I think \  is equivalent to d.

Oops, I guess it's not the same... what's different?

@ETHproductions @Dennis Same reason why md5 doesn't produce 5 spaces. d is the default variable that iterates through the iterable argument of the map operator. And jL\ <list> is simply a shortcut for the map operator mj\ d<list>.

@Jakube Oh, that makes sense. Thanks!

Perl, 56 bytes
#!perl -p
'qwertyuiop
asdfghjkl
zxcvbnm'=~/$_
?/;$_=$';s/\B/ /g

Counting the shebang as 3, input is taken from stdin. If a leading newline isn't a concern for inputs p and l, then /$_\n?/ could be replaced with a bare $_ to save 4.

Sample Usage
$ echo g|perl qwerty.pl
h j k l
z x c v b n m

$ echo v|perl qwerty.pl
b n m

Thank you for teaching me about \K!

@DomHastings in this case, it wasn't really necessary for the byte count, s/.\B/$& /g would work equally well. A better example.

JavaScript (ES6), 60 bytes
x=>[...`qwertyuiop
asdfghjkl
zxcvbnm`].join` `.split(x)[1]

Uses the same technique as most other answers. Suggestions welcome!

Can you explain why do you use the "...". I try without on JSFiddle and still working?

@Awashi It is a spread operator. It separates the string into an array of characters. Without it the .join\ `` would do nothing and there would be no spaces in the result.

@user81655 Tank you

GS2, 38 37 bytes
♦wertyuiop asdfghjkl zxcvbnm♣B3$,■♪2◙

The source code uses the CP437 encoding. Try it online!
Test run
$ base64 -d > qwerty.gs2 <<< BHdlcnR5dWlvcCBhc2RmZ2hqa2wgenhjdmJubQVCMyQs/g0yCg==
$ wc -c qwerty.gs2
37 qwerty.gs2
$ echo -n f | gs2 qwerty.gs2
g h j k l
z x c v b n m

How it works
♦                                      Begin string literal.
 wertyuiop asdfghjkl zxcvbnm
                            ♣          End string literal.
                             B         Swap the string with the input.
                              3        Split the string at the input character.
                               $       Select the last chunk.
                                ,      Split the selected chunk at spaces.
                                 ■     Map over the resulting array:
                                  ♪      Push ' '.
                                   2     Join the characters, separating by ' '.
                                    ◙    Push a linefeed.

C#, 112 bytes 105 110
Count went up by 5 bytes, but more correct! Thanks @MartinBüttner!!
void c(char i){System.Console.Write(@"q w e r t y u i o p
a s d f g h j k l
z x c v b n m".Split(i)[1].Trim());}

Un-golfed
void c(char i)
{
    System.Console.Write(@"q w e r t y u i o p
    a s d f g h j k l
    z x c v b n m".Split(i)[1].Trim());
}

TeaScript, 50 45 44 bytes
TeaScript is JavaScript for golfing.
`qwertyuiop
asdfghjkl
zxcvbnm`.s×[1]s(b)j(p)

Ungolfed and explanation
`qwertyuiop
asdfghjkl
zxcvbnm`.s(x)[1]s(b)j(p)

      // Implicit: x = input string
`...` // Take the qwerty string,
.s(x) // and split it at the input.
[1]   // Take the second item from this,
s(b)  // split it into chars,
j(p)  // and join the result with spaces.
      // Implicit: output final expression

Ruby, 63 57 bytes
Takes the character as command line argument: ruby keyboard.rb e
"qwertyuiop
asdfghjkl
zxcvbnm".scan$*[0]
puts$'.chars*' '

Python, 83 bytes
lambda c,s="q w e r t y u i o p\na s d f g h j k l\nz x c v b n m":s[s.index(c)+2:]

Try it online

Ruby, 86 87 83 71 66
puts"qwertyuiop
asdfghjkl
zxcvbnm ".split($*[0])[1].gsub /./,'\& '

The extra space after m is to prevent the program from crashing if the input is 'm'.
Thanks to @manatwork for ~16 bytes of tips

Let me guess… Too many Python coding in the last time?

Some minor syntax changes: ARGV → $*; each_char → chars; do..end → {..}; printf → $><< + % would lead to this: "qwertyuiop↵asdfghjkl↵zxcvbnm".split($*[0])[1].chars{|i|$><<"%s "%i}. More in Tips for golfing in Ruby.

@manatwork First time trying to golf in Ruby, thanks for the tips/link!

I see you didn't got the hint in my first comment. In Ruby there is no need for triple quotes around multiline strings. (Actually I had no idea until now that it accepted by Ruby.)

@manatwork Whoops. Didn't know that either; thought you meant something else.

The leading spaces in the output are quite ugly. As . in regular expression does not match \n by default, better use that for the spacing: puts"qwertyuiop↵asdfghjkl↵zxcvbnm ".split($*[0])[1].gsub(/./,'\& '). Though the code length will remain the same.

JavaScript ES6, 73
f=x=>[...(k=`qwertyuiop
asdfghjkl
zxcvbnm`).slice(k.search(x)+1)].join` `

If a leading newline is not allowed when parameter is p or l, then 83
f=x=>(k=`q w e r t y u i o p
a s d f g h j k l
z x c v b n m`).slice(k.search(x)+2)

Sed, 59 characters
(58 characters code + 1 character command line option.)
s/./&qwertyuiop\nasdfghjkl\nzxcvbnm/
s/(.).*\1//
s/\w/& /g

Sample run:
bash-4.3$ echo -n 'f' | sed -r 's/./&qwertyuiop\nasdfghjkl\nzxcvbnm/;s/(.).*\1//;s/\w/& /g'
g h j k l
z x c v b n m

Japt, 49 42 41 40 38 bytes
Japt is a shortened version of JavaScript. Interpreter
`qØÆyuiop\n?dfghjkl\nzxcvbnm`qU g1 ¬qS

The ? should be the unprintable Unicode char U+0086.
How it works
          // Implicit: U = input char
`...`     // Take the compressed string and decompress it.
qU g1     // Split the string at the input and take the second item.
¬qS       // Split into chars, then join with spaces.
          // Implicit: output final expression

Now beating CJam! :) Suggestions welcome!
Non-competing version, 12 bytes
;Dv qU g1 ¬¸

As of Jan 11, I've added a cool new feature to Japt: If the program contains a leading comma, the variables ABCDEFGHIJL are redefined to various values. D is set to "QWERTYUIOP\nASDFGHJKL\nZXCVBNM", so ;Dv is enough to replace the string here.

PHP, 88 bytes
<?=$m[1&ereg("$argn.(.*)",'q w e r t y u i o p
a s d f g h j k l
z x c v b n m',$m)];

Requires the -F command line option, counted as 3. Default .ini setting are assumed (you may disable your local .ini with -n).

Sample Usage
$ echo g|php -F qwerty.php
h j k l
z x c v b n m

$ echo v|php -F qwerty.php
b n m

Prolog (SWI), 153 133 bytes
Edit: Cut 20 bytes with tips from @Fatalize
Code
b([A,_|T],[H]):-A=H,writef('%s',[T]);b(T,[H]).
p(X):-name(X,C),b(`q w e r t y u i o p \r\na s d f g h j k l \r\nz x c v b n m`,C),!.

Explanation
p(X):-name(X,C),                                                               % Get charcode of input
      b(`q w e r t y u i o p \r\na s d f g h j k l \r\nz x c v b n m`,C),!.    % Get keyboard chars as charcodes and call b
b([A,_|T],[H]):-A=H,                                                           % If list head is input element
                writef('%s',[T]);                                              % Interpret list as charcodes and print as string
                b(T,[H]).                                                      % Else remove first element of list and try again

Examples
>p(f).
g h j k l
z x c v b n m

>p(q).
w e r t y u i o p
a s d f g h j k l
z x c v b n m

Using SWI-Prolog, you could shorten the atom_codes part by using the backquotes which delimit string codes (so you could replace directly L in the call of b with the string).

@Fatalize cool! As I'm using SWI-Prolog for testing anyway, that sounds like a great idea.

Also, using b([A,_|T],[H]):-A=H,writef('%s',[T]);b(T,[H]). instead of 2 different rules for b is 7 bytes shorter. Usually, it's always shorter to merge all rules into a single one with ORs ; instead of writing multiple rules, because you avoid repeating the predicate's name and parameters and you avoid a linefeed too ;)

It's been so long since I learned Prolog that I had totally forgotten that you could OR like that. Great tip! Thanks :)

Befunge, 122 bytes
"m n b v c x z"25*"l k j h g f d s a"v
v1-")"g2-"U"~"q w e r t y u i o p"*25<
>-:#v_$>:#,_@ZVD0FHJ:LNP^\<>,2B48X.T6R
^1$\<

It has been tested here: Befunge-93 Interpreter.
How it works

'q w e r t y u i o p\na s d f g h j k l\nz x c v b n m' is pushed on the stack.
The number of values to discard (hardcoded in @ZVD0FHJ:LNP^\<>,2B48X.T6R) N is pushed.
First N values are discarded and the remaining values are printed.

Note
I picked the encoding so the string starts with @ in order to overlap with the program. This string is generated with the following python code:
import string
letters = string.ascii_lowercase
base = 'q w e r t y u i o p a s d f g h j k l z x c v b n m'
print(''.join(chr(base.index(x) + 32 + 9 + 3) for x in letters))

Good first answer! Welcome to Code Golf SE. (I'm new as well.)

Python 2, 58 67 63 bytes ##
lambda x:" ".join("qwertyuiop\nasdfghjkl\nzxcvbnm".split(x)[1])

Takes input as a string or char.
Splits the string at the input and prints off everything after the split.
(First time code-golfing, please be gentle :P )
EDIT: Didn't see the additional spaces required between characters, added now
EDIT 2: Modified to be an anonymous lambda function and removing the additional split arg, saving 4 bytes

Welcome to PPCG! I don't think you need the space after print, but it seems that this doesn't print the spaces between each pair of letters.

Can't provide a reference right now, but when the interpreter requires extra formatting of the input, that is also included in the count. (Correct me if I am wrong, but I think this only works if the input is passed together with surrounded quotes, like "f".)

Nice first golf. Functions are allowed by default, even anonymous ones, so it's shorter to do this as lambda s:.... I think the split doesn't need an arg of 1, since the character appears only once. This outputs spaces at the start of succeeding lines, not sure if that's allowed.

Mumps - 102 Bytes
Golfed script:
S A="qwertyuiopasdfghjklzxcvbnm",B=0 R P F I=1:1:$L(A) S Q=$E(A,I) W:B Q," " X:"qpl"[Q "W !" S:Q=P B=1

Ungolfed and commented:
 S A="qwertyuiopasdfghjklzxcvbnm" ; Need the qwerty order
 S B=0 ; boolean flag for printing, default to false.
 R P   ; read from stdin into P
 F I=1:1:$L(A) D   ; Count I from 1 to length of qwerty variable; do all of the following:
 . S Q=$E(A,I)     ; Extract 1 letter (at position I) from A and save in Q.
 . W:B Q," "       ; If our print flag (B) is true, print the letter in Q & a space.
 . X:"qpl"[Q "W !" ; If Q is q, p or l, write a cr/lf
 . S:Q=P B=1       ; If Q == P (stdin) change our print flag from false to true.

The rule allowing extra newlines saved me almost 10 bytes...

JavaScript, 88 bytes
function s(d){alert("qw e r t y u i o p\na s d f g h j k l\nz x c v b n m".split(d)[1])}

(no need in the space after the first char, as it never gets to the output)
Alerts the keyboard when you call s("some letter"). Can be also made with document.write() or console.log(), but hey, it's longer :P
Demo:

function s(d){alert("qw e r t y u i o p\na s d f g h j k l\nz x c v b n m".split(d)[1])}

s(prompt("Enter the key"));

You could probably save a few bytes by just using \n instead of ; in the string and getting rid of the replace.

@Eth Sure, thanks! I did use the replace, because at first, without counting the line breaks, the replace would shorten. Then I've noticed that the line breaks should be there, so I've used replace again. Didn't even think it could make the code longer :D

Java - 107 bytes
void q(char c){System.out.print("qwertyuiop\nasdfghjkl\nzxcvbnm ".split(""+c)[1].replaceAll("\\w","$0 "));}

Ungolfed with wrapper-class reading from System.in
public class Qwerty {

    public static void main(String[] args) {
        new Qwerty().q(new java.util.Scanner(System.in).next().charAt(0));
    }
    void q(char c) {
        System.out.print("qwertyuiop\nasdfghjkl\nzxcvbnm ".split(""+c)[1].replaceAll("\\w","$0 "));
    }
}

If spaces at start-of-line were acceptable, we could go down to 99 bytes:
void q(char c){System.out.print("qwertyuiop\nasdfghjkl\nzxcvbnm ".split(""+c)[1].replace(""," "));}

 Ruby, 59 57  67 bytes
Added spaces between letters
puts"qwertyuiop\nasdfghjkl\nzxcvbnm".split(gets.chop)[-1].chars*' '

This fails on input “m”. That can be easily fixed by changing the array index from -1 to 1, but then on input “m” will result nil. Which is not a problem itself, but will cause you problems when finishing your code to add spaces between the letters.

8086 machine code + DOS, 61 bytes
Hexdump (with ASCII view on the right):
B8 1E 01 8B F8 CD 21 B1 1F F2 AE 8B F7 AC 8A D0 ......!.........
B4 02 CD 21 80 E2 20 74 02 CD 21 E2 F0 C3 71 77 ...!.. t..!...qw
65 72 74 79 75 69 6F 70 0D 0A 61 73 64 66 67 68 ertyuiop..asdfgh
6A 6B 6C 0D 0A 7A 78 63 76 62 6E 6D 0D          jkl..zxcvbnm.

Assembly source code (can be assembled with tasm):
    .MODEL TINY

    .CODE
    org 100h

    MAIN PROC

    mov ax, offset qwerty ; sets ah=1 (coincidence)
    mov di, ax      ; di points to the string
    int 21h         ; reads a char from keyboard into al

    mov cl, 31      ; cx is the length of the string
    repne scasb     ; look for the char
    mov si, di      ; si now points beyond the found char

myloop:
    lodsb           ; load a char
    mov dl, al
    mov ah, 2
    int 21h         ; output the char

    and dl, 20h     ; if it's a letter, set it to a space
    jz print_done   ; if it's not a letter, don't print a space
    int 21h         ; if it's a letter, print a space
print_done:
    loop myloop     ; repeat until end of string

    ret

qwerty db 'qwertyuiop',13,10,'asdfghjkl',13,10,'zxcvbnm',13

    MAIN ENDP
    END MAIN

Two fun things here:

The offset of the qwerty string is 0x011e. The upper byte of it is 1, which is the DOS function number for character input. This saves 1 byte in the code.
All lower-case letters have bit 5 set. When doing an AND with 0x20, they are all turned into a space, which is then printed. If the previous char was an end-of-line byte, it gets turned into 0, and no space is output. This is used to avoid the nonsensical sequence 0d 20 0a 20 at end of line.

One almost-fun thing:
I tried to search for the input char starting at address 0 (that decreased program size by 2 bytes), instead of the usual place (start of the string). This almost worked; however, it failed for input t, because the code itself contains the byte t (as part of the encoding of a conditional jump). So for t, it would output a few junk bytes:

O 2.2, 48 46 characters
"qwertyuiop
asdfghjkl
zxcvbnm
"i/r;s{n.U=ST?}d

Sample run:
bash-4.3$ ./o keyboard.o <<< 'f'
g h j k l
z x c v b n m

O, 61 characters
"qwertyuiop\nasdfghjkl\nzxcvbnm\n"i/r;""/rl{.o"\n"={}{' o}?}d

Sample run:
bash-4.3$ java xyz.jadonfowler.o.O keyboard.o <<< 'f'
g h j k l
z x c v b n m

This doesn't work on the IDE for some reason, looking into it now...

"qwertyuiop\nasdfghjkl\nzxcvbnm\n"i/r;s{n.'\n=ST?}d only works on the new interpreter but is 51 bytes.

The permalinks are... a work in progress :P

Yup, in the libregexp directory

git clone the repo, then git submodule update --init, then make

Thank you, @phase. Even better, as the C interpreter supports embedded newlines, so no more literal \n. ☺

SQL (MS T-SQL), 172 bytes
CREATE PROC c @I CHAR(1) AS DECLARE @S CHAR(49) SET @S = 'w e r t y u i o p' + CHAR(13) + 'a s d f g h j k l' + CHAR(13) + 'z x c v b n m' PRINT RIGHT(@S,LEN(@S)-CHARINDEX(@I,@S))

Ungolfed:
CREATE PROC c                           -- Create a procedure named "c"
    @I CHAR(1)                          -- Which is invoked with a single character input (@I)
AS

DECLARE @S CHAR(49) = 'w e r t y u i o p' + CHAR(13) + 'a s d f g h j k l' + CHAR(13) + 'z x c v b n m' -- Initialise the entire output omitting "q " as @S
PRINT RIGHT(@S,LEN(@S)-CHARINDEX(@I,@S))    -- Use the charindex funtion to effectively substring @S

I'm new here, only just discovered this site.  No idea if I've posted correctly or if T-SQL is allowed but I know the procedure above works.

Hassium, 114 Bytes
func main(){k="qwertyuiop\nasdfghjkl\nzxcvbnm\n"foreach(l in k.substring(k.index(input())))print(l!="\n"?l+" ":l)}

Run online and see expanded with test case here

JavaScript, 77 bytes
alert(`w e r t y u i o p
a s d f g h j k l
z x c v b n m`.split(prompt())[1])

Fiddle

Japt -hR, 12 bytes
;Dv qU ®·®¬¸

Try it

Husk, 38 bytes
↓2↓≠←⁰¶mJ' ¶¨qw²yuiop₄sdfghjkl¶zxcvbnm

Try it online!

I wrote a smug comment thinking that I'd beaten you by 10 bytes, before realising that I hadn't read the question properly...

@DominicvanEssen No worries, happens sometimes.

Husk, 29 35 bytes
Edit +6 bytes when I realised that the letters need to be separated by spaces
¶mJ' ¶!2x¨qw²yuiop₄sdfghjkl¶zxcvbnm

Try it online!

K (ngn/k), 53 bytes
{` 0:1_*|x\"\n"/" "/'$$`qwertyuiop`asdfghjkl`zxcvbnm}

Try it online!
Uses "\n"/" "/'$$`...`...`... to (slightly) compress "q w e r t y u i o p\na s d f g h j k l\nz x c v b n m".
It then splits that string on the input character, taking the remainder that occurs after that character.

, 32 chars / 79 bytes
⟦ɘƄ瀛ذ鸊ް΀ꀆဓƘ᳀ᘁ堍怍訁码聮Ęݠⶰ䀀#]ø⬭Čï⎖1

Try it here (Firefox only).
At least I'm winning in char count... (Byte count's a different story.)
Oh yeah, just realized that I implemented index shortcuts (⎖1 instead of [1]) awhile back. Silly me!

What language is this? or is it literally this: http://i.imgur.com/WC7XvYs.png (and is there documentation) it's weird, aha!

This is ESMin. Letters are in doublestruck, so you might have trouble seeing them. See github.com/molarmanful/ESMin (docs are outdated, though).

Python, 109 bytes
I know its a bit large but its all I know how to do right now!
def kb(c):
 s = "q w e r t y u i o p \n a s d f g h j k l \n z x c v b n m"
 a = s.split(c)
 print(a[1])

I don't think you need the call to kb() at the end; defining the function is enough. Also, 1 space of indentation is enough. After making these changes, I get 108 bytes, using this site.

@ETHproductions wow I didn't know that once space thing. (New to python). Thanks again for your help!

Gema, 56 characters
?=@subst{\\A\*?=\;\?=\? ;qwertyuiop\nasdfghjkl\nzxcvbnm}

Sample run:
bash-4.3$ echo -n 'f' | gema '?=@subst{\\A\*?=\;\?=\? ;qwertyuiop\nasdfghjkl\nzxcvbnm}'
g h j k l
z x c v b n m

PHP, 83 bytes
<?=trim(explode($argv[1],"qw e r t y u i o p
a s d f g h j k l
z x c v b n m")[1]);

Takes the letter from the command line, like:
$ qwerty.php y

Bash, 80 bytes
x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*$1}|sed 's/./& /g'

Try it yourself, either replace $1 with desired character or make a #!/bin/bash script.
Here are some samples from cygwin:
$x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*q}|sed 's/./& /g'
w e r t z u i o p
a s d f g h j k l
y x c v b n m

$x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*m}|sed 's/./& /g'

$x="qwertzuiop\nasdfghjkl\nyxcvbnm"&&echo -e ${x#*h}|sed 's/./& /g'
j k l
y x c v b n m

It's not the shortest, but I'm still proud of it!

C++, 129, 112 97 bytes
#include<string>
#include<cstdio>
void o(char c){puts(strstr("qwertyuiopasdfghjklzxcvbnm",&c));}

Ungolfed:
#include<string>
#include<cstdio>
void o(char c)
{
    puts(strstr("qwertyuiopasdfghjklzxcvbnm",&c));
}

You could shave off 17 bytes by using puts instead of std::cout<<

@DJMcMayhem Thanks! An excellent point: for some reason I thought I would still need an #include for puts, but evidently I do not!

Also, this is another 12 shorter.

Thanks! I didn't even know strstr was a thing.

I think that's a little bit overgolfed. You need <stdio.h> for strstr.

@DJMcMayhem Hmm I managed to compile it just fine in VS2013 by simply #include<string, but you're right. I will update the answer. Thanks for sticking it through with me!

Aren't there missing some newlines and spaces from the output?

Batch, 206 + 2 = 208 bytes
Because this uses delayed expansion you need to invoke it with CMD /V /C keyboard.cmd <letter>, so adding 12 for the /V switch.
@echo off
set a=q w e r t y u i o p
set b=a s d f g h j k l
set c=z x c v b n m
if not "!a:*%1 =!"=="!a!" echo !a:*%1 =!
if not "!a:*%1=!!b:*%1 =!"=="!a!!b!" echo !b:*%1 =!
if not %1==m echo !c:*%1 =!

I'm afraid the command line option would count 1 if cmd would accept it as /VC, like POSIX tools do. But as I know /V requires its own /, which also gets counted.

Bash, 74 bytes
Took a different approach than @Cajova_Houba's answer, so I posted it separately. Ended up not being too much shorter because I initially forgot to deal with space-separating the output.
cut -d"$1" -f2<<<"qwertzuiop asdfghjkl yxcvbnm"|tr ' ' "\n"|sed 's/./& /g'

Takes input as a command line argument, or just replace $1 manually and run it straight from terminal.

Haskell, 79 bytes
drop 2.snd.(`span`"q w e r t y u i o p\na s d f g h j k l\nz x c v b n m").(/=)

Try it online!

C (gcc), 57 bytes
f(c){puts(strchr("qwertyuiop\nasdfghjkl\nzxcvbnm",c)+1);}

Try it online!


text:
Generate Toothpick Sequence
What is Toothpick Sequence?
According to Wikipedia

In geometry, the toothpick sequence is a sequence of 2-dimensional
patterns which can be formed by repeatedly adding line segments
("toothpicks") to the previous pattern in the sequence.
The first stage of the design is a single "toothpick", or line
segment. Each stage after the first is formed by taking the previous
design and, for every exposed toothpick end, placing another toothpick
centered at a right angle on that end.
This process results in a pattern of growth in which the number of
segments at stage n oscillates with a fractal pattern between 0.45n2
and 0.67n2. If T(n) denotes the number of segments at stage n, then
values of n for which T(n)/n2 is near its maximum occur when n is near
a power of two, while the values for which it is near its minimum
occur near numbers that are approximately 1.43 times a power of two.
The structure of stages in the toothpick sequence often resemble the
T-square fractal, or the arrangement of cells in the Ulam–Warburton
cellular automaton.
All of the bounded regions surrounded by toothpicks in the pattern,
but not themselves crossed by toothpicks, must be squares or
rectangles. It has been conjectured that every open rectangle in the
toothpick pattern (that is, a rectangle that is completely surrounded
by toothpicks, but has no toothpick crossing its interior) has side
lengths and areas that are powers of two, with one of the side lengths
being at most two.

Task
You must make a program or function that take input from STDIN, function argument, or commandline argument and make a tootpick fractal at that stage. Leading and trailing newline is prohibited except if it is unavoidable. Bounding box must be at minimum, including leading and trailing space. For inital line, we make two \ diagonal in space. The input is guaranteed to be less than two thousand. At least one line have non-space character. Trailing space is allowed.
Test Cases
1
\
 \

5
    \
    /\
   /\
  / /\
\/\/\ \ \
 \ \ \/\/\
    \/ /
     \/
    \/
     \

CJam, 99 93 bytes
This got rather long...
"\ "_W%]{{Sf+W%z}4*2ew{2fewz{_sa"\//\\"4S**4/^_,3={:.e>W%2/\}&;}%z{\)a@.e>+}:Ff*}%{F}*}q~(*N*

Test it here. If you want to test larger inputs, like the 89 on Wikipedia, Dennis's TryItOnline uses the much faster Java interpreter under the hood and can handle inputs like that in a few seconds.
I'm sure there is a lot of room for improvement, and I'll add an explanation once I'm happier with the score...
Here is the output for N = 13:
            \
            /\
           /\
          / /\
        \/\/\ \ \
         \ \/\/\/\
           /\/\/
          / /\ \
    \    /\/\ \     \
    /\  /  \/\/\    /\
   /\  /\  /\/  \ \/\
  / /\/ /\/ /\  /\ \/\
\/\/\/\/\/\/\ \/\ \/\ \ \
 \ \ \/\ \/\ \/\/\/\/\/\/\
    \/\ \/  \/ /\/ /\/ /
     \/\ \  /\/  \/  \/
    \/    \/\/\  /  \/
     \     \ \/\/    \
          \ \/ /
          /\/\/
        \/\/\/\ \
         \ \ \/\/\
            \/ /
             \/
            \/
             \

For my own reference when golfing this further, some other ideas:
"\ "_W%]{{Sf+W%z}4*2few2ew::.{+_a"\//\\"4S**4/^_,3={:.e>W%\}&;2/}:z{\)a@.e>+}ff*{\)a@..e>+}*}ri(*N*

"\ "_W%]{{Sf+W%z}4*2ew{2fewz{_sa"\//\\"4S**4/^_,3={:.e>W%2/\}&;}%{.{\)a@.e>+}}*}%{\)a@.e>+}*}q~(*N*

JavaScript (ES6), 263 bytes
n=>(o=(o=[..." ".repeat(n*2)]).map(_=>o.map(_=>s=c=" ")),(g=a=>s++<n&&g(q=[],a.map(p=>o[p[4]][p[3]]==c&&(o[y=p[1]][x=p[0]]=o[y-1][(b=+p[2])?x-1:x+1]="/\\"[b],q.push([x,++y,!b,b?x+1:x-1,y],[b?x-=2:x+=2,y-2,!b,x,y-3])))))([[n,n,1,n,n]]),o.map(r=>r.join``).join`
`)

Explanation
n=>(                           // n = desired stage

  o=                           // o = output grid
                               //     [ [ "\\", " " ], [ " ", "\\" ], etc... ]
    (o=[..." ".repeat(n*2)])   // create an array the size of the grid
    .map(_=>o.map(_=>          // loop over it and return the output grid
      s=                       // s = current stage (" " acts the same as 0)
        c=                     // c = blank character
          " "                  // initialise each element to " "
    )),

  (g=                          // g = compute stage function
    a=>                        // a = positions to place toothpicks
                               //     [ x, y, isBackslash, checkX, checkY ]
      s++<n&&                  // do nothing if we have reached the desired stage
      g(q=[],                  // q = positions for the next stage's toothpicks
        a.map(p=>              // p = current potential toothpick position
          o[p[4]][p[3]]==c&&(  // check the position to make sure it is clear

            o[y=p[1]][x=p[0]]= // place bottom toothpick, x/y = position x/y
            o[y-1][            // place top toothpick
              (b=+p[2])        // b = isBackslash
              ?x-1:x+1         // top toothpick x depends on direction
            ]="/\\"[b],        // set the location to the appropriate character

            // Add the next toothpick positions
            q.push([x,++y,!b,b?x+1:x-1,y],
              [b?x-=2:x+=2,y-2,!b,x,y-3])
          )
        )
      )
  )([[n,n,1,n,n]]),            // place the initial toothpicks
  o.map(r=>r.join``).join`
` // return the grid converted to a string
)

Test

Stages: <input type="number" oninput='result.innerHTML=(

n=>(o=(o=[..." ".repeat(n*2)]).map(_=>o.map(_=>s=c=" ")),(g=a=>s++<n&&g(q=[],a.map(p=>o[p[4]][p[3]]==c&&(o[y=p[1]][x=p[0]]=o[y-1][(b=+p[2])?x-1:x+1]="/\\"[b],q.push([x,++y,!b,b?x+1:x-1,y],[b?x-=2:x+=2,y-2,!b,x,y-3])))))([[n,n,1,n,n]]),o.map(r=>r.join``).join`
`)

)(+this.value)' />

Ruby, 151 bytes
Golfed version uses only one loop, j, with i and k calculated on the fly.
->n{m=n*2
s=(' '*m+$/)*m
l=m*m+m
s[l/2+n]=s[l/2-n-2]=?\\
(n*l-l).times{|j|(s[i=j%l]+s[i-m-2+2*k=j/l%2]).sum==124-k*45&&s[i-m-1]=s[i-1+2*k]="/\\"[k]}
s}

Ungolfed in test program
This version uses 2 nested loops.
A rarely used builtin is sum which returns a crude checksum by adding all the bytes of an ascii string.
f=->n{
  m=n*2                                       #calculate grid height / width
  s=(' '*m+$/)*m                              #fill grid with spaces, separated by newlines
  l=m*m+m                                     #calculate length of string s
  s[l/2+n]=s[l/2-n-2]=?\\                     #draw the first toothpick
  (n-1).times{|j|                             #iterate n-1 times
    l.times{|i|                               #for each character in the string
      (s[i]+s[i-m-2+2*k=j%2]).sum==124-k*45&& #if checksum of current character + character diagonally above indicates the end of a toothpick
         s[i-m-1]=s[i-1+2*k]="/\\"[k]         #draw another toothpick at the end
    }
  }
s}                                            #return value = s

puts f[gets.to_i]

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Rearrangement Inequality
Background
The Rearrangement Inequality is an inequality that is based on rearranging numbers. If I have two lists of numbers of the same length, x0, x1, x2...xn-1 and y0, y1, y2...yn-1 of the same length, where I am allowed to rearrange the numbers in the list, a way to maximize the sum x0y0+x1y1+x2y2+...+xn-1yn-1 is to sort the 2 lists in non-decreasing order.
Read the Wikipedia article here.
Task
You would write a program that takes input from STDIN or a function that accepts 2 arrays (or related containers) of numbers (which are of the same length).
Assuming you write a function which accepts 2 arrays (a and b), you are going to find the number of ways you can rearrange the numbers in the second array (b) to maximize:
a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+...+a[n-1]*b[n-1]

In this case, if the array b is [10, 21, 22, 33, 34] (indices for clarity),
[10, 21, 22, 33, 34],
[10, 21, 22, 34, 33], (swap the two 3's)
[10, 22, 21, 33, 34] (swap the two 2's)
[10, 22, 21, 34, 33] (swap the two 3's and swap the two 2's)
are considered different arrangements. The original array, itself, also counts as a possible rearrangement if it also maximizes the sum.
For STDIN input, you may assume that the length of the arrays is provided before the arrays (please state so that you use it), or that the arrays are provided on different lines (also please state).
Here are the 4 possible inputs (for convenience):
5 1 1 2 2 2 1 2 2 3 3 (length before arrays)

1 1 2 2 2 1 2 2 3 3 (the 2 arrays, concatenated)

1 1 2 2 2
1 2 2 3 3 (the 2 arrays on different lines)

5
1 1 2 2 2
1 2 2 3 3 (length before arrays and the 2 arrays on different lines)

For output, you are allowed to return the answer (if you write a function) or print the answer to STDOUT. You may choose to output the answer mod 109+7 (from 0 to 109+6) if it is more convenient.
Test Cases (and explanation):
[1 1 2 2 2] [1 2 2 3 3] => 24

The first 2 entries have to be 1 and 2. The last 3 entries are 2, 3 and 3. There are 2 ways to arrange the 2's between the first 2 entries and the last 2 entries. Among the first 2 entries, there are 2 ways to rearrange them. Among the last 2 entries, there are 6 ways to rearrange them.
[1 2 3 4 5] [6 7 8 9 10] => 1

There is only 1 way, which is the arrangement given in the arrays.
[1 1 ... 1 1] [1 1 ... 1 1] (10000 numbers) => 10000! or 531950728

Every possible permutation of the second array is valid.
Dennis' Testcase: Pastebin => 583159312 (mod 1000000007)
Scoring:
This is code-golf, so shortest answer wins.
In case of tie, ties will be broken by time of submission, favouring the earlier submission.
Take note:
The containers may be unsorted.
The integers in the containers may be zero or negative.
The program has to run fast enough (at most an hour) for modestly sized arrays (around 10000 in length).
Inspired by this question on Mathematics Stack Exchange.

Please provide a test case with 10000 elements per array, so we can verify our code works correctly and is fast enough.

In the example you give for swaping the second array [1_0, 2_2, 2_1, 3_4, 3_3] (swap the two 2's and swap the two 3's) is missing

do you accept inputs like [. . .] plz respond

If we submit a function, do we have to take two separate arguments or could we take an array of arrays?

Well, array of arrays seems fine, and does not affect the challenge too much. I'll work on the test case.

CJam, 30 26 bytes
q~](/:$_za+{e`0f=:m!:*}//*

Try it online in the CJam interpreter.
It completes this test case in less than a second:
$ time cjam <(echo 'q~](/:$_za+{e`0f=:m!:*}%)\:*\/N') < test-large.in | md5sum
5801bbf8ed0f4e43284f7ec2206fd3ff  -

real    0m0.308s
user    0m0.667s
sys     0m0.044s

Running it in the online interpreter should take less than 10 seconds.
Algorithm
The result does not depend on the order of A, so we can assume it to be sorted. This means that B must also be sorted to attain the maximal dot product.
Now, if r1, … rn are the length of the runs of the sorted A, there are ∏rk! different rearrangements of the elements of A that still result in ascending order.
Likewise, if s1, … sn are the length of the runs of the sorted B, there are ∏sk! different rearrangements of the elements of B that still result in ascending order.
However, this counts all pairings multiple times. If we take the pairs of of the corresponding elements of sorted A and sorted B and define t1, … tn as the length of the runs of the resulting array, ∏tk! is the aforementioned multiplier.
Thus, the desired result is (∏rk!) × (∏sk!) ÷ (∏tk!).
Code
 q~                          Read and evaluate all input.
   ]                         Wrap the resulting integers in an array.
    (                        Shift out the first (length).
     /                       Split the remainder into chunks of that length.
      :$                     Sort each chunk.
        _z                   Push a copy and transpose rows with columns.
                             This pushes the array of corresponding pairs.
          a+                 Wrap in array and concatenate (append).
            {          }/    For A, B, and zip(A,B):
             e`                Perform run-length encoding.
               0f=             Select the runs.
                  :m!          Apply factorial to each.
                     :*        Reduce by multiplication.
                         /   Divide the second result by the third.
                          *  Multiply the quotient with the first result.

Pyth, 29 28 bytes
M/*FPJm*F.!MhMrd8aFCB,SGSHeJ

Try it online in the Pyth Compiler.
Algorithm
The result does not depend on the order of A, so we can assume it to be sorted. This means that B must also be sorted to attain the maximal dot product.
Now, if r1, … rn are the length of the runs of the sorted A, there are ∏rk! different rearrangements of the elements of A that still result in ascending order.
Likewise, if s1, … sn are the length of the runs of the sorted B, there are ∏sk! different rearrangements of the elements of B that still result in ascending order.
However, this counts all pairings multiple times. If we take the pairs of of the corresponding elements of sorted A and sorted B and define t1, … tn as the length of the runs of the resulting array, ∏tk! is the aforementioned multiplier.
Thus, the desired result is (∏rk!) × (∏sk!) ÷ (∏tk!).
Code
M/*FPJm*F.!MhMrd8aFCB,SGSHeJ

M                             Define g(G,H):
                      SGSH      Sort G and H.
                     ,          For the pair of the results.
                   CB           Bifurcated zip (C).
                                This returns [[SG, SH], zip([SG, SH])].
                 aF             Reduce by appending.
                                This returns [SG, SH, zip([SG, SH])].
      m                         Map; for each d in the resulting array:
              rd8                 Perform run-length encoding on d.
            hM                    Mapped "head". This returns the lengths.
         .!M                      Mapped factorial.
       *F                         Reduce by multiplication.
     J                          Save the result in J.
    P                           Discard the last element.
  *F                            Reduce by multiplication.
 /
                          eJ    Divide the product by the last element of J.
                                Return the result of the division.

Verification
I've pseudo-randomly generated 100 test cases of length 6, which I've solved with the above code and this brute-force approach:
Ml.Ms*VGZ.pH

M             Define g(G,H) (or n(G,H) on second use):
         .pH    Compute all permutations of H.
  .M            Filter .pH on the maximal value of the following;
                 for each Z in .pH:
     *VGZ         Compute the vectorized product of G and Z.
    s             Add the products.
                  This computes the dot product of G and Z.
 l              Return the length of the resulting array.

These were the results:
$ cat test.in
6,9,4,6,8,4,5,6,5,0,8,2
0,7,7,6,1,6,1,7,3,3,8,0
3,6,0,0,6,3,8,2,8,3,1,1
2,3,0,4,0,6,3,4,5,8,2,4
9,1,1,2,2,8,8,1,7,4,9,8
8,3,1,1,9,0,2,8,3,4,9,5
2,0,0,7,7,8,9,2,0,6,7,7
0,7,4,2,2,8,6,5,0,5,4,9
2,7,7,5,5,6,8,8,0,5,6,3
1,7,2,7,7,9,9,2,9,2,9,8
7,2,8,9,9,0,7,4,6,2,5,3
0,1,9,2,9,2,9,5,7,4,5,6
8,4,2,8,8,8,9,2,5,4,6,7
5,2,8,1,9,7,4,4,3,3,0,0
9,3,6,2,5,5,2,4,6,8,9,3
4,2,0,6,2,3,5,3,6,3,1,4
4,8,5,2,5,0,5,1,2,5,9,5
6,8,4,4,9,5,9,5,4,2,8,7
8,9,8,1,2,2,9,0,5,6,4,9
4,7,6,8,0,3,7,7,3,9,8,6
7,5,5,6,3,9,3,8,8,4,8,0
3,8,1,8,5,6,6,7,2,8,5,3
0,9,8,0,8,3,0,3,5,9,5,6
4,2,7,7,5,8,4,2,6,4,9,4
3,5,0,8,2,5,8,7,3,4,5,5
7,7,7,0,8,0,9,8,1,4,8,6
3,9,7,7,4,9,2,5,9,7,9,4
4,5,5,5,0,7,3,4,0,1,8,2
7,4,4,2,5,1,7,4,7,1,9,1
0,6,2,5,4,5,1,8,0,8,9,9
3,8,5,3,2,1,1,2,2,2,8,4
6,1,9,1,8,7,5,6,9,2,8,8
6,2,6,6,6,0,2,7,8,6,8,2
0,7,1,4,5,5,3,4,4,0,0,2
6,0,1,5,5,4,8,5,5,2,1,6
2,6,3,0,7,4,3,6,0,5,4,9
1,4,8,0,5,1,3,2,9,2,6,5
2,7,9,9,5,0,1,5,6,8,4,6
4,0,1,3,4,3,6,9,1,2,7,1
6,5,4,7,8,8,6,2,3,4,1,2
0,3,6,3,4,0,1,4,5,5,5,7
5,4,7,0,1,3,3,0,2,1,0,8
8,6,6,1,6,6,2,2,8,3,2,2
7,1,3,9,7,4,6,6,3,1,5,8
4,8,3,3,9,1,3,4,1,3,0,6
1,4,0,7,4,9,8,4,2,1,0,3
0,4,1,6,4,4,4,7,5,1,4,2
0,0,4,4,9,6,7,2,7,7,5,4
9,0,5,5,0,8,8,9,5,9,5,5
5,7,0,4,2,7,6,1,1,1,9,1
3,1,7,5,0,3,1,4,0,9,0,3
4,4,5,7,9,5,0,3,7,4,7,5
7,9,7,3,0,8,4,0,0,3,1,0
2,4,4,3,1,2,5,2,9,0,8,5
4,8,7,3,0,0,9,3,7,3,0,6
8,9,1,0,7,7,6,0,3,1,8,9
8,3,1,7,3,3,6,1,1,7,6,5
6,5,6,3,3,0,0,5,5,0,6,7
2,4,3,9,7,6,7,6,5,6,2,0
4,8,5,1,8,4,4,3,4,5,2,5
7,5,0,4,6,9,5,0,5,7,5,5
4,8,9,5,5,2,3,1,9,7,7,4
1,5,3,0,3,7,3,8,5,5,3,3
7,7,2,6,1,6,6,1,3,5,4,9
9,7,6,0,1,4,0,4,4,1,4,0
3,5,1,4,4,0,7,1,8,9,9,1
1,9,8,7,4,9,5,2,2,1,2,9
8,1,2,2,7,7,6,8,2,3,9,7
3,5,2,1,3,5,2,2,4,7,0,7
9,6,8,8,3,5,2,9,8,7,4,7
8,8,4,5,5,1,5,6,5,1,3,3
2,6,3,5,0,5,0,3,4,4,0,5
2,2,7,6,3,7,1,4,0,3,8,3
4,8,4,2,6,8,5,6,2,5,0,1
7,2,4,3,8,4,4,6,5,3,9,4
4,6,1,0,6,0,2,6,7,4,9,5
6,3,3,4,6,1,0,8,6,1,7,5
8,3,4,2,8,3,0,1,8,9,1,5
9,6,1,9,1,1,8,8,8,9,1,4
3,6,1,6,1,4,5,1,0,1,9,1
6,4,3,9,3,0,5,0,5,3,2,4
5,2,4,6,1,2,6,0,1,8,4,0
3,5,7,6,3,6,4,5,2,8,1,5
6,3,6,8,4,2,7,1,5,3,0,6
9,1,5,9,9,1,1,4,5,7,3,0
1,6,7,3,5,8,6,5,5,2,6,0
2,8,8,6,5,5,2,3,8,1,9,8
0,4,5,3,7,6,2,5,4,3,2,5
5,1,2,3,0,3,4,9,4,9,4,9
5,8,2,2,0,2,4,1,1,7,0,3
0,6,0,0,3,6,3,6,2,2,2,9
2,4,8,1,9,4,0,8,8,0,4,7
3,9,1,0,5,6,8,8,2,5,2,6
5,3,8,9,1,6,5,9,7,7,6,1
8,6,9,6,1,1,6,7,7,3,2,2
7,2,1,9,8,8,5,3,6,3,3,6
9,9,4,8,7,9,8,6,6,0,3,1
8,3,0,9,1,7,4,8,0,1,6,2
8,2,6,2,4,0,2,8,9,6,3,7
1,0,8,5,3,2,3,7,1,7,8,2
$ while read; do
> pyth -c 'M/*FPJm*F.!MhMrd8aFCB,SGSHeJMl.Ms*VGZ.pHAc2Q,gGHnGH' <<< "$REPLY"
> done < test.in
[4, 4]
[4, 4]
[8, 8]
[4, 4]
[8, 8]
[2, 2]
[4, 4]
[4, 4]
[4, 4]
[36, 36]
[2, 2]
[8, 8]
[24, 24]
[8, 8]
[2, 2]
[2, 2]
[6, 6]
[2, 2]
[8, 8]
[2, 2]
[12, 12]
[2, 2]
[8, 8]
[12, 12]
[4, 4]
[12, 12]
[4, 4]
[6, 6]
[8, 8]
[8, 8]
[6, 6]
[4, 4]
[48, 48]
[8, 8]
[4, 4]
[1, 1]
[4, 4]
[4, 4]
[8, 8]
[4, 4]
[12, 12]
[2, 2]
[96, 96]
[2, 2]
[4, 4]
[2, 2]
[6, 6]
[24, 24]
[24, 24]
[48, 48]
[4, 4]
[8, 8]
[12, 12]
[8, 8]
[4, 4]
[2, 2]
[24, 24]
[16, 16]
[2, 2]
[8, 8]
[24, 24]
[4, 4]
[24, 24]
[4, 4]
[12, 12]
[8, 8]
[12, 12]
[4, 4]
[8, 8]
[4, 4]
[16, 16]
[4, 4]
[8, 8]
[8, 8]
[4, 4]
[4, 4]
[4, 4]
[4, 4]
[72, 72]
[24, 24]
[4, 4]
[4, 4]
[4, 4]
[2, 2]
[12, 12]
[4, 4]
[8, 8]
[4, 4]
[36, 36]
[6, 6]
[12, 12]
[8, 8]
[4, 4]
[2, 2]
[8, 8]
[24, 24]
[6, 6]
[1, 1]
[2, 2]
[2, 2]

To verify my submission satisfies the speed requirement, I've ran it with this test case.
$ time pyth -c 'M/*FPJm*F.!MhMrd8aFCB,SGSHeJAc2QgGH' < test-large.in | md5sum
5801bbf8ed0f4e43284f7ec2206fd3ff  -

real    0m0.233s
user    0m0.215s
sys     0m0.019s

Matlab, 230 bytes

Edit: Many things fixed to match dennis' test cases, and nnz is replaced by numel due to nil values.

f=1;t=-1;q=1;a=sort(input(''));b=sort(input(''));for i=unique(a)c=b(find(a==i));r=numel(c(c==t));f=f*factorial(numel(c))*sum(arrayfun(@(u)nchoosek(max(q,r),u),0:min(q,r)));z=c(end);y=numel(c(c==z));q=(t==z)*(q+r)+(t~=z)*y;t=z;end,f

Execution
[2 2 1 2 1]
[3 2 3 2 1]

f =

    24

Dennis' Testcase:
   A = importdata('f:\a.csv'); for i=1:100,a=sort(A(i,1:6));b=sort(A(i,7:12));
   f=1;t=-1;q=1;for i=unique(a)c=b(find(a==i));r=numel(c(c==t));f=f*factorial(numel(c))*sum(arrayfun(@(u)nchoosek(max(q,r),u),0:min(q,r)));z=c(end);y=numel(c(c==z));q=(t==z)*(q+r)+(t~=z)*y;t=z;end;
   disp(f);end

Outputs:
 4

 4

 8

 4

 8

 2

 4

 4

 4

36

 2

 8

24

 8

 2

 2

 6

 2

 8

 2

12

 2

 8

12

 4

12

 4

 6

 8

 8

 6

 4

48

 8

 4

 1

 4

 4

 8

 4

12

 2

96

 2

 4

 2

 6

24

24

48

 4

 8

12

 8

 4

 2

24

16

 2

 8

24

 4

24

 4

12

 8

12

 4

 8

 4

16

 4

 8

 8

 4

 4

 4

 4

72

24

 4

 4

 4

 2

12

 4

 8

 4

36

 6

12

 8

 4

 2

 8

24

 6

 1

 2

 2

Well, it solves the problem, so input shouldn't matter too much.

C++, 503 bytes
(just for fun, a non-golfing language)
#import<iostream>
#import<algorithm>
#define U 12345
#define l long long
using namespace std;int N,X=1,Y=1,Z=1,x[U],y[U],i=1;l p=1,M=1000000007,f[U];l e(l x,int y){return y?y%2?(x*e(x,y-1))%M:e((x*x)%M,y/2):1;}main(){for(f[0]=1;i<U;i++)f[i]=(f[i-1]*i)%M;cin>>N;for(i=0;i<N;i++)cin>>x[i];for(i=0;i<N;i++)cin>>y[i];sort(x,x+N);sort(y,y+N);for(i=1;i<N;i++)x[i]^x[i-1]?p=p*f[X]%M,X=1:X++,y[i]^y[i-1]?p=p*f[Y]%M,Y=1:Y++,x[i]^x[i-1]|y[i]^y[i-1]?p=p*e(f[Z],M-2)%M,Z=1:Z++;cout<<p*f[X]%M*f[Y]%M*e(f[Z],M-2)%M;}

Ungolfed version:
#include <cstdio>
#include <algorithm>
#define MOD 1000000007
using namespace std;
int N; // number of integers
int x[1000010]; // the 2 arrays of integers
int y[1000010];
long long product = 1;
long long factorial[1000010]; // storing factorials mod 1000000007
long long factorialInv[1000010]; // storing the inverse mod 1000000007
long long pow(long long x, int y) {
    if (y == 0) return 1;
    if (y == 1) return x;
    if (y%2 == 1) return (x*pow(x, y-1))%MOD;
    return pow((x*x)%MOD, y/2);
}
int main(void) {
    //freopen("in.txt", "r", stdin); // used for faster testing
    //precomputation
    factorial[0] = factorial[1] = 1;
    for (int i=2;i<=1000000;i++) {
        factorial[i] = (factorial[i-1]*i)%MOD;
        factorialInv[i] = pow(factorial[i], MOD-2);
    }
    // input
    scanf("%d", &N);
    for (int i=0;i<N;i++) {
        scanf("%d", &x[i]);
    }
    for (int i=0;i<N;i++) {
        scanf("%d", &y[i]);
    }
    // sort the 2 arrays
    sort(x, x+N);
    sort(y, y+N);
    int sameX = 1;
    int sameY = 1;
    int sameXY = 1;
    for (int i=1;i<N;i++) {
        if (x[i]==x[i-1]) {
            sameX++;
        } else {
            product *= factorial[sameX];
            product %= MOD;
            sameX = 1;
        }
        if (y[i]==y[i-1]) {
            sameY++;
        } else {
            product *= factorial[sameY];
            product %= MOD;
            sameY = 1;
        }
        if (x[i]==x[i-1] && y[i]==y[i-1]) {
            sameXY++;
        } else {
            product *= factorialInv[sameXY];
            product %= MOD;
            sameXY = 1;
        }
    }
    product *= factorial[sameX];
    product %= MOD;
    product *= factorial[sameY];
    product %= MOD;
    product *= factorialInv[sameXY];
    product %= MOD;
    printf("%lld\n", product);
    return 0;
}

Jelly, 14 bytes
Ṣ€ZṭµŒɠ!P)×:ƭ/

Try it online!
Implements Dennis' method. Ignoring time requirements leads to an 8 byte solution:
Œ!ḋÐṀ¥@L

Try it online!
which can be 6 bytes if we take input in reverse order:
Œ!ḋÐṀL

Try it online!
How they work
Ṣ€ZṭµŒɠ!P)×:ƭ/ - Main link. Takes a pair of lists [A, B]
Ṣ€             - Sort each
  Z            - Transpose to get all pairs
   ṭ           - Append that to [A, B], yielding [A, B, zip(A, B)]
    µ          - Call that triple T and start a new link with T as the argument
         )     - Over each element in T:
     Œɠ        -   Lengths of runs
       !       -   Factorial of each
        P      -   Product
             / - Reduce the triple:
            ƭ  -   Tie 2 dyads and cycle them:
          ×    -     Multiplication
           :   -     Integer division
                 For the triple [r, s, t], this yields (r×s):t

The 8 byte solution works in the following way:
Œ!ḋÐṀ¥@L - Main link. Takes A on the left and B on the right
     ¥   - Group the previous 2 links into a dyad f(B, A):
Œ!       -   All permutations of B
   ÐṀ    -   Keep those which yield a maximal value under:
  ḋ      -     Dot product with A
      @  - Run f(B, A)
       L - Length

The ¥@ is simply to compensate for inputs being in the wrong order. Of course, the 8 and 6 byte versions have complexity proportional to \$\text{length}(B)!\$, which grows very fast.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Trump needs your help to stop the Starman!
A man from the stars has come to Earth! Luckily the president of the United States, Donald Trump, has an infinity-sided die. Using this die, he can conjure up a number which you, the mayor of Podunk, must use to determine who should be sent to stop the invader! But be careful, you can only send a limited amount of bytes on the back of your frog!
Given a user input (which will be a positive integer), you must return a string depending on what category the number is in.

If the number is a Fibonacci number, you must output Ness.
If the number is a Lucas number, you must output Lucas.
If the number is both a Lucas number and a Fibonacci number, you must output Travis.
If the number is neither a a Lucas number nor a Fibonacci number, you must output Pippi.

Examples
Here are a bunch of test cases:

1 => Travis
2 => Travis
3 => Travis
4 => Lucas
5 => Ness
6 => Pippi
7 => Lucas
8 => Ness
610 => Ness
722 => Pippi
843 => Lucas

Rules

This is code-golf, the shortest answer in bytes wins.
You program may be a full program or a(n anonymous) function.

Bonuses
There are a couple bonuses that you can use to help your frog get the data to President Trump faster:

For -15 bytes: If the input number is 2016, you must output Trump, as he is at the peak of his presidency.

For the record, I am not one of those Starmen.

Giygas isn't happy about this (ctrl+f "Giygas")

@DavidCarraher Just like how some definitions start the Fibonacci series off with 0, 1 while others start with 1, 1, I believe this depends on the definition you use. It's not uncommon to see the Lucas numbers start with 2, 1, e.g. OEIS has both versions (1, 2), but the one starting with 2 is the definition phase has gone with.

phase: is there an upper limit to the input?

Sp3000, I was unaware that there was more than one Lucas sequence.  I was using the second version, that has no 2 in it!

@ThomasKwa Expect an unsigned integer (or whatever the normal Number is for your language)

@DavidCarraher, Sp3000: there's only one Fibonacci sequence and one Lucas sequence, but they're both doubly infinite.

Votes are supposed to be hidden, but I'll still say I really don't like politics and that it has affected my voting on this question. Would the asker mind removing politics from the question or at least explain me any pun I may have missed? A political reference is baked into the spec for good, but it can still be removed from the title.

What's the largest number that needs to be handled before overflow?

@Vɪʜᴀɴ Just whatever the normal integer is for your language.

@JanDvorak: I think it's very tongue-in-cheek. For example, consider that presidential terms are 4 years, and that the next election is in November 2016. If Trump is at the peak of his presidency in 2016...

We need a Trumpscript answer to this challenge

Well, it appears this challenge predicted the next president, though they got the term wrong.

Pyth, 59 - 15 = 44 bytes
or 42 bytes after a bug was fixed
&Qr@c."av�a�(s��kW�С��"\b?q2016Q4/hMst*2.uL,eNsNQ_BS2Q4

Hexdump:
0000000: 2651 7240 632e 2261 7601 c061 15dc 2873  &Qr@c."av..a..(s
0000010: fde0 6b57 8bd0 a1ed ed0f 225c 623f 7132  ..kW......"\b?q2
0000020: 3031 3651 342f 684d 7374 2a32 2e75 4c2c  016Q4/hMst*2.uL,
0000030: 654e 734e 515f 4253 3251 34              eNsNQ_BS2Q4

The first two characters (&Q) are necessary because of a Pyth parsing bug that makes Q after ." fail. Fix has been applied. If the post-bugfix interpreter is allowed,  -2 bytes.

Without unreadable string compression:
Pyth, 63 - 15 = 48 bytes
49 bytes without Trump
@c"Pippi Ness Lucas Travis Trump")?nQ2016/hMst*2.uL,eNsNQ_BS2Q4

Test Suite
Pretty straightforward, just generate the sequences, duplicate one and check for membership.
Sequences are generated by starting with [1, 2] and [2, 1], and then applying the fibonacci rule.

Julia, 146 142 121 120 bytes
n->split("Pippi Lucas Ness Travis")[2any(isinteger,sqrt([5n^2+4,5n^2-4]))+(n∈[2;[(g=golden)^i+(-g)^-i for i=1:n]])+1]

This creates an unnamed function that returns a boolean. To call it, give it a name, e.g. f=n->....
Ungolfed:
function trump(n::Integer)
    # Determine if n is a Fibonacci number by checking whether
    # 5n^2 ± 4 is a perfect square
    F = any(isinteger, sqrt([5n^2 + 4, 5n^2 - 4]))

    # Determine if n is a Lucas number by generating Lucas
    # numbers and testing for membership
    # golden is a built-in constant containing the golden ratio
    L = n ∈ [2; [golden^i + (-golden)^-i for i = 1:n]]

    # Select the appropriate Earthbound charater using array
    # indexing on a string split into an array on spaces
    return split("Pippi Lucas Ness Travis")[2F+L+1]
end

Fixed an issue and saved 7 bytes thanks to Glen O!

Mathematica 143  156 - 15 (bonus) = 141 bytes
With 2 bytes saved thanks to LegionMammal978.
t_~g~l_:=(r=1<0;n=1;While[(z=l@n)<=t,If[z==t,r=1>0];n++];r);a=g[k=Input[],LucasL];
b=k~g~Fibonacci;Which[k==2016,Trump,a&&b,Travis,a,Lucas,b,Ness,2<3,Pippi]

False and True can be replaced with 1<0 and 1>0 respecively.

Mathematica, 92 87 bytes
Inspired by Sp3000's answer.
Travis[Ness,Lucas,Pippi][[{2,1}.Product[Abs@Sign[{Fibonacci@n,LucasL@n}-#],{n,0,2#}]]]&

Python 2, 107
f=lambda i,n=input():abs(5*n*n+i)**.5%1>0
print["Travis","Lucas","Ness","Pippi"][f(4)*f(-4)+2*f(20)*f(-20)]

The key is two purely arithmetical checks for Fibonacci and Lucas numbers:

n is a Fibonacci number exactly if 5*n*n+4 or  5*n*n-4 is a perfect square
n is a Lucas number exactly if 5*n*n+20 or  5*n*n-20 is a perfect square

This site has proof sketches.
So, the output depends on the values of 5*n*n+i for i in {4,-4,20,-20}. The function f tests a value of i, by checking if the corresponding value does not have a whole-number square root The abs is there just to avoid an error of taking the root of a negative for n=1, i=-20.
The function f takes the value of the number n to test from STDIN. Python only evaluates this once, not once per function call.
Whether the number is not Fibonacci is evaluated as f(4)*f(-4) using the implicit boolean to number conversion and similarly for not Lucas, and the corresponding string is taken. If trailing spaces were allowed, string interleaving would be shorter.

The proof sketches are a dead link.

@SQB The page seems to have gone down, I can't find it again.

Python 2, 117 bytes
F=[1]
L=[2,1]
n=input()
exec 2*n*"F,L=L+[sum(L[-2:])],F;"
print["Pippi","Lucas","Ness","Travis"][(n in F)*2+(n in L)]

For the string list, "Pippi Lucas Ness Travis".split() is the same length.

CJam, 58 55 54 bytes
ri5Zbe!f{1${_-2>:++}*&!}2b"Travis Ness Lucas Pippi"S/=

Naïve approach of generating the Fibonacci and Lucas numbers then counting occurences in both, converting to binary, and picking the appropriate string.
Try it online.

Perl, 133 (146-15=)131 (144-15=)129 (136-15=)121 bytes
+1 byte for the -n flag.
$a=$d=1;$b=$c=2;$f+=$_==$a,$l+=$_==$c,($a,$b,$c,$d)=($b,$a+$b,$d,$c+$d)while$a<$_*9;say$_-2016?(Pippi,Ness,Lucas,Travis)[$f+$l*2]:Trump

With newlines after semicolons, for readability:
$a=$d=1;$b=$c=2;
$f+=$_==$a,$l+=$_==$c,($a,$b,$c,$d)=($b,$a+$b,$d,$c+$d)while$a<$_*9;
say$_-2016?(Pippi,Ness,Lucas,Travis)[$f+$l*2]:Trump

Demo:
llama@llama:...code/perl/ppcg64476trump$ for x in 1 2 3 4 5 6 7 8 610 722 843 2016; do echo -n "$x => "; echo $x | perl -n trump.pl; done
1 => Travis
2 => Travis
3 => Travis
4 => Lucas
5 => Ness
6 => Pippi
7 => Lucas
8 => Ness
610 => Ness
722 => Pippi
843 => Lucas
2016 => Trump

Tricks:

You might be wondering why my variables are named $a, $b, $%, and $d. That is an excellent question! In fact, it allows me to save a byte.
(stuff) ... ,$l+=$_==$%while$a<$_

is one byte shorter than
(stuff) ... ,$l+=$_==$c while $a<$_

 This no longer applies because I golfed my code by rearranging things, causing the variable name change to no longer save bytes. I changed it back so that variable names make sense again.
$_-2?$f+$l*2:3 is mildly interesting. Basically, I had to special-case 2 for Lucas numbers because my program checks whether a number is a Lucas number after "updating" the Fibonacci and Lucas numbers. So 2 was considered a not-Lucas number. $_-2?foo:bar is a char shorter than $_==2?bar:foo. Same thing is used for the 2016 test.
This is also no longer true because I was able to restructure the program to not require special-casing 2. But I still use $_-2016?stuff:Trump instead of $_==2016?Trump:stuff, which is one byte longer.
Speaking of which, you may be wondering how I did this restructuring. I just made the program do 9 times more iterations than necessary, which only costs 2 bytes (*9) but allows me to make assumptions elsewhere that help golf stuff down.
Because variables default to zero,
$f+=$_==$a

is shorter than
$f=1if$_==$a

Perl supports barewords, so I don't have to quote any of my strings (\o/).

Isn't it two bytes shorter?

@CᴏɴᴏʀO'Bʀɪᴇɴ The program itself is 132 bytes, and I added one because it needs to be called with the -n flag (as noted in the answer).

Oh, I see. What does the -n flag do?

@CᴏɴᴏʀO'Bʀɪᴇɴ It assumes a while(<>) { ... } loop around your program. See: Perl docs.

Hey, I really thought you weren't a fan of Perl! You can save 2 bytes using bare words in a list instead of the qw{...} method: (Pippi,Ness,Lucas,Travis). And I think you can save a few in your initialisation with $a=$c=1;$b=$d=2;.

@DomHastings Heh, I just decided to start learning Perl a few days ago. :) Thanks for the tips!

@DomHastings He wasn't, but I converted convinced him to try perl.

Seriously, 69 bytes
,;;r`;F@2+F+`M2@q@#"%d="%£MΣ@f0≤2*+["Pippi","Lucas","Ness","Travis"]E

Before this challenge, Seriously had the builtin f (index in Fibonacci numbers, -1 if not a Fibonacci number)... but not index in a list or "is in list"! (It's since been added as í.)
As a result, this is what I spend finding if the input is a Fibonacci number:
,                              f0≤

This is what I spend generating a list of Lucas numbers:
  ;r`;F@2+F+`M2@q

And this is what I spend finding if the input is in the list of Lucas numbers:
 ;                @#":%d:="%£MΣ

That's a string being formatted using Python's % notation into something like :610:=, and converted to a function, which is then mapped over the array and summed. (The Lucas numbers are unique, so the sum is always 0 or 1.)
Thanks to @Mego for that last bit with the string formatting.

Julia, 101 100 bytes
n->split("Pippi Lucas Ness Travis")[[2;1]⋅(sum(i->[i[];trace(i)].==n,Any[[1 1;1 0]].^(0:n)).>0)+1]

Ungolfed:
function f(n)
  k=Any[[1 1;1 0]].^(0:n) # Produces characteristic matrices of Fibonacci
                          # numbers from 0 to n
  F=sum(i->i[]==n,k)      # Check if n is a Fibonacci number by checking
                          # the first value in each matrix for n
  L=sum(i->trace(i)==n,k) # Check if n is a Lucas number by checking
                          # the trace of each matrix for n
  I=[2;1]⋅[F;L]+1         # Calculate 2F+L+1, which is the index for the next step
  S=split("Pippi Lucas Ness Travis") # Creates array with four strings
                          # saves a byte compared with directly creating array
  return S[I]
      # This uses the above calculations to determine which of the four to return
end

Awesome solution! The matrix and trace approach is genius. It's too bad the {} alternative syntax for Any[] is deprecated; that would save a couple bytes.

Octave, 93 bytes
@(n){'Pippi','Lucas','Ness','Travis'}{(1:2)*any(~rem(real(sqrt(5*n^2+[-20,-4;20,4])),1)).'+1}

This approach is similar to my MATLAB answer with the exception that Octave allows you to index directly into a fresh array:
{'a', 'b', 'c'}{2}    %// b

MATL, 57 55 54 (67-15) = 52 bytes
20Kht_vi2^5*+X^Xj1\~a2:*sG2016=-'Lucas Ness Travis Trump Pippi'Ybw)

Try it Online!
Explanation
Again, similar logic to my other answers here and here.
20      % Number literal
K       % Retrieve the number 4 from the K clipboard (the default value)
h       % Horizontal concatenation to produce [20 4]
t       % Duplicate elements
_v      % Negate and vertically append elements (yields [20, 4; -20 -4])
i2^     % Explicitly grab the input and square it
5*      % Multiply by 5
+       % Add this to the matrix ([20, 4; -20 -4])
X^      % Take the square root
Xj      % Ensure that the result is a real number
1\      % Get the decimal component
~       % Create a logical arrays where we have TRUE when no remainder
a       % For each column determine if any element is TRUE
2:      % Create the array 1:2
*       % Perform element-wise multiplication with boolean
s       % Sum the result to yield an index
G       % Explicitly grab the input (again)
2016=   % Check to see if it is 2016 (yields TRUE (1) if equal)
-       % Then subtract the boolean from the index. Since 2016 is NOT a
        % Fibonacci or Lucas number, the original index is 0. Subtracting
        % this boolean, will make this index now -1. For all other non-2016
        % numbers this will have no effect on the index.
'Lucas Ness Travis Trump Pippi' % Create the possible strings values
        % Note: the 0 index wraps around to the end hence Pippi being at the end.
        % The next to last entry ('Trump') is ONLY accessible via a -1 index as
        % discussed above
Yb      % Split at the spaces to create a cell array
w       % Flip the top two stack elements
)       % Retrieve the desired value from the cell array

C++11, 176 + 15 (#include) = 191
#include<mutex>
[](int n){std::function<int(int,int)>c=[&](int f,int s){return f-s>n?0:s-n?c(s,f+s):1;};int l=c(2,1),f=c(1,1);l&f?puts("Travis"):l?puts("Lucas"):f?puts("Ness"):puts("Pippi");}

Ungolfed with usage. I can add explanation if requested tomorrow, gtg to bed now!
#include <functional>
#include <cstdio>
int main()
{
    auto r = [](int n)
    {
        std::function<int(int, int)> c = [&](int f, int s)
        {
            return f - s > n ? 0 : f - n ? c(s, f + s) : 1;
        };
        int l = c(2, 1), f = c(1, 1);
        l & f ? puts("Travis") : l ? puts("Lucas") : f ? puts("Ness") : puts("Pippi");
    };

    for (int i : { 1, 2, 3, 4, 5, 6, 7, 8, 610, 722, 843 })
    {
        printf("%i - ", i); r(i);
    }
}

@sysreq I don't think that's for the bonus, just the include statement.

@phase I know, I am dividing byte size into two parts (code+include), when I do post just function and not whole program.

Javascript (ES6), 108 bytes
x=>(f=(a,x,y)=>a==y||a==x?1:a<y?0:f(a,y,x+y),b=f(x,0,1),c=f(x,2,1),b&&c?'Travis':b?'Ness':c?'Lucas':'Pippi')

Same function for Fibonnacci and Lucas. It's a recursive function that takes the first two values as init.

Java, 151 bytes
You could argue that Trump would never outsource this crucial decision, so we wouldn't have to make the method public, saving another 7 bytes.
public String t(int n){return"Pippi,Lucas,Ness,Travis".split(",")[2*f(n,1,1)+f(n,2,1)];}int f(int a,int x,int y){return a==x||a==y?1:a<y?0:f(a,y,x+y);}

Ungolfed including test-main invocation
public class Trump {

    //Test Invokation
    public static void main(String[] args) {
        int[] n = {1, 2, 3, 4, 5, 6, 7, 8, 610, 722, 843, 2016 };
        for(int i = 0; i < n.length; ++i) {
            System.out.println(""+ n[i] + " => " + new Trump().t(n[i]));
        }
    }

    public String t(int n) {
        return "Pippi,Lucas,Ness,Travis".split(",")[2*f(n,1,1)+f(n,2,1)];
    }
    int f(int a,int x,int y) {
        return a==x||a==y?1:a<y?0:f(a,y,x+y);
    }

}

I found no way so far to test for 2016 and return "Trump" in code that's less than 15 bytes in code.

Love that first line of your explanation!

C (gcc),  128   120   116  110 bytes
a;b;o;f(n){for(o=b=0,a=1;a<=n;b=a+b,a=b-a)o|=(b==n)+2*(2*a+b==n);n=o?o-1?o-2?"Travis":"Lucas":"Ness":"Pippi";}

Try it online!
Explanation
Let's name F(n) the n-th Fibonacci number, and L(n) the n-th Lucas number.
a, b are F(n-1), F(n) respectively.
Then we can calculate L(n) == F(n-1)+F(n+1) == 2*F(n-1) + F(n) == 2*a+b
This function will successively calculate Fibonacci and Lucas numbers, up to n, and check if n is any of them.
If n is a Fibonacci number, the 1st bit of o will be set to 1
If n is a Lucas number, the 2nd bit of o will be set to 1
o will then be used to determine which name to output
Edit

Saved 8 bytes by golfing the condition of the for-loop : starting at second iteration, we have a<b<c and a<a+c=L(n), so ( b<=n || a+c<=n ) => a<n. I actually needed a<=n to handle correctly n=1
Saved 4 bytes thanks to ceilingcat ! (also corrected a mistake, my code was outputting "2 => Ness")
Saved 6 bytes:

2 thanks to ceilingcat again
4 by removing the variable c, equal to F(n+1), which was useless since we can already calculate F(n+1) with a and b

Suggest b+=a instead of b=a+b

05AB1E, 39 37 (52 - 15 bonus) bytes
2016Qi.•ªb‚•ë>ÅG¹å_¹ÅF¹åi.•F_ïk|»9•ë.•?®B'5n•}2äsè}™

Try it online or verify all test cases.
Explanation:
2016Qi                # If the input equals 2016:
      .•ªb‚•          #  Push "trump" to the stack
ë                     # Else:
 >ÅG                  #  List of Lucas numbers up to and including the input+1
    ¹å                #  Check if the input is in this list (1 if truthy; 0 if falsey)
      _               #  Invert the boolean (0→1 and 1→0)
 ¹ÅF                  #  List of Fibonacci numbers up to and including the input
    ¹åi               #  If the input is in this list:
       .•F_ïk|»9•     #   Push string "travisnessi" to the stack
    ë                 #  Else:
     .•?®B'5n•        #   Push string "pippilucas" to the stack
    }                 #  Close the inner if-else
     2ä               #  Split the string into two parts
                      #   i.e. "travisnessi" → ["travis","nessi"]
                      #   i.e. "pippilucas" → ["pippi","lucas"]
       sè             #  Index the Lucas result into the list of two strings
}                     # Close the outer if-else
 ™                    # And output the top of the stack in title-case

Groovy, 149 bytes
f={i->g={m,s->while(s[-2]<=m)s<<s[-2]+s[-1];s}
println(["Pippi","Ness","Lucas","Travis"][(g(i,[1,1]).contains(i)?1:0)+(g(i,[2,1]).contains(i)?2:0)])}

Test code:
[1,2,3,4,5,6,7,8,610,722,843].each {
    print "$it => "
    f(it)
}

g is a closure that generates a list of numbers based on a seed (s) and a max value (m). (g(i,[1,1]).contains(i)?1:0)+(g(i,[2,1]).contains(i)?2:0) finds the index to use based on the number being lucas or fibonacci.

Perl 5.10, 119 - 15 (bonus) = 104 bytes
$_=<>;$j=1;($i,$j)=($j,$i+$j)while$_>$i;say$_-2016?(Pippi,Lucas,Ness,Travis)[($_==$i)*2|$_==3*$j-4*$i|$_-1>>1==0]:Trump

Ungolfed:
# Read line from stdin
$_ = <>;

# Find first Fibonacci number greater than or equal to input.
# Store this number in $i and the next Fibonacci number in $j.
$j = 1;
($i, $j) = ($j, $i + $j) while $_ > $i;

say $_ - 2016
  ? (Pippi,Lucas,Ness,Travis)[
      ($_ == $i) * 2 |          # Bitwise OR with 2 if Fibonacci number
      $_ == 3 * $j - 4 * $i |   # Bitwise OR with 1 if Lucas number >= 3
      $_ - 1 >> 1 == 0          # Bitwise OR with 1 if Lucas number <= 2
    ]
  : Trump

This exploits the fact that
L(n-2) = 3 * F(n+1) - 4 * F(n)

is the greatest Lucas number lower to or equal than F(n).

MATLAB, 122 119 bytes
@(n)subsref({'Pippi','Lucas','Ness','Travis'},substruct('{}',{(1:2)*any(~rem(real(sqrt(5*n^2+[-20,-4;20,4])),1)).'+1}))

Brief Explanation
We first create a cell array containing the values to print: {'Pippi', 'Lucas', 'Ness', 'Travis'}. Then to figure out which value to display, we check to see whether n is a Fibonacci or Lucas number.
For Fibonnaci, we use the following formula:
any(~rem(sqrt(5*n^2 + [-4 4]), 1))

This checks to see if either 5*n^2 + 4 or 5*n^2 - 4 are a perfect square. If any of them are, then it is a Fibonacci number.
The formula for a Lucas number is very similar with the exception that we use +/- 20 instead of 4:
any(~rem(sqrt(5*n^2 + [-20 20]), 1))

In this solution I combined these two cases into one by using the matrix:
M = [-20 -4
      20  4]

By applying the same equation as those above, but force any to consider only the first dimension, I get a two element logical array where if the first element is true, then it is a Lucas number and if the second element is true, it is a fibonacci number.
any(~rem(sqrt(5*n^2 + [-20 -4;20 4]), 1))

Then to compute the index into my initial cell array, I treat this as a binary sequence by performing element-wise multiplication of this boolean with [2^0, 2^1] or simply [1,2]. And sum the elements. Obviously I have to add 1 because of MATLAB's one-based indexing.
index = (1:2) * any(~rem(real(sqrt(5*n^2+[-20,-4;20,4])),1)).' + 1;

Then I have to use subsref and substruct to index into the initial cell array to obtain the final result.

JavaScript (ES6), 97 bytes
x=>[['Pippi','Lucas'],['Ness','Travis'],f=(a,x,y=1)=>a>x?f(a,y,x+y):a==x||a==1][+f(x,0)][+f(x,2)]

The a==1 check is needed otherwise I don't notice that 1 is a Lucas number.

Jelly, 47 bytes - 15 = 32
+2ḶÆḞ⁸eð+ị“©ḤʠhMṂƁÞḄṭAƓ»Ḳ¤µ2+Ð¡-⁸eḤ
“¡Ỵ¦»Ç⁼?⁽¥Ð

Try it online!


text:
Write a ~ATH Interpreter
The popular webcomic Homestuck makes use of a programming language called ~ATH to destroy universes. While this code golf challenge is not to write a program to annihilate our existence, we will be destroying some more tame (albeit less interesting) entities: variables.
~ATH (pronounced "til death," notice how ~ath is "tilde ath") works by creating a variable called THIS, executing a command with EXECUTE, and finishing the program with THIS.DIE(). A wiki page for the language's use in Homestuck can be found here. The goal of this challenge will be to create a ~ATH interpreter.
For the sake of the challenge, I'm going to create some details of ~ATH that don't really exist but make it (somewhat) useful.

The language will only work with integers, which are declared with import <variable name>;. The variable will automatically be set to a value of 0. Only one variable at a time can be imported.
A variable x can be copied by writing bifurcate x[y,z];, which will delete the variable x and replace it with identical variables y and z. Note that it cannot create a variable with the same name as the one deleted. Essentially, a variable is renamed, then a copy of the variable with a different name is created. This seems like a stupid feature, but stupidity is very deeply ingrained in Homestuck.
The syntax for writing a program that executes code on x is ~ATH(x){EXECUTE(<code>)}. If you want to execute code on two variables simultaneously, the code becomes nested, like this: ~ATH(x){~ATH(y){EXECUTE(<code>)}}. All commands in <code> will be executed on both x and y.
Now let's move onto commands. + increments relevant variable(s) by 1 and - decrements them by 1. And... that's it.
The final feature of ~ATH is that it kills whatever it works with. Variables are printed in the format <name>=<value> (followed by a newline) at the command [<name>].DIE();. Afterwards, the program prints the word DIE <name> and a newline a number of times equal to the absolute value of the value of the variable. When variables are killed simultaneously with [<name1>,<name2>].DIE(); (you can have as many variables killed as you want, so long as they exist), the DIE() command is executed on the variables sequentially.

Example programs
Program 1:
import sollux;                  //calls variable "sollux"
import eridan;                  //calls variable "eridan"
~ATH(sollux){EXECUTE(--)}       //sets the value of "sollux" to -2
~ATH(eridan){EXECUTE(+++++)}    //sets the value of "eridan" to 5
[sollux].DIE();                 //kills "sollux", prints "DIE sollux" twice
~ATH(eridan){EXECUTE(+)}        //sets the value of "eridan" to 6
[eridan].DIE();                 //kills "eridan", prints "DIE eridan" 6 times

Output:
sollux=-2
DIE sollux
DIE sollux
eridan=6
DIE eridan
DIE eridan
DIE eridan
DIE eridan
DIE eridan
DIE eridan

Program 2:
import THIS;                    //calls variable "THIS"
~ATH(THIS){EXECUTE(++++)}       //sets the value of "THIS" to 4
bifurcate THIS[THIS1,THIS2];    //deletes "THIS", creates variables "THIS1" and "THIS2" both equal to 4
~ATH(THIS1){EXECUTE(++)}        //sets the value of "THIS1" to 6
[THIS1,THIS2].DIE();            //kills "THIS1" and "THIS2", prints "DIE THIS1" 6 times then "DIE THIS2" 4 times

import THAT;                                         //calls variable "THAT"
bifurcate THAT[THESE,THOSE];                         //deletes "THAT", creates variables "THESE" and "THOSE"
~ATH(THESE){~ATH(THOSE){EXECUTE(+++)}EXECUTE(++)}    //sets the value of "THESE" and "THOSE" to 3, then sets the value of "THESE" to 5
[THESE,THOSE].DIE();                                 //kills "THESE" and "THOSE", prints "DIE THESE" 5 times then "DIE THOSE" 3 times

Output:
THIS1=6
DIE THIS1
DIE THIS1
DIE THIS1
DIE THIS1
DIE THIS1
DIE THIS1
THIS2=4
DIE THIS2
DIE THIS2
DIE THIS2
DIE THIS2
THESE=5
DIE THESE
DIE THESE
DIE THESE
DIE THESE
DIE THESE
THOSE=3
DIE THOSE
DIE THOSE
DIE THOSE

This is code golf, so standard rules apply. Shortest code in bytes wins.

Til death. I see what you did there.

@DigitalTrauma I gotta pass the credit to Andrew Hussie (the guy who writes Homestuck) for coming up with the name.

@ the downvoters, would you mind sharing what you think could be improved?

Should the interpreter be pedantic about semicolons on line-endings? or can it just ignore their existence or lack thereof?

Also, does it have to function like a REPL or can we read from a file?

Is case sensitivity important everywhere or just in output?

@sysreq ~ATH uses semicolons as line-endings for the import, bifurcate, and DIE commands. Both REPL and files are fine. Case sensitivity is required in both the input and the output (I'm trying to match the actual ~ATH as much as possible).

Can we assume that EXECUTE statements like {EXECUTE(+-++--+--)} are not valid syntax and should be ignored?

@sysreq Without ~ATH(<name>), those statements are not valid syntax. However, with ~ATH(<name>), that statement would decrement the variable by 1.

the last line in program 2 doesn't end in a semicolon, but it should. I just spent 15 minutes refactoring my parser to figure out why it was recording values incorrectly, but it was a missing semicolon. I never thought I'd fall for one of those :-(

Also, the wiki's description of the language is wildly different (from a bare syntax perspective) from what's described here; I assume it's o.k. if I use strictly your spec?

@sysreq I had to change a few things so the language would actually do something in real life, pecs I described are fine.

I'm honestly surprised this question hasn't gotten more responses, and even more surprised there's no horde of Perl wizards armed with regexy wands of magic

Maybe it's because the final product is rather large or that after all, this is an interpreter for a fake language that doesn't exist in the human world.

That means I maintain the only interpreter for a fictional language from a fictional universe with a large nerd fanbase. Makes me want to improve it.

Python 2.7.6, 1244 1308 1265 1253 1073 1072 1071 1065 1064 1063 bytes
Alright, I'm not breaking any records here but this is about the smallest Python will go insofar as reading input all at once from a file rather than sequentially over time. I'll try to one-up this later in a different language (and an interpreter, not just a parser). Until then, enjoy the disgustingly horrid monstrosity.
Note: opens a file called t in the working directory. To make it open a command line argument, add import sys to the top of the file and change 't' to sys.argv[1]
n=s='\n';m=',';X='[';Y=']';c=';';A='~ATH';D='import';b,g,k=[],[],[];r=range;l=len;f=open('t','r').read().split(n)
def d(j,u):
 p=[]
 for e in j:
  if e!=u:p.append(e)
 return''.join(p)
for h in r(l(f)):f[h]=f[h].split('//')[0].split()
while[]in f:f.remove([])
for h in r(l(f)):
 i=f[h]
 if i[0]==D and l(i)==2and i[1][l(i[1])-1]==c and d(i[1],c)not in b:g.append(0);b.append(d(i[1],c))
 elif i[0].startswith(A):
  i=i[0].split('){')
  for e in r(l(i)):
   if i[e].startswith(A):
    i[e]=i[e].split('(')
    if i[0][1]in b:g[b.index(i[0][1])]+=(i[1].count('+')-i[1].count('-'))
 elif i[0].startswith('bifurcate')and l(i)==2and i[1][l(i[1])-1]==c:
  i=i[1].split(X)
  if i[0] in b:
   z=d(d(i[1],c),Y).split(m)
   for e in r(l(z)):g.append(g[b.index(i[0])]);b.append(z[e])
   g.remove(g[b.index(i[0])]);b.remove(i[0])
 elif i[0].startswith(X)and i[0].endswith('.DIE();')and l(i)==1:
  z=d(i[0],X).split(Y)[0].split(m)
  for e in r(l(z)):
   k.append((z[e],g[b.index(z[e])]))
for e in r(l(k)):k0=k[e][0];k1=k[e][1];s+=k0+'='+str(k1)+n+('DIE '+k0+n)*abs(k1)
print s

Python 2, 447 475 463 443 bytes
exec("eNp1UUtrAjEQvu+vCEshiYnrxl7KbqOUVmjvCoUkxUdiG7BRkpW2iP3tTVwrReppMsx8r4l936x9A8JXoN5kmu/2WeCxK0KjrSu8mWmEs0Ad96YI27lDPu/1is7wKqcQ0kBLenM+ty0nilu4zqnPtYCSQcXL2P2LmNvl1i9mjWlBUhwKbRt14uhHjlSvjzVy1tqswO/7AjsSpKtwIpGvt2zALqyNnkf3k/FIolb2ACjlpe2jR6lk8fAUQbKNulx7YIF1IDkqwmZlGwQpxNXGW9cASyCHZKqFVVOCoJQOEhjxABKLO7N5QGmET5qOs/Qfoqq6TGUfb3ZlgKvOnOxTwJKpDq6HSLzsVfK1k7g1iB7Hd9/JWh3T9wclkYwTlY4odP0nnvk0C3RUwj95/ZUq".decode('base64').decode('zip'))

It turns out zipping and encoding the program base64 still saves bytes over the normal version. For comparison, here's the normal one:
import sys,re
d={}
s=sys.stdin.read()
s,n=re.subn(r"//.*?$",'',s,0,8)
s,n=re.subn(r"import (.*?);",r"d['\1']=0;",s,0,8)
s,n=re.subn(r"bifurcate (.*?)\[(.*?),(.*?)\];",r"d['\2']=d['\3']=d['\1'];del d['\1'];",s,0,8)
s,n=re.subn(r"([+-])",r"\g<1>1",s,0,8)
s,n=re.subn(r"EXECUTE\((.*?)\)",r"0\1",s,0,8)
s,n=re.subn(r"\[(.*?)\]\.DIE\(\);",r"for i in '\1'.split(','):print i+'='+`d[i]`+('\\n'+'DIE '+i)*abs(d[i])",s,0,8)
n=1
s=s[::-1]
while n:s,n=re.subn(r"\}([+-01]*);?([^}]*?)\{\)(.*?)\(HTA~",r";\g<2>0+\1=+]'\3'[d;\1",s,0,8)
exec(s[::-1])

Basically the "regexy wands of magic" solution that was desired. Reads in the entire program from stdin as a single string, replaces ~ATH expressions with Python expressions that do the described semantics, and exec()s the resulting string.
To see what it's doing, look at the python program the second provided test program gets translated to:
d['THIS']=0;
0+1+1+1+1;d['THIS']+=0+1+1+1+1+0;
d['THIS1']=d['THIS2']=d['THIS'];del d['THIS'];
0+1+1;d['THIS1']+=0+1+1+0;
for i in 'THIS1,THIS2'.split(','):print i+'='+`d[i]`+('\n'+'DIE '+i)*abs(d[i])

d['THAT']=0;
d['THESE']=d['THOSE']=d['THAT'];del d['THAT'];
0+1+1;d['THESE']+=0+1+1+00+1+1+1;d['THOSE']+=0+1+1+1+0;
for i in 'THESE,THOSE'.split(','):print i+'='+`d[i]`+('\n'+'DIE '+i)*abs(d[i])

It's a good thing that 00 == 0 :P
Obviously, a few bytes could be saved by exploiting ambiguity in the rules. For instance, it isn't said what should happen in the event someone tries to DIE() a variable that hasn't been imported, or that has already been bifurcated. My guess based on the description was that there should be an error. If no error is required, I could remove the del statement.
EDIT: Fixed a bug that the provided test cases didn't test for. Namely, the way it was, every ~ATH block reset the variable to zero before incrementing it. It cost me 28 bytes to fix that. If anyone sees a better way to replace ~ATH blocks, I'd love to know it.
EDIT 2: Saved 12 bytes by unrolling the regex loop, making them all subns and letting the compression take care of the repetition.
EDIT 3: Saved 20 more bytes by replacing the inner for loop with a string multiplication.

Hey, finally the regexy wands of magic! I won't be able to beat this but well done!

My implementation completely ignores things not explicitly covered by the rules, which means it's okay for you to not throw an error and just ignore those cases too.

you could save some bytes by doing import sys,re rather than import sys;import re

Also, how do you actually use this? you read from sys.stdin but far as I can tell, termination/execution/printing never occurs because it never stops reading from stdin. (Testing on IDLE, 2.7.6)

syntax highlighting makes this a lot easier to read

@cat sorry i forgot to answer you ever so long ago. you run it from the command line and pipe the input into from a file: python ~ath.py < program.~ath


text:
Packing Circles
Take a look at this image. Specifically, at how the holes on the ends are arranged.

(Image source)
Notice how the pipes in this image are packed in a hexagonal pattern. It is known that in 2D, a hexagonal lattice is the densest packing of circles. In this challenge, we will be focusing on minimizing the perimeter of a packing of circles. One useful way to visualize the perimeter is to imagine putting a rubber band around the collection of circles.
The Task
Given a positive integer n as input, show a collection of n circles packed as tightly as possible.
Rules and Clarifications

Assume circles have a diameter of 1 unit.
The variable to be minimized is the length of the perimeter, which is defined to be the convex hull of the centers of the circles in the group. Take a look at this image:

The three circles in a straight line have a perimeter of 4 (the convex hull is a 2x0 rectangle, and the 2 is counted twice), those arranged in a 120-degree angle have a perimeter of about 3.85, and the triangle has a perimeter of only 3 units. Note that I am ignoring the additional pi units that the actual perimeter would be because I'm only looking at the circles' centers, not their edges.

There may (and almost certainly will be) multiple solutions for any given n. You may output any of these at your discretion. Orientation does not matter.
The circles must be on a hexagonal lattice.
The circles must be at least 10 pixels in diameter, and may be filled or not.
You may write either a program or a function.
Input may be taken through STDIN, as a function argument, or closest equivalent.
The output may be displayed or output to a file.

Examples
Below I have example valid and invalid outputs for n from 1 to 10 (valid examples only for the first five). The valid examples are on the left; every example on the right has a greater perimeter than the corresponding valid example.

Much thanks to steveverrill for help with writing this challenge. Happy packing!

Waiting on Hexagony, I'm betting. ;D

@VoteToClose: I don't think Hexagony has graphical output, but MAN, that'd be awesome!

@El'endiaStarman Well, you could write an SVG to stdout, but I don't think I'm going to... :P

Wow, no-one has thanked me in bold for my comments in the sandbox before. I'm blushing :-D Of course I commented because I liked the challenge, though I'm not sure if i'm going to have time to answer it.

Per my discussion with Reto Koradi on user81655's answer, I think the largest hexagon we will see with sharp corners is sidelength 7d (8 circles.) That's N=169 circles total. You could consider restricting the problem to that number, which would give more chance of getting a correct answer (currently there aren't any) and of being able to check. On the other hand it may be more interesting to leave the problem open up to arbitrary N.

@steveverrill: I think I'll go with the "interesting" choice and require that it work for arbitrary N (within reason, of course).

Update: there is a better solution for N=169 than a perfect hexagon. We leave 2 opposite corners alone, and remove the circles from the remaining 4 corners. We place them on the sides of 5d (6 circles) thus created as near to the middle of the side as possible (as there is an odd number of gaps, there are 2 distinct ways of doing this for each side.) The resulting figure has a perimeter of 41.933 instead of 42. Is it the best possible? probably, I don't know.

This is looking more and more like a code-challenge rather than a code-golf problem!

@DavidCarraher: Haha, yeah, I wasn't totally sure which one to pick before I posted. I don't know if it would be acceptable to change the problem type now, almost 48 hours after it was posted.

I would change it to code-challenge, even at this point, because that will encourage people to pay attention to less than perfect but interesting proposals.  It may also encourage people to invest in more imaginative approaches.

@DavidCarraher: I do like that idea. But what should the scoring criteria be? I'm thinking "the first answer to get the best solution for n=1000".

Strangely enough, the solution for n =1000, or any large number, should be relatively easy: you simply (I think) shrink a circle, with center on 1 hex grid point until the circle holds 1000 hex grid points.  You still may have to make minor adjustments because the most efficient solution may lie on a diagonal between two neighboring points.

Maybe a popularity contest?  You  might want to raise the issue of the proper tag in the sandbox.

@DavidCarraher: The Sandbox seems like a strange place to bring that up. The corresponding post has already been edited and deleted. But bringing it up in a separate Meta question also seems a bit strange. Chat would probably be best, but there are few people around (likely because of the upcoming Thanksgiving break).

Mathematica 295  950 bytes
Note:
This still-to-be-golfed version addresses issues raised by Steve Merrill regarding my earlier attempts.
Although it is an improvement over the first version, it will not find the densest handle configuration where one would seek a circular, rather than hexagonal, overall shape.
It finds solutions by building a complete inner hexagon (for n>=6, and then examines all of the configurations for completing the outer shell with the remaining circles.
Interestingly, as Steve Merrill noted in the comments, the solution for n+1 circles does not always consist of the solution for n circles with another circle added on.  Compare the given solution for 30 circles to the given solution for 31 circles.  (Note: there is a unique solution for 30 circles.)
m[pts_]:={Show[ConvexHullMesh[pts],Graphics[{Point/@pts,Circle[#,1/2]&/@ pts}],
ImageSize->Tiny,PlotLabel->qRow[{Length[pts],"  circles"}]],
RegionMeasure[RegionBoundary[ConvexHullMesh[pts]]]};
nPoints = ((#+1)^3-#^3)&;pointsAtLevelJ[0] = {{0,0}};
pointsAtLevelJ[j_]:=RotateLeft@DeleteDuplicates@Flatten[Subdivide[#1, #2, j] &@@@
Partition[Append[(w=Table[j{Cos[k Pi/3],Sin[k Pi/3]},{k,0,5}]),
w[[1]]], 2, 1], 1];nPointsAtLevelJ[j_] := Length[pointsAtLevelJ[j]]
getNPoints[n_] := Module[{level = 0, pts = {}},While[nPoints[level]<=n,
pts=Join[pointsAtLevelJ[level],pts];level++];Join[Take[pointsAtLevelJ[level],n-Length[pts]],
pts]];ns={1,7,19,37,61,91};getLevel[n_]:=Position[Union@Append[ns,n],n][[1, 1]]-1;
getBaseN[n_] := ns[[getLevel[n]]];pack[1]=Graphics[{Point[{0,0}], Circle[{0, 0}, 1/2]},
ImageSize->Tiny];pack[n_]:=Quiet@Module[{base = getNPoints[getBaseN[n]],
outerRing = pointsAtLevelJ[getLevel[n]], ss},ss=Subsets[outerRing,{n-getBaseN[n]}];
SortBy[m[Join[base,#]]&/@ss,Last][[1]]]

Some of the checks entailed comparisons of over one hundred thousand cases for a single value of n (including symmetries).  It took approximately 5 minutes to run the total 34 test cases.  Needless to say, with larger n's this brute-force approach would soon prove impractical.  More efficient approaches are certain to exist.
The numbers to the right of each packing are the perimeters of the respective blue convex hulls.  Below is the output for 3 < n < 35.  The red circles are those added around a regular hexagon.

As I mentioned on user 81655's answer, the protruding single circle on 22 (and 17, 25, 28, 31, 34) would be better placed at the middle of the row of circles on which it sits.

I thought so also, but then I noted that 9, which also has a protruding circle was considered correct.  When I have some time, I'll compare the measurements of the convex hulls (of the centers).

in 9 the protruding circle is either 1/4 or 3/4 along the flat row, so it makes no difference. in 17, 22, 25, 28, 31 the protruding circle is  1/6, 3/6 or 5/6 along, so the middle position is better (think about pulling a string sideways: it's easier to pull from the middle because that way the string has less extension to do. In 34 (and 35) we have 1/8, 3/8, 5/8 and 7/8 along the flat side. So for these we should choose 3/8 and 5/8 before 1/8 and 7/8.

You're absolutely right and this is confirmed by measurements.

This is awesome! The transition 30->31 shows that we can't just take the previous shape and add a circle to the outside (that would have given a perimeter of 16.464.) There's also at least one case where you could have just added one circle to the outside, but chose a different arrangement: 12->13

Nice observations. I am especially puzzled by 30 because I thought my routine would build at most 1 layer around a complete regular hexagon.

It did only build one layer. In 27=19+8 it put the additional 8 at the bottom, but in 30=19+11 it put them top, bottom and right (or if you prefer, top, bottom and left.) If you did them different colours you would see that the additions are different. Yet, by coincidence, the shape of 27 is fully contained in 30.

You are right about 30 circles.  I used your suggestion to color the "additional" circles in red.  It really helps parse the figures.