/
Best Before Puzzle - Spotify.html
469 lines (422 loc) · 35.3 KB
/
Best Before Puzzle - Spotify.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
<!DOCTYPE html>
<!-- saved from url=(0090)http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/tech/best-before/ -->
<html lang="en" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" async="" src="./Best Before Puzzle - Spotify_files/ga.js"></script><script type="text/javascript" async="" src="./Best Before Puzzle - Spotify_files/all.js" class="disconnect-collapsed"></script><script type="text/javascript" async="" src="./Best Before Puzzle - Spotify_files/cb-cookie.js"></script><script type="text/javascript" src="./Best Before Puzzle - Spotify_files/analytics.js"></script>
<link type="text/css" rel="stylesheet" href="./Best Before Puzzle - Spotify_files/banner-styles.css">
<title>Best Before Puzzle - Spotify</title>
<meta name="description" content="Spotify is a digital music service that gives you access to millions of songs.">
<meta name="keywords" content="Spotify, music, online, listen, streaming, play, digital, album, artist, playlist">
<meta charset="UTF-8">
<meta property="fb:app_id" content="174829003346">
<meta property="og:title" content="Best Before Puzzle - Spotify">
<meta property="og:type" content="website">
<meta property="og:url" content="http://www.spotify.com/jobs/tech/best-before/">
<meta property="og:image" content="http://cf.scdn.co/i/touch-icon.png">
<meta property="og:description" content="Spotify is a digital music service that gives you access to millions of songs.">
<link rel="shortcut icon" href="http://web.archive.org/web/20120809045613im_/http://cf.scdn.co/i/favicon.ico" type="image/vnd.microsoft.icon">
<link rel="apple-touch-icon" href="http://web.archive.org/web/20120809045613/http://cf.scdn.co/i/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="72x72" href="http://web.archive.org/web/20120809045613/http://cf.scdn.co/i/touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="114x114" href="http://web.archive.org/web/20120809045613/http://cf.scdn.co/i/touch-icon-iphone4.png">
<link href="./Best Before Puzzle - Spotify_files/base-v5.css" type="text/css" rel="stylesheet" media="screen">
<link href="./Best Before Puzzle - Spotify_files/old-v4.css" type="text/css" rel="stylesheet" media="screen">
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<![endif]-->
<!--[if IE 8]>
<link href="/web/20120809045613/http://cf.scdn.co/css/ie8.css" type="text/css" rel="stylesheet" media="screen">
<![endif]-->
<!--[if lte IE 7]>
<link href="/web/20120809045613/http://cf.scdn.co/css/ie7.css" type="text/css" rel="stylesheet" media="screen">
<![endif]-->
<link href="./Best Before Puzzle - Spotify_files/jobs.css" type="text/css" rel="stylesheet" media="screen">
<link href="./Best Before Puzzle - Spotify_files/notification-bar.css" type="text/css" rel="stylesheet" media="screen">
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [], _kmq = _kmq || [], spyConfig = {"googleanalytics":true,"twitter":true,"static":"/web/20120809045613/http://cf.scdn.co"};
function spyASL(src){ setTimeout(function(){
var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = src;
var e = document.getElementsByTagName("script")[0]; e.parentNode.insertBefore(s, e);
}, 1);
}
//]]>
</script>
</head>
<body class="m-us l-en p-jobs-tech-best-before" style=""><div id="wm-ipp" lang="en" class="__wb_banner_div" style="display: none; position: relative; padding: 0px 5px; min-height: 70px; min-width: 800px;">
<div id="wm-ipp-inside" class="__wb_banner_div" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(/static/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:'Lucida Grande','Arial',sans-serif!important;">
<table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
<td style="padding:10px;vertical-align:top;min-width:110px;">
<a href="http://web.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="./Best Before Puzzle - Spotify_files/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"></a>
</td>
<td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
<table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
<td style="padding:3px 0;" colspan="2">
<form target="_top" method="get" action="http://web.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://www.spotify.com/us/jobs/tech/best-before/" style="width:400px;font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;" onfocus="javascript:this.focus();this.select();"><input type="hidden" name="type" value="replay"><input type="hidden" name="date" value="20120809045613"><input type="submit" value="Go" style="font-size:11px;font-family:'Lucida Grande','Arial',sans-serif;margin-left:5px;width: inherit !important"><span id="wm_tb_options" style="display:block;"></span></form>
</td>
<td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
<table style="border-collapse:collapse;width:110px;color:#99a;font-family:'Helvetica','Lucida Grande','Arial',sans-serif;"><tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr style="width:110px;height:16px;font-size:10px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20120707021927/http://www.spotify.com/us/jobs/tech/best-before/" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="7 Jul 2012"><strong>JUL</strong></a>
</td>
<td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 4:56:13 Aug 9, 2012">AUG</td>
<td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20121005115334/http://www.spotify.com/us/jobs/tech/best-before/" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="5 Oct 2012"><strong>OCT</strong></a>
</td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr>
<td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20120807033748/http://www.spotify.com/us/jobs/tech/best-before/" title="3:37:48 Aug 7, 2012" style="background-color:transparent;border:none;"><img src="./Best Before Puzzle - Spotify_files/wm_tb_prv_on.png" alt="Previous capture" width="14" height="16" border="0"></a>
</td>
<td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 4:56:13 Aug 9, 2012">9</td>
<td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
<a href="http://web.archive.org/web/20120908034457/http://www.spotify.com/us/jobs/tech/best-before" title="3:44:57 Sep 8, 2012" style="background-color:transparent;border:none;"><img src="./Best Before Puzzle - Spotify_files/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"></a>
</td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr style="width:110px;height:13px;font-size:9px!important;">
<td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
<a href="http://web.archive.org/web/20110720125826/http://www.spotify.com/us/jobs/tech/best-before/" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="20 Jul 2011"><strong>2011</strong></a>
</td>
<td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 4:56:13 Aug 9, 2012">2012</td>
<td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
2013
</td>
</tr>
</tbody></table>
</td>
</tr>
<tr>
<td style="vertical-align:middle;padding:0!important;">
<a href="http://web.archive.org/web/20120809045613*/http://www.spotify.com/us/jobs/tech/best-before/" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>47 captures</strong></a>
<div class="__wb_banner_div" style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">18 Jul 11 - 12 Oct 12</div>
</td>
<td style="padding:0!important;">
<a style="position:relative; white-space:nowrap; width:450px;height:27px;" href="" id="wm-graph-anchor">
<div class="__wb_banner_div" id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:450px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
<img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;" onmouseover="showTrackers('inline');" onmouseout="showTrackers('none');" onmousemove="trackMouseMove(event,this)" alt="sparklines" width="450" height="27" border="0" src="./Best Before Puzzle - Spotify_files/graph.jsp">
<img id="wbMouseTrackYearImg" style="display:none; position:absolute; z-index:9010;" width="25" height="27" border="0" src="./Best Before Puzzle - Spotify_files/transp-yellow-pixel.png">
<img id="wbMouseTrackMonthImg" style="display:none; position:absolute; z-index:9011; " width="2" height="27" border="0" src="./Best Before Puzzle - Spotify_files/transp-red-pixel.png">
</div>
</a>
</td>
</tr></tbody></table>
</td>
<td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
<a href="javascript:;" onclick="document.getElementById('wm-ipp').style.display='none';" style="display:block;padding-right:18px;background:url(/static/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
<a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(/static/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:'Lucida Grande','Arial',sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
</td>
</tr></tbody></table>
</div>
</div>
<!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script> if (window.archive_analytics) { window.archive_analytics.values['server_name']="wwwb-app11.us.archive.org";}; </script>
<script type="text/javascript" src="./Best Before Puzzle - Spotify_files/disclaim-element.js"></script>
<script type="text/javascript" src="./Best Before Puzzle - Spotify_files/graph-calc.js"></script>
<script type="text/javascript" src="./Best Before Puzzle - Spotify_files/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
var firstDate = 820454400000;
var lastDate = 1388534399999;
var wbPrefix = "/web/";
var wbCurrentUrl = "http:\/\/www.spotify.com\/us\/jobs\/tech\/best-before\/";
var curYear = -1;
var curMonth = -1;
var yearCount = 18;
var firstYear = 1996;
var imgWidth = 450;
var yearImgWidth = 25;
var monthImgWidth = 2;
var trackerVal = "none";
var displayDay = "9";
var displayMonth = "Aug";
var displayYear = "2012";
var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
function showTrackers(val) {
if(val == trackerVal) {
return;
}
if(val == "inline") {
document.getElementById("displayYearEl").style.color = "#ec008c";
document.getElementById("displayMonthEl").style.color = "#ec008c";
document.getElementById("displayDayEl").style.color = "#ec008c";
} else {
document.getElementById("displayYearEl").innerHTML = displayYear;
document.getElementById("displayYearEl").style.color = "#ff0";
document.getElementById("displayMonthEl").innerHTML = displayMonth;
document.getElementById("displayMonthEl").style.color = "#ff0";
document.getElementById("displayDayEl").innerHTML = displayDay;
document.getElementById("displayDayEl").style.color = "#ff0";
}
document.getElementById("wbMouseTrackYearImg").style.display = val;
document.getElementById("wbMouseTrackMonthImg").style.display = val;
trackerVal = val;
}
function getElementX2(obj) {
var thing = jQuery(obj);
if((thing == undefined)
|| (typeof thing == "undefined")
|| (typeof thing.offset == "undefined")) {
return getElementX(obj);
}
return Math.round(thing.offset().left);
}
function trackMouseMove(event,element) {
var eventX = getEventX(event);
var elementX = getElementX2(element);
var xOff = eventX - elementX;
if(xOff < 0) {
xOff = 0;
} else if(xOff > imgWidth) {
xOff = imgWidth;
}
var monthOff = xOff % yearImgWidth;
var year = Math.floor(xOff / yearImgWidth);
var yearStart = year * yearImgWidth;
var monthOfYear = Math.floor(monthOff / monthImgWidth);
if(monthOfYear > 11) {
monthOfYear = 11;
}
// 1 extra border pixel at the left edge of the year:
var month = (year * 12) + monthOfYear;
var day = 1;
if(monthOff % 2 == 1) {
day = 15;
}
var dateString =
zeroPad(year + firstYear) +
zeroPad(monthOfYear+1,2) +
zeroPad(day,2) + "000000";
var monthString = prettyMonths[monthOfYear];
document.getElementById("displayYearEl").innerHTML = year + 1996;
document.getElementById("displayMonthEl").innerHTML = monthString;
// looks too jarring when it changes..
//document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
var url = wbPrefix + dateString + '/' + wbCurrentUrl;
document.getElementById('wm-graph-anchor').href = url;
//document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
if(curYear != year) {
var yrOff = year * yearImgWidth;
document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
curYear = year;
}
if(curMonth != month) {
var mtOff = year + (month * monthImgWidth) + 1;
document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
curMonth = month;
}
}
//]]>
</script>
<style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
<script type="text/javascript">
var wmDisclaimBanner = document.getElementById("wm-ipp");
if(wmDisclaimBanner != null) {
disclaimElement(wmDisclaimBanner);
}
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<div id="fb-root"></div>
<div id="container">
<div id="header">
<a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/" class="logo">Spotify</a>
<ul class="menu"><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/what/">What is Spotify?</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/get-spotify/overview/">Get Spotify</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/mobile/overview/">Mobile</a></li><li><a href="http://web.archive.org/web/20120809045613/http://community.spotify.com/">Community</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about-us/contact/">About us</a></li><li class="selected"><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/">Jobs</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/help/overview/">Help</a></li></ul>
<ul class="submenu jobs"><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/">Overview</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/vacancies/">Job Opportunities</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/people/">People</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/work/">Working at Spotify</a></li><li class="selected"><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/tech/">Puzzles</a></li></ul>
<div class="account">
<a href="http://web.archive.org/web/20120809045613/https://www.spotify.com/us/login/?forward_url=%2Fus%2Fjobs%2Ftech%2Fbest-before%2F" id="accountbtn">Log in<span>.</span></a>
<div id="accdropdown" class="login-active">
<a class="sp-fb-login sp-btn fb login-fixed-width">
<span class="step1">Log in with Facebook</span>
<span class="step2" style="display: none;">Logging in to Spotify...</span>
<span class="step3" style="display: none;">Logging in</span>
</a>
<div class="old-login">
<a class="sp-btn login-select login-fixed-width">
<span>Log in using Spotify details<div class="select-arrow"></div></span>
</a>
<div class="old-login-form" style="display:none;">
<form action="http://web.archive.org/web/20120809045613/https://www.spotify.com/us/login/" method="post">
<input type="hidden" name="forward_url" value="/us/jobs/tech/best-before/">
<input type="hidden" name="utm-keywords" value="71ee4a8bae8c52fe327408ba2d02092d">
<p>
<label for="login-username">Username</label><br>
<input type="text" name="user_name" tabindex="1" id="login-username">
</p>
<p>
<label for="login-password">Password</label><br>
<input type="password" name="password" tabindex="2" id="login-password">
</p>
<p class="left">
<button type="submit" tabindex="3"><span>Log in</span></button>
</p>
<p>
<a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/password-reset/" target="_blank">Forgot password or username?</a>
</p>
</form>
</div>
</div>
</div>
<a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/signup/open/" class="sp-btn-small">Sign up<span>.</span></a>
</div>
<div id="headerdude" class="header-message">
<a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/freetrial/?utm_source=Spotify&utm_medium=website&utm_campaign=Header_Dude&utm_content=30dt_Link" title="Find out more here." class="dude"></a>
<div class="balloon">
<ul>
<li>
<p>Hello there. Would you like to get Spotify on your mobile for 30 days free? <a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/freetrial/?utm_source=Spotify&utm_medium=website&utm_campaign=Header_Dude&utm_content=30dt_Link" title="Find out more here.">Find out more here.</a></p>
</li>
</ul>
<div class="left"></div>
<div class="right"></div>
</div>
</div>
</div>
<div id="pbody">
<div id="jobs">
<div class="cframe">
<div class="two-columns">
<div class="col1 smallmargin-c1">
<div class="content">
<div class="back">
<a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/jobs/tech/">« Back</a>
</div>
<h1>Best Before</h1>
<h2>Problem ID: bestbefore</h2>
<p class="piccopy">
<img width="230" height="153" class="" alt="" src="./Best Before Puzzle - Spotify_files/puzzle-best-before-b.jpg"><br>Picture by Henry M¨uhlpfordt (Own work) via Wikimedia Commons
</p>
<p>Just about any product found in a grocery store has a "best before" date printed on it. Unfortunately, the format for these dates can vary quite a bit: what is it supposed to mean that the bread you bought yesterday is "best before 12/11/10"? It could mean that the bread expires on November 10, 2012 (now that's a suspiciously durable bread and probably it is not healthy for you for other reasons!), or it could mean that the bread expired on December 11, 2010 (d'oh!), or a
variety of other options. To be safe, the truly paranoid (or healthily skeptic, depending on who you ask) person would assume that it means "best before November 12, 2010", since that is the earliest possible date. On the other hand, seeing "31/5/2012" even the truly paranoid person knows that this must mean May 31, 2012 since that is the only possible real date using these three numbers.</p>
<p>Given a possibly ambiguous date "A/B/C", where A,B,C are integers between 0 and 2999, output the earliest possible legal date between Jan 1, 2000 and Dec 31, 2999 (inclusive) using them as day, month and year (but not necessarily in that order).</p>
<p>Recall that a year is a leap year (has 366 days) if the year is divisible by 4, unless it is divisible also by 100 but not by 400 (so 2000 is a leap year, 2100 is not a leap year, and 2012 is a leap year).</p>
<h4>Input</h4>
<p>The input file consists of a single line containing three integers separated by "/". There are no extra spaces around the "/". Years may be truncated to two digits and may in that case also omit the leading 0 (if there is one), so 2000 could be given as "2000", "00" or "0" (but not as an empty string). Months and days may be zero-padded. You may assume that the year, when given with four digits, is between 2000 and 2999. At most one of the integers
has four digits, and the others have one or two digits.</p>
<h4>Output</h4>
<p>Output a single line giving the earliest legal date possible given the above constraints. The output should be formatted as year-month-day, where year has four digits, and month and day have two digits each (zero padding), for example "2011-07-15". If there is no legal date (subject to the above constraints) then output a single line with the original string followed by the words "is illegal".</p>
<div class="inputoutput">
<div class="leftcol">
<div class="colhead">Sample input 1</div>
<div class="inptbox">02/4/67</div>
</div>
<div class="inpbtn"></div>
<div class="rightcol">
<div class="colhead">Sample output 1</div>
<div class="inptbox">2067-02-04</div>
</div>
</div>
<div class="inputoutput">
<div class="leftcol">
<div class="colhead">Sample input 1</div>
<div class="inptbox">31/9/73</div>
</div>
<div class="inpbtn"></div>
<div class="rightcol">
<div class="colhead">Sample output 1</div>
<div class="inptbox">31/9/73 is illegal</div>
</div>
</div>
</div>
</div>
<div class="col2 smallmargin-c2">
<div class="content">
<h3>Solved puzzles & got hired</h3>
<div>
<img width="70" height="70" class="size-full alignleft" alt="" src="./Best Before Puzzle - Spotify_files/solved-elias.jpg"> <br>
<p>
<span class="highlight">Elias Freider</span><br>Software Engineer </p>
</div>
<div>
<img width="70" height="70" class="size-full alignleft" alt="" src="./Best Before Puzzle - Spotify_files/solved-jimmy.jpg"> <br>
<p>
<span class="highlight">Jimmy Mårdell</span><br>Software Engineer </p>
</div>
<div>
<img width="70" height="70" class="size-full alignleft" alt="" src="./Best Before Puzzle - Spotify_files/solved-par.jpg"> <br>
<p>
<span class="highlight">Pär Bohrarper</span><br>Software Engineer </p>
</div>
</div>
<div class="content">
<h3>Submit response</h3>
<p>To submit a solution to a problem, send an e-mail to</p>
<p>
<a href="mailto:puzzle@spotify.com">puzzle@spotify.com</a>
</p>
<p>Include your source code files as attachments and the problem id or problem name as subject. Within minutes you will get a reply indicating whether your source code solved the problem, and if it didn't, an indication of what was wrong. Your source code can be in C, C++, Java, or Python (version 2.6). Input is read from stdin.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div class="qlinks">
<h2>Quick links</h2>
<div class="section about_spotify"><h3><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/what/">What is Spotify?</a></h3><ul><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/what/">What is Spotify?</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/features/">Features</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/play/">Play Button</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/apps/">Spotify apps</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/spotify-on-facebook/">Spotify on Facebook</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/spotify-on-ipad/">Spotify on iPad</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/local-music/">Local music</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about/music-catalogue-info/">Music catalogue info</a></li></ul></div><div class="section download"><h3><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/download/">Download</a></h3><ul><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/download/mac/">Mac OS X</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/download/windows/">Windows</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/download/other/">Other platforms</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/download/previews/">Previews</a></li></ul></div><div class="section account"><h3><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/account/overview/">Account</a></h3><ul><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/account/overview/">Overview</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/account/profile/">Edit profile</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/account/share/">Share Spotify</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/account/subscription/">Subscription</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/redeem/">Redeem a code</a></li></ul></div><div class="section work_with_us"><h3><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/work-with-us/labels-and-artists/">Work with us</a></h3><ul><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/work-with-us/labels-and-artists/">Labels and Artists</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/work-with-us/advertisers/">Advertisers</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/work-with-us/partners/">Partners</a></li><li><a href="http://web.archive.org/web/20120809045613/http://developer.spotify.com/">Developers</a></li></ul></div><div class="section about_us"><h3><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about-us/contact/">About us</a></h3><ul><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about-us/contact/">Contact</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about-us/press/">Press</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/about-us/jobs/">Jobs</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/blog/">Blog</a></li></ul></div><div class="section legal"><h3><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/">Legal</a></h3><ul><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/privacy-policy/">Privacy policy</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/end-user-agreement/">Terms and Conditions of Use</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/premium-code-terms-and-conditions/">Premium Code Terms</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/mobile-terms-and-conditions/">Mobile Terms of Use</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/unlimited-code-terms-and-conditions/">Unlimited Code Terms</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/48-hour-free-trial-continuation-offer-terms-and-conditions/">48-Hour Free Trial Continuation Offer Terms and Conditions</a></li><li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/legal/new-30-days-free-trial-terms-and-conditions/">New 30-Days Free Trial Terms and Conditions</a></li></ul></div> <div class="breaker"></div>
<div class="copyright">Copyright © 2007-2012 Spotify Ltd</div>
</div>
<div class="fright">
<div id="marketswitch">
<h2>Country</h2>
<a class="market" title="Click to change">
<span class="flag us">USA</span>
</a>
<div class="selector">
Select your country:
<ul>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/au/" rel="au" title="Australia"><span class="flag au">Australia</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/at/" rel="at" title="Austria"><span class="flag at">Austria</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/be-nl/" rel="be-nl" title="Belgium (Dutch)"><span class="flag be-nl">Belgium (Dutch)</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/be-fr/" rel="be-fr" title="Belgium (French)"><span class="flag be-fr">Belgium (French)</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/dk/" rel="dk" title="Denmark"><span class="flag dk">Denmark</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/fi/" rel="fi" title="Finland"><span class="flag fi">Finland</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/fr/" rel="fr" title="France"><span class="flag fr">France</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/de/" rel="de" title="Germany"><span class="flag de">Germany</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/nl/" rel="nl" title="Netherlands"><span class="flag nl">Netherlands</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/nz/" rel="nz" title="New Zealand"><span class="flag nz">New Zealand</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/no/" rel="no" title="Norway"><span class="flag no">Norway</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/es/" rel="es" title="Spain"><span class="flag es">Spain</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/se/" rel="se" title="Sweden"><span class="flag se">Sweden</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/ch-fr/" rel="ch-fr" title="Switzerland (French)"><span class="flag ch-fr">Switzerland (French)</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/ch-de/" rel="ch-de" title="Switzerland (German)"><span class="flag ch-de">Switzerland (German)</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/us/" rel="us" title="USA"><span class="flag us">USA</span></a></li>
<li><a href="http://web.archive.org/web/20120809045613/http://www.spotify.com/uk/" rel="uk" title="United Kingdom"><span class="flag uk">United Kingdom</span></a></li>
</ul>
<div class="breaker"></div>
</div>
</div>
<div class="social">
<h2>Spotify on</h2>
<ul>
<li><a class="facebook" href="http://web.archive.org/web/20120809045613/http://www.facebook.com/Spotify">Facebook</a></li>
<li><a class="twitter" href="http://web.archive.org/web/20120809045613/http://www.twitter.com/Spotify">Twitter</a></li>
<li><a class="flickr" href="http://web.archive.org/web/20120809045613/http://www.flickr.com/groups/spotify/pool">Flickr</a></li>
<li><a class="youtube" href="http://web.archive.org/web/20120809045613/http://www.youtube.com/spotifydemo">YouTube</a></li>
</ul>
</div>
</div>
<div class="breaker"></div>
</div>
</div>
<script src="./Best Before Puzzle - Spotify_files/base-v4.js" type="text/javascript"></script><object type="application/x-shockwave-flash" data="http://web.archive.org/se/cb-cookie.swf" width="20" height="20" id="CBCookie" style="visibility: visible;"><param name="allowScriptAccess" value="always"></object>
<script type="text/javascript">
//<![CDATA[
Spy.Login.init(174829003346, "/web/20120809045613/https://www.spotify.com/us/login/fb/?forward_url=/us/");
spyASL('//connect.facebook.net/en_US/all.js');
_gaq.push(["_setAccount", "UA-5784146-1"],["_trackPageview", "/jobs/tech/best-before/"],["_setCustomVar", 5, "Market", "us"],["_setDomainName", ".spotify.com"],["_setAllowHash", false]);
spyASL("/web/20120809045613/http://www.google-analytics.com/ga.js");
//]]>
</script>
<script type="text/javascript">
if(Spy && Spy.MobileInstaller) Spy.MobileInstaller.init('us');
</script>
<!--
FILE ARCHIVED ON 4:56:13 Aug 9, 2012 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 13:30:22 Dec 11, 2013.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->
</body></html>