PPXOASO - XÓA SỐ

 Cho 1 số nguyên N (tối đa 1000 chữ số). Hãy tìm số lớn nhất có được sau khi xóa 1 chữ số trong N.

 For an integer N (1000 digits). Look for the largest number by deleting one digit in N.

Input

  • Dòng đầu chứa T (T<100) là số bộ test.
  • The first line contains T (T <100) is the number of test cases.
  • T dòng sau mỗi dòng chứa 1 số nguyên dương N (N>9) không quá 1000 chữ số.
  • T line after each line contains an integer N (N> 9) of no more than 1000 words.

Output

  • T dòng, mỗi dòng chứa 1 kết quả tương ứng.
  • T lines, each containing a corresponding result.

Example

Input:
3
2013
4673
10

Output:
213
673
1

ID RESULT TIME
code...



Added by:Phạm Quang Chiến PROPTIT_D12CN2
Date:2013-07-23
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:chienptit.94

hide comments
2013-08-02 14:31:11 RAJDEEP GUPTA
I suspect there is some problem with the i/p data. Even O(n) per test case got TLE .

Edit: Don't take any input for number of test cases. Just do while( scanf("%s",your_string) != EOF )

Last edit: 2013-07-26 16:27:46
2013-08-02 14:31:11 ss
in this problem, nothing to do with test case .. even i got AC without taking input t(test case)
2013-08-02 14:31:11 pika_pika
Strange.. it didn't work with just taking the no of testcases and didnt work with just taking EOF but did work by taking both, the no of testcases and running till EOF. @problem setter please check the input files.
2013-08-02 14:31:11 Xsquare
go for EOF and not the number of testcases! xD ;)
2013-08-02 14:31:11 Anant Kumar
why isn't c included in the language list
2013-08-02 14:31:11 Xsquare
Problem should be hidden or the input should be corrected!
Everything is rewarded with TLE :/
2013-08-02 14:31:11 Miguel Oliveira
this is an easy version of http://www.spoj.com/problems/MAX_NUM/
2013-08-02 14:31:11 Phạm Quang Chiến PROPTIT_D12CN2
I will try to translate to English
2013-08-02 14:31:11 Federico Lebrón
Is there an English version?
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.