PPXOASO - XÓA SỐ

no tags 

 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

hide comments
RAJDEEP GUPTA: 2013-08-02 14:31:11

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
ss: 2013-08-02 14:31:11

in this problem, nothing to do with test case .. even i got AC without taking input t(test case)

pika_pika: 2013-08-02 14:31:11

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.

Xsquare: 2013-08-02 14:31:11

go for EOF and not the number of testcases! xD ;)

Anant Kumar: 2013-08-02 14:31:11

why isn't c included in the language list

Xsquare: 2013-08-02 14:31:11

Problem should be hidden or the input should be corrected!
Everything is rewarded with TLE :/

Miguel Oliveira: 2013-08-02 14:31:11

this is an easy version of http://www.spoj.com/problems/MAX_NUM/

Phạm Quang Chiến PROPTIT_D12CN2: 2013-08-02 14:31:11

I will try to translate to English

Federico Lebrón: 2013-08-02 14:31:11

Is there an English version?


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